Skip to content

Commit 81a6647

Browse files
authored
use a virtualenv on Windows to fix dirty environment issues (#1121)
* try to use a virtualenv on Windows to fix dirty environment issues * remove Python 3.6, add 3.9 on Windows
1 parent c268892 commit 81a6647

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.ci/.jenkins_windows.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
#
77

88
windows:
9-
- VERSION: "3.6"
10-
WEBFRAMEWORK: "none"
11-
ASYNCIO: "true"
9+
# - VERSION: "3.6"
10+
# WEBFRAMEWORK: "none"
11+
# ASYNCIO: "true"
1212
- VERSION: "3.7"
1313
WEBFRAMEWORK: "none"
1414
ASYNCIO: "true"
1515
- VERSION: "3.8"
1616
WEBFRAMEWORK: "none"
1717
ASYNCIO: "true"
18-
# - VERSION: "3.9" # waiting for greenlet to have binary wheels for 3.9
19-
# WEBFRAMEWORK: "none"
20-
# ASYNCIO: "true"
18+
- VERSION: "3.9" # waiting for greenlet to have binary wheels for 3.9
19+
WEBFRAMEWORK: "none"
20+
ASYNCIO: "true"

scripts/install-tools.bat

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\vsdevcmd.bat" -arch=amd64
99

1010
: We need wheel installed to build wheels
11-
call %PYTHON%\python.exe -m pip install -U wheel pip setuptools
12-
call %PYTHON%\python.exe -m pip install -r tests\requirements\reqs-%WEBFRAMEWORK%.txt
13-
call %PYTHON%\python.exe -m pip install psutil
11+
call %PYTHON%\python.exe -m venv "%cd%\venv"
12+
set VENV_PYTHON=%cd%\venv\Scripts\
13+
call %VENV_PYTHON%\python.exe -m pip install -U wheel pip setuptools
14+
call %VENV_PYTHON%\python.exe -m pip install -r tests\requirements\reqs-%WEBFRAMEWORK%.txt
15+
call %VENV_PYTHON%\python.exe -m pip install psutil

scripts/run-tests.bat

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
@echo off
77

88
@echo on
9+
set VENV_PYTHON=%cd%\venv\Scripts\
10+
911
set COVERAGE_FILE=.coverage.%VERSION%.%WEBFRAMEWORK%
1012
set IGNORE_PYTHON3_WITH_PYTHON2=
1113
if "%VERSION%" == "2.7" set IGNORE_PYTHON3_WITH_PYTHON2=--ignore-glob="*\py3_*.py"
1214

1315
set PYTEST_JUNIT="--junitxml=.\tests\python-agent-junit.xml"
1416
if "%ASYNCIO%" == "true" (
15-
%PYTHON%\python.exe -m pytest %PYTEST_JUNIT% %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest" || exit /b 1
17+
%VENV_PYTHON%\python.exe -m pytest %PYTEST_JUNIT% %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest" || exit /b 1
1618
)
1719
if "%ASYNCIO%" == "false" (
18-
%PYTHON%\python.exe -m pytest %PYTEST_JUNIT% --ignore-glob="*\asyncio*\*" %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest" || exit /b 1
20+
%VENV_PYTHON%\python.exe -m pytest %PYTEST_JUNIT% --ignore-glob="*\asyncio*\*" %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest" || exit /b 1
1921
)
20-
call %PYTHON%\python.exe setup.py bdist_wheel
22+
call %VENV_PYTHON%\python.exe setup.py bdist_wheel

0 commit comments

Comments
 (0)