Repository navigation
Py3.8: Transparently use a Python virtual environment under the hood #12075
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
Merged
Merged
Changes from 59 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
adf131a
Build NVDA with Python 3.8 32-bit (#12042)
josephsl 5e87120
Remove any git submodules to distributions we can instead fetch with …
michaelDCurran c8fc42b
List all required Python packages in a requirements.txt in the root o…
michaelDCurran 9c9d1e1
Ssconscripts: import SCons correctly.
michaelDCurran 3878133
Appveyor: Create and activate a Python virtual environment. Also use …
michaelDCurran 90a7183
Update readme.md
michaelDCurran cd4a3cf
appveyor.yml: no need to specifify python version in specific command…
michaelDCurran 9503492
.gitignore: ignore the .venv directory
michaelDCurran fd890d3
setup.py: don't package numpy with NVDA.
michaelDCurran 4a852d9
Use py2exe 0.10.1.0 rather than py2exe 0.10.2.0 which seems to actual…
michaelDCurran 5795e76
Python 3.8/liblouis helper: add NVDA executable path by calling os.ad…
josephsl 6d58baa
Merge branch 'py3.8' into py3.8_manualVenv
michaelDCurran 3025d74
Use comtypes 1.1.7.
michaelDCurran 8074fa1
System tests: don't specify Python 3.7 when running system tests with…
michaelDCurran c22b7b3
appveyor: run nose with the --traverse-namespace option as it is now …
michaelDCurran 0179e48
Update to miscDeps containing brlAPI for Python 3.8
michaelDCurran f70b0e8
Work around for issue #12058: In wxPython >= 4.1, wx.CallAfter no lon…
michaelDCurran cbd21be
Merge remote-tracking branch 'origin/py3.8' into py3.8_manualVenv
michaelDCurran 6f427af
Explicitly include xmlrpc.server with py2exe, as it is required for s…
michaelDCurran e59018e
sourceEnv: stop the user from running with no virtual environment.
michaelDCurran daf53a1
Integrate the Python virtual environment transparently into the build…
michaelDCurran ef52123
Fix typo
michaelDCurran e7a54fd
ensureVenv.py: flush standard out before running any sub processes ot…
michaelDCurran 713397c
remove some unneeded imports.
michaelDCurran c60975e
Update pip within the virtual environment, not before, as a stock-sta…
michaelDCurran da159ae
ensureVenv: address review commnts.
michaelDCurran 2a9df26
core.main: FreeConsole returns 0 on failure rather than raising an ex…
michaelDCurran 459e3a3
Added runnvdaw.bat which runs NVDA without blocking. this provides th…
michaelDCurran 12ae5a8
Merge branch 'master' into py3.8
michaelDCurran ada0b85
Merge branch 'py3.8' into py3.8_manualVenv
michaelDCurran 73c8490
appveyor: push the list of installed python packages directly as an …
michaelDCurran 19120dd
linting for venvUtils/ensureVenv.py
michaelDCurran e924a87
Linting for source/setup.py
michaelDCurran 1b827b6
add rununittests.bat to provide a faster way of running the unit test…
michaelDCurran 1039dc5
Add runsystemtests.bat as a quick way of running the system tests, wi…
michaelDCurran 8a13814
Add runlint.bat which provides a quicker way of linting. Rather than …
michaelDCurran 91193e2
Add diff-match-patch as a Python package requirement as NVDA_DMP need…
michaelDCurran f47db8e
Sync with latest nvda_dmp. (#12113)
codeofdusk 8375c3e
Cnfigobj is now fetched by pip, rather than it being a git submodule.
michaelDCurran 2f01c39
Address review comments: final line ending / extra spaces.
michaelDCurran f1eb3e9
venvCmd.bat: allow executing a command when already inside an NVDA Py…
michaelDCurran 89922ec
appveyor: abort on failure of scons and other commands.
michaelDCurran b834a4e
Ensure that scons.bat and other high-level commands correctly propaga…
michaelDCurran 2039871
Revert "core.main: FreeConsole returns 0 on failure rather than raisi…
michaelDCurran e2e23ed
core.main: revert addition of FreeConsole. This will be handled in a …
michaelDCurran 34e7107
For now runnvda.bat (python) has been removed, and runnvdaw.bat (pyth…
michaelDCurran 711eb37
garbageHandler: revert fix to "Nonetype is not callable" when Python …
michaelDCurran ed432bf
Remove targets for unit tests, system tests and linting from SCons as…
michaelDCurran b0cb717
Appveyor now calls runlint, rununittests and runsystemtests rather th…
michaelDCurran 7eb2584
Update system tests readme to talk about runsystemtests, and not SCons.
michaelDCurran ee498f3
readme: briefly mention Nose and Robot and providing them extra argum…
michaelDCurran 7b125c6
tests/sconscript: remove all code unrelated to checkPot.
michaelDCurran b59263d
appveyor: call our batch files as a relative path otherise Powershell…
michaelDCurran e820763
appveyor: py3.8 is a branch we should run builds for.
michaelDCurran d8a89c0
runlint.bat: fix path.
michaelDCurran d5e480c
add a description of the build system to the devDocs directory.
michaelDCurran e0f9c6b
NVDA build system commands no longer refuse to run if not in NVDA's s…
michaelDCurran c6c13e0
Linting
michaelDCurran dd70ba8
Apply suggestions from code review
michaelDCurran 95339d6
System tests: use runnvda.bat rather than pyw source\nvda.pyw directly.
michaelDCurran 9ab0f6d
scons dist: copy crt dlls from the latest installed sdk (I.e. the one…
michaelDCurran e008f1d
appveyor: Move generation of the installed_python_packages.txt file t…
michaelDCurran 110edc1
Call pip freeze from a batch file in appveyor, as it seems that power…
michaelDCurran 778e512
Update buildSystemNotes
feerrenrut 06411a0
buildSystemNotes: address some typos.
michaelDCurran 9b1c16a
Remove workaround for issue #9762 (#12142)
lukaszgo1 cc7d219
Python 3.8: Mention additional system requirements for Windows 7 (#12…
lukaszgo1 0b78587
Python 3.8/gettext: replace custom pgettext implementation with built…
josephsl 0dbdaed
Merge branch 'master' into py3.8
michaelDCurran 49ea5ae
Merge branch 'py3.8' into py3.8_manualVenv
michaelDCurran 7a6fc4d
Update what's new
michaelDCurran cca866a
appveyor: remove mention of py3.8 branch, no longer needed.
michaelDCurran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| A Python virtual environment is used transparently by the NVDA build system, and all Python dependencies are installed into this environment using `pip`. | ||
|
|
||
| NVDA's build system commands will handle all aspects of the virtual environment. | ||
| Developers should not create or activate the virtual environment manually, unless working on the build system itself. | ||
|
|
||
| * To build NVDA, SCons should continue to be used in the usual way. E.g. executing scons.bat in the root of the repository. Running `py -m SCons` is no longer supported, and scons.py has also been removed. | ||
|
feerrenrut marked this conversation as resolved.
Resolved
|
||
| * To run NVDA from source, rather than executing `source/nvda.pyw` directly, the developer should now use `runnvda.bat` in the root of the repository. `runnvda.bat` uses `pythonw.exe` internally to execute NVDA. If you do try to execute `source/nvda.pyw`, a message box will alert you this is no longer supported. | ||
| * To perform unit tests, execute `rununittests.bat [<extra unittest discover options>]` | ||
| * To perform system tests: execute `runsystemtests.bat [<extra robot options>]` | ||
| * To perform linting, execute `runlint.bat <base branch>` | ||
|
|
||
| Behind the scenes, the above batch files (`scons`, `runnvda`, `rununittests`, `runsystemtests` and `runlint`) ensure that the Python virtual environment is created and up to date, activates the environment, runs the command and then deactivates. All transparently. A developer should not have to know about the Python virtual environment at all. | ||
| The first time one of these commands are run, the virtual environment will be created, and all required Python dependencies will be installed with `pip`. You can see the entire list of packages and their exact versions that `pip` will use, in `requirements.txt` in the root of the repository. | ||
|
|
||
| `venvUtils/ensureVenv.py` contains the logic to check for, create and update the virtual environment. | ||
| If a previous virtual environment exists but has a miss-matching Python version or pip package requirements have changed, The virtual environment is recreated with the updated version of Python and packages. | ||
| If a virtual environment is found but does not seem to be ours, the user is asked if it should be overwritten or not. | ||
| This script also detects if it is being run from an existing 3rd party Python virtual environment and aborts if so. thus, it is impossible to execute SCons or NVDA from source within another Python virtual environment. | ||
|
|
||
| `venvUtils/ensureAndActivate.bat` can be used to ensure the virtual environment exists and is up to date, and then activates it in the current shell, ready for other commands to be executed in the context of NVDA's build system Python virtual environment. this would never normally be executed by itself, though appVeyor uses it at the beginning of its execution and leaves the environment active for the remainder of its execution. | ||
|
|
||
| `venvUtils/venvCmd.bat` is a script that runs a single command within the context of the NVDA build system Python virtual environment. It ensures and activates the environment, executes the command, and then deactivates the environment. this script is what all the high-level batch files use internally. | ||
|
|
||
| SConstruct, and `source/nvda.pyw` both contain logic that detects the NVDA build system Python virtual environment, and abort if it is not active. | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule comtypes
deleted from
8c4558
Submodule configobj
deleted from
f9a265
Submodule py2exe
deleted from
c496ae
Submodule pyserial
deleted from
c54c81
Submodule scons
deleted from
dfcc78
Submodule wxPython
deleted from
11de93
Submodule miscDeps
updated
4 files
| + − | python/brlapi-0.8.dll | |
| + − | python/brlapi.cp37-win32.pyd | |
| + − | python/brlapi.cp38-win32.pyd | |
| + − | python/libgcc_s_dw2-1.dll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| from include.scons.SCons.Util import CLVar | ||
|
|
||
| Import([ | ||
| 'thirdPartyEnv', | ||
| 'sourceDir', | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.