Merge ~cjwatson/launchpad:virtualenv-20 into launchpad:master
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | a5418e0cb6cdded8fbe1c2f289ec4cc7a625ffb3 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:virtualenv-20 |
Merge into: | launchpad:master |
Diff against target: |
145 lines (+34/-18) 4 files modified
Makefile (+8/-6) _pythonpath.py (+7/-8) setup.py (+16/-2) utilities/js-deps (+3/-2) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+418654@code.launchpad.net |
Commit message
Make build system compatible with virtualenv 20
Description of the change
virtualenv 20 was a complete rewrite of virtualenv. It's mostly compatible with older versions, but there were some places where Launchpad ran into trouble with it:
* The handling of the `sitecustomize` module is a little different, and we rely on that to load some Launchpad customizations.
* `env/bin/python3` is now a symlink (indirectly) to `/usr/bin/python3`, rather than being a copy of it, so we can't rely on touching it for timestamp comparison purposes in the `Makefile`. Use `env/instance_name` (which we were already creating for other reasons in `setup.py`) for this instead.
* We now have to set the `VIRTUAL_ENV` environment variable in `_pythonpath.py` to activate the virtual environment properly.
* While initially debugging this, I removed an unnecessary `$(PY)` from the invocation of `utilities/
> `env/bin/python3` is now a symlink (indirectly) to `/usr/bin/python3`, rather than being a copy of it
That is possible one reason why virtualenv is a magnitude faster than venv.
> virtualenv 20 was a complete rewrite of virtualenv.
fun fact - Bernát only rewrote virtualenv as he tried to rewrite tox and hit a wall - so he rewrote virtualenv first.
> * It's wise to be a bit more careful about how we execute scripts in a couple more places, although this turns out not to be critical.
This is a bit vague. Could you elaborate where we need to pay attention and why? Otherwise I'd suggest to remove this sentence.
Do I read the commit message correctly that these changes just made the virtualenv usage compatible with virtualenv 20, but still is compatible with the old version?