[feature][Python] Make use of venv optional. Default is ON.
This is a revival of !1104 (closed).
Depends on !1223 (merged)
Related to #329, #296 (closed), #325 (closed), #279 (closed)
Merge request reports
Activity
added 1 commit
- 2d828ce1 - [feature][Python] Make use of venv optional. Default is ON.
added 3 commits
-
2d828ce1...44024ca3 - 2 commits from branch
master
- b20b1032 - [feature][Python] Make use of venv optional. Default is ON.
-
2d828ce1...44024ca3 - 2 commits from branch
@andreas.dedner: This seems to work for me. I'm testing with the full test collection. Do you remember what were the things that did not work in the previous implementation?
@tkoch: Please test this. You were the loudest advocate for this feature at the developer meeting, so I expect some input here. Please also read !1104 (closed).
added 1 commit
- c5c9f630 - [feature][Python] Make use of venv optional. Default is ON.
@alexander.mueller: You can take a look at this feature. I don't think it will change anything, but it's a good test.
@robert.kloefkorn : Yes thanks, that's true. As mentioned in #328, I thinks this is interesting for docker containers, where venvs are not always needed.
added 1 commit
- 95e234af - [feature][Python] Make use of venv optional. Default is ON.
- Resolved by Timo Koch
Great thanks! I gave it a try. The first part goes as expected: I don't get a venv anymore and the Python bindings are still compiled, great!
For the tests, I ran into two problems
- The script
set-dune-pythonpath
only sets the path for the module itself. (Actually, this is probably the correct thing, because we don't know which other modules we might want to combine this with.) Therefore when using it inrun-in-dune-env
it only sets thePYTHONPATH
for that module's Python package which means the tests fail. Inset-dune-pythonpath
there is a loop overMODULE_PATHS
which I don't understand.MODULE_PATHS
seems to be always only one path the way it is set. Am I missing something? - Per default they seem to be run with
python
instead ofpython3
which on my ancient system happens to point to Python 2.7. Is there a reason we can't usepython3
? Are there some venvs in whichpython3
doesn't exist?
One thing which I can now do, which I find great is: configuring and compiling a dune module stack and then afterwards I can run
python3 -m venv venv source venv/bin/activate ./dune-common/bin/dunecontrol bexec python3 -m pip install python
which means I have separated concerns with respect to configuring and building C++ code and installing Python packages. This is also useful in CI setups or in Docker containers where the two steps can easily be split now. (With this method the tests also work. I assume in that case
set-dune-pythonpath
is executed which would set one module path but the other modules are still found because they are installed. Of course in this scenario I wouldn't really want thePYTHONPATH
to be polluted. Maybe, we could modify the else-if-check inrun-in-dune-env
to first see if some VENV is active by checking$VIRTUAL_ENV
)Edited by Timo Koch - The script
added 1 commit
- 7dc5652a - [feature][Python] Make use of venv optional. Default is ON.
mentioned in merge request !1223 (merged)
added 1 commit
- 3ba1e0f4 - [python][run-in-dune-env] Allow for other external venvs
mentioned in issue #296 (closed)
added 1 commit
- e3284b0f - [python][run-in-dune-env] Allow for other external venvs
- Resolved by Robert K
- Resolved by Robert K
added 1 commit
- 1adf5261 - Improve warning when Python bindings are disabled because of missing venv.
added 1 commit
- 8bad189e - [cleanup][DuneVenv] Reenable previous behavior of no-venv ==> Python
- Resolved by Timo Koch