Use "python3 -m venv" instead of `virtualenv`
Categories
(Firefox Build System :: Mach Core, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: mhentges, Assigned: ahochheiden)
References
Details
The virtualenv
package has more features than venv
, but most of them aren't useful for us (though investigation is needed to see if it is indeed faster).
Additionally, it has the cost of being vendored in-tree: it takes up space, and we need to re-vendor whenever we want to use a newer version of pip
/setuptools
/wheel
.
Instead, we should do python3 -m venv
, then pip install pip==$pip_version wheel==$wheel_version setuptools==$setuptools_version
.
Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Note: one caveat from venv is that on some distros, it's a separate package, so that would be one more thing people would need to ensure they have before they can run anything, and that could end up being annoying to track.
Reporter | ||
Comment 2•3 years ago
|
||
Was chewing on this a bit and wanted to dump some thoughts:
- We shouldn't need to seed
pip
and friends after this patch vendoring them lands. python3 -m venv --without pip <target>
takes less than half the time ofvirtualenv <target> --no-seed
, and that isn't considering the fact that we will be able to create the venv without starting a new Python process.- As raised over in this bug, MozillaBuild has a bug with the
venv
module, but that bug is worked around when--without-pip
is used, which is perfect. - It'll be nice to remove the
virtualenv
package from the tree:- Re-vendoring it is manual and annoying.
- It takes up ~10MB in-tree, removing it will slightly improve checkout and indexing times.
- We no longer have to maintain our wrapping script and associated workflow documentation.
These aren't huge wins, but I think the pieces are falling such that this will be an easy improvement to tackle.
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Comment 3•3 years ago
|
||
Blocking on 1732946 because pip
& friends are vendored as part of that bug.
Reporter | ||
Comment 4•3 years ago
|
||
pip
& friends are now vendored. The ticket itself isn't resolved, so I'm going to remove the "blocking" relationship.
One other note as part of this ticket: virtualenv
provides an activate_this.py
script, but venv
does not. We'll need to replicate it in our own code as part of this ticket.
Assignee | ||
Comment 5•2 years ago
|
||
This was implemented in bug 1766497.
Assignee | ||
Updated•2 years ago
|
Description
•