-
-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Py3.8: Transparently use a Python virtual environment under the hood #12075
Changes from 23 commits
adf131a
5e87120
c8fc42b
9c9d1e1
3878133
90a7183
cd4a3cf
9503492
fd890d3
4a852d9
5795e76
6d58baa
3025d74
8074fa1
c22b7b3
0179e48
f70b0e8
cbd21be
6f427af
e59018e
daf53a1
ef52123
e7a54fd
713397c
c60975e
da159ae
2a9df26
459e3a3
12ae5a8
ada0b85
73c8490
19120dd
e924a87
1b827b6
1039dc5
8a13814
91193e2
f47db8e
8375c3e
2f01c39
f1eb3e9
89922ec
b834a4e
2039871
e2e23ed
34e7107
711eb37
ed432bf
b0cb717
7eb2584
ee498f3
7b125c6
b59263d
e820763
d8a89c0
d5e480c
e0f9c6b
c6c13e0
dd70ba8
95339d6
9ab0f6d
e008f1d
110edc1
778e512
06411a0
9b1c16a
cc7d219
0b78587
0dbdaed
49ea5ae
7a6fc4d
cca866a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ tests/unit/nvda.ini | |
source/locale/*/cldr.dic | ||
.vscode | ||
.vs | ||
.venv |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ branches: | |
- /release-.*/ | ||
|
||
environment: | ||
PY_PYTHON: 3.7-32 | ||
PY_PYTHON: 3.8-32 | ||
encFileKey: | ||
secure: ekOvuyywHuDdGZmRmoj+b3jfrq39A2xlx4RD5ZUGd/8= | ||
mozillaSymsAuthToken: | ||
|
@@ -59,6 +59,12 @@ init: | |
clone_depth: 1 | ||
|
||
install: | ||
# Ensure we have the latest version of pip | ||
- py -m pip install --upgrade pip | ||
# Activate the NvDA build system Python virtual environment, creating / updating it if necessary. | ||
- .\venvUtils\ensureAndActivate.bat | ||
# Save an exact list of the actual Python packages and their versions that got installed, to aide in reproducing a build | ||
- py -m pip freeze >output\pip_packages.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point there is no directory called 'output' - it is created later on by SCons, so this command fails. |
||
- cd appveyor | ||
# Decrypt files. | ||
- ps: | | ||
|
@@ -95,12 +101,12 @@ build_script: | |
Set-AppveyorBuildVariable "sconsOutTargets" $sconsOutTargets | ||
Set-AppveyorBuildVariable "sconsArgs" $sconsArgs | ||
- 'echo scons args: %sconsArgs%' | ||
- py scons.py source %sconsArgs% | ||
- scons source %sconsArgs% | ||
# We don't need launcher to run checkPot, so run the checkPot before launcher. | ||
- py scons.py checkPot %sconsArgs% | ||
- scons checkPot %sconsArgs% | ||
feerrenrut marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# The pot gets built by tests, but we don't actually need it as a build artifact. | ||
- 'echo scons output targets: %sconsOutTargets%' | ||
- py scons.py %sconsOutTargets% %sconsArgs% | ||
- scons %sconsOutTargets% %sconsArgs% | ||
# Build symbol store. | ||
- ps: | | ||
foreach ($syms in | ||
|
@@ -118,9 +124,6 @@ build_script: | |
- cd .. | ||
|
||
before_test: | ||
# install required packages | ||
- py -m pip install --upgrade pip | ||
- py -m pip install -r tests/system/requirements.txt -r tests/lint/lintInstall/requirements.txt | ||
- mkdir testOutput | ||
- mkdir testOutput\unit | ||
- mkdir testOutput\system | ||
|
@@ -153,7 +156,7 @@ test_script: | |
$errorCode=0 | ||
$outDir = (Resolve-Path .\testOutput\unit\) | ||
$unitTestsXml = "$outDir\unitTests.xml" | ||
py -m nose -sv --with-xunit --xunit-file="$unitTestsXml" ./tests/unit | ||
py -m nose -sv --with-xunit --xunit-file="$unitTestsXml" --traverse-namespace -w ./tests/unit | ||
if($LastExitCode -ne 0) { | ||
$errorCode=$LastExitCode | ||
Add-AppveyorMessage "Unit test failure" | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
+ − | python/brlapi-0.8.dll | |
+ − | python/brlapi.cp37-win32.pyd | |
+ − | python/brlapi.cp38-win32.pyd | |
+ − | python/libgcc_s_dw2-1.dll |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# NVDA's build system is SCons | ||
SCons==4.1.0.post1 | ||
|
||
# NVDA's runtime dependencies | ||
michaelDCurran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
comtypes==1.1.7 | ||
pyserial==3.5 | ||
wxPython==4.1.1 | ||
feerrenrut marked this conversation as resolved.
Show resolved
Hide resolved
michaelDCurran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# Packaging NVDA | ||
py2exe==0.10.1.0 | ||
|
||
# For building developer documentation | ||
sphinx==3.4.1 | ||
sphinx_rtd_theme | ||
|
||
# Requirements for automated linting | ||
flake8 ~= 3.7.7 | ||
flake8-tabs == 2.1.0 | ||
|
||
# Requirements for unit tests | ||
nose==1.3.7 | ||
|
||
# Requirements for system tests | ||
robotframework==3.2.2 | ||
robotremoteserver==1.1 | ||
robotframework-screencaplibrary==1.5.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
call "%~dp0\venvUtils\venvCmd.bat" py "%~dp0\source\nvda.pyw" %* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why you're using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If called from a batch file, pythonw will actually block. Calls in batch files always wait on any process executed. And since it blocks, and I added the freeConsole call in core.py so that the console is still usable by NVDA, we may as well use python rather than pythonw so that critical errors are not missed. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
@echo off | ||
rem We need this script because .py probably isn't in pathext. | ||
rem We can't just call python -c because it may not be in the path. | ||
rem Instead, find the python launcher (installed by python 3) | ||
where py 1>nul 2>&1 | ||
if "%ERRORLEVEL%" == "0" ( | ||
rem Python launcher is present in the PATH | ||
rem Call python 3.7 for 32 bits | ||
py -3.7-32 "%~dp0\scons.py" %* | ||
) else ( | ||
rem Python registers itself with the .py extension, so call scons.py. | ||
"%~dp0\scons.py" %* | ||
) | ||
rem Executes SScons within the NVDA build system's Python virtual environment. | ||
"%~dp0\venvUtils\venvCmd.bat" py -m SCons %* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a new line to the end of this file. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,19 @@ import sys | |
import os | ||
import platform | ||
|
||
# Ensure we are inside the NVDA build system's Python virtual environment. | ||
nvdaVenv = os.getenv("NVDA_VENV") | ||
virtualEnv = os.getenv("VIRTUAL_ENV") | ||
if not nvdaVenv or nvdaVenv != virtualEnv: | ||
print( | ||
"Error: SCons cannot detect the NVDA build system Python virtual environment.\n" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double space after 'detect' |
||
"SCons must be executed using scons.bat in the root of this repository." | ||
) | ||
sys.exit(1) | ||
|
||
# Variables for storing required version of Python, and the version which is used to run this script. | ||
requiredPythonMajor ="3" | ||
requiredPythonMinor = "7" | ||
requiredPythonMinor = "8" | ||
requiredPythonArchitecture = "32bit" | ||
installedPythonMajor = str(sys.version_info.major) | ||
installedPythonMinor = str(sys.version_info.minor) | ||
|
@@ -34,10 +44,6 @@ if ( | |
requiredPythonArchitecture | ||
) | ||
) | ||
if sys.version_info.micro == 6: | ||
# #10696: Building with Python 3.7.6 fails. Innform user and exit. | ||
Py376FailMsg = "Building with Python 3.7.6 is not possible.\nPlease use more recent version of Python 3." | ||
raise RuntimeError(Py376FailMsg) | ||
sourceEnvPath = os.path.abspath(os.path.join(Dir('.').srcnode().path, "source")) | ||
sys.path.append(sourceEnvPath) | ||
import sourceEnv | ||
|
This comment was marked as outdated.
Sorry, something went wrong.