Closed Bug 1713178 Opened 4 years ago Closed 4 years ago

Make `black` linter setup (really, all Python linters) avoid updating the virtualenv when they're already installed

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement

Tracking

(firefox91 fixed)

RESOLVED FIXED
91 Branch
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.

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.

Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Attachment #9223845 - Attachment description: Bug 1713178 - Make `black` linter setup avoid updating the virtualenv it's installed. r?ahal → Bug 1713178 - Make `black` linter setup avoid updating the virtualenv if it's installed. r?ahal
Pushed by nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a2dc0b41afce Make `black` linter setup avoid updating the virtualenv if it's installed. r=ahal
Regressions: 1713683
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: