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 70 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,74 @@ | ||
| # Build System Notes | ||
| 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. | ||
|
|
||
| For the documentation on how to _use_ the build system (E.G. building, | ||
| running NVDA or tests) see the main repository readme file. | ||
|
|
||
| ## How the build system works | ||
|
|
||
| The virtual environment system used is `venv`. | ||
| Dependencies are installed with `pip` via the `requirements.txt` file. | ||
| Version numbers for dependencies should be used to lock in a version. | ||
|
|
||
| The virtual environment is recreated if it is outdated, either due to: | ||
| - Python version. | ||
| - `pip` requirements. | ||
|
|
||
| The user is consulted before modifying / removing a virtual environment that can't be identified | ||
| as having been created by NVDA's build system. | ||
|
|
||
| ### Entry points to the build system | ||
|
|
||
| These are the only files expected to be executed directly by a user/developer: | ||
| - `scons.bat` | ||
| - `runnvda.bat` | ||
| - `rununittests.bat` | ||
| - `runsystemtests.bat` | ||
| - `runlint.bat` | ||
|
|
||
| **Note:** The `runnvda.bat` script intentionally uses `pyw.exe` to run NVDA as | ||
| this is the more common and expected way to run NVDA. | ||
| Run NVDA with `py.exe` in order to have standard output/error output to the console. | ||
| This is particularly useful if there is an error in NVDA before logging is initialised. | ||
| To do this, modify the `runnvda.bat` file. | ||
|
|
||
| **Note:** Executing `source/nvda.pyw` outside of a virtual environment will produce an error message | ||
| and early termination. | ||
|
|
||
| ### Main implementation files: | ||
| The following files contain the main implementation of the virtual environment setup. | ||
|
|
||
| #### `venvUtils/ensureAndActivate.bat` | ||
| - Activates the virtual environment. | ||
| - If necessary, creates and configures it first. | ||
| - The virtual environment is left active. | ||
| #### `venvUtils/venvCmd.bat` | ||
| - Uses `ensureAndActivate.bat` to run a command within the context | ||
| of the virtual environment. | ||
| - The virtual environment is deactivated after the command | ||
| completes. | ||
| - All entry point scripts depend on this. | ||
| #### `venvUtils/ensureVenv.py` | ||
| - Does the actual work to create and configure the virtual | ||
| environment. | ||
|
|
||
| ## Motivation for using virtual environments | ||
|
|
||
| Ensures the build environment is clean, and there are no conflicts with other installed packages. | ||
|
|
||
| NVDA and its build system have many Python dependencies. | ||
| Using `pip` and a virtual environment means: | ||
| - Updating is easier than git submodules. | ||
| E.G. wxPython no longer has to be pre-built and stored in our bin repo. | ||
| - Developers need to sync/update their submodules less often. | ||
| - More consistency for dependencies. | ||
| - IDE's can be configured more easily. | ||
| - No conflict between NVDA dependencies and Python packages already installed globally on the | ||
| developer's system. | ||
| - Don't interfere with the developer's system. Installing packages globally may break things | ||
| outside of NVDA. |
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.