Make `black` linter setup (really, all Python linters) avoid updating the virtualenv when they're already installed
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Tracking
(firefox91 fixed)
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: nalexander, Assigned: nalexander)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
Right now, the black
linter's setup
function always makes sure its virtualenv
is fresh. That's correct, but very slow. (On my aging Macbook Pro, it's about ~8s of wall time. Linting with black
, for comparison, takes ~1s for a small file.) We already fetch black
's version for logging. I propose that we look for and version check the binary before we try to update it, hopefully speeding this up. This is, I think, what we do for eslint
, which is much faster.
There are other slow Python-based linters as well that could use a similar process, but sadly extracting version numbers probably varies by tool.
Assignee | ||
Comment 1•4 years ago
|
||
This could be easily generalized to avoid the updating the virtualenv
more generally, but I think this functionality should be in the
virtualenv_manager
-- something like install_pip_binary(...)
-- so
I've just done the most impactful example here.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 3•4 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•