Closed Bug 1712819 Opened 3 years ago Closed 3 years ago

Avoid pip's "outdated" warning in virtualenvs

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement

Tracking

(firefox90 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: mhentges, Assigned: mhentges)

Details

Attachments

(3 files)

When running commands line ./mach lint --fix, I see pip's outdated warning multiple times:

 (hg)-[default]-~/d/firefox % ./mach lint --fix    
created virtual environment CPython3.9.5.final.0-64 in 126ms
  creator CPython3Posix(dest=/home/mitch/dev/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/common, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mitch/.local/share/virtualenv)
    added seed packages: pip==20.3.1, setuptools==51.0.0, wheel==0.36.1
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
warning: linting the entire repo takes a long time, using --outgoing and --workdir instead. If you want to lint the entire repo, run `./mach lint .`
WARNING: You are using pip version 20.3.1; however, version 21.1.2 is available.
You should consider upgrading via the '/home/mitch/dev/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/common/bin/python -m pip install --upgrade pip' command.
WARNING: You are using pip version 20.3.1; however, version 21.1.2 is available.
You should consider upgrading via the '/home/mitch/dev/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/common/bin/python -m pip install --upgrade pip' command.
WARNING: You are using pip version 20.3.1; however, version 21.1.2 is available.
You should consider upgrading via the '/home/mitch/dev/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/common/bin/python -m pip install --upgrade pip' command.
WARNING: You are using pip version 20.3.1; however, version 21.1.2 is available.
You should consider upgrading via the '/home/mitch/dev/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/common/bin/python -m pip install --upgrade pip' command.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
jsonschema 3.2.0 requires attrs>=17.4.0, which is not installed.
jsonschema 3.2.0 requires pyrsistent>=0.14.0, which is not installed.
WARNING: You are using pip version 20.3.1; however, version 21.1.2 is available.
You should consider upgrading via the '/home/mitch/dev/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/common/bin/python -m pip install --upgrade pip' command.
...

This is not ideal for two reasons:

  • It would be obnoxious for developers to have to manually update every virtualenv's pip every time an env was generated. It's not viable.
  • It's better to have pip be pinned (due to its embedded nature in virtualenv)

Reported a feature request to virtualenv.

At least in PyCharm, expanding a VirtualenvManager instance means
resolving all the properties and fields of the instance.
However, if that property is calling a subprocess, the debugger
wouldn't run that subprocess while we're stopped at a breakpoint.
So, the instance would sit there with the "Collecting data..." text.

Now, when running mach commands that invoke pip, it will no longer
inform the user that it needs an update.

We reach into distutils to determine the "site-packages" directory
pattern, then apply it to our virtualenv.

Depends on D115935

Assignee: nobody → mhentges
Status: NEW → ASSIGNED
Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/40c109bb5f9a
Fix VirtualenvManager not being expandable in debugger r=ahal
https://hg.mozilla.org/integration/autoland/rev/f51d72e5f0b8
Avoid pip's "outdated" warning in virtualenvs r=ahal
Flags: needinfo?(mhentges)

Was an issue with self.virtualenv_root having both / and \\ separators. Fantastic.

Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9c25bbd07129
Fix VirtualenvManager not being expandable in debugger r=ahal
https://hg.mozilla.org/integration/autoland/rev/3a5b335bdc8c
Avoid pip's "outdated" warning in virtualenvs r=ahal
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

Now that we've deployed a virtualenv configuration to turn off
pip's "outdated" warning, we no longer need to apply the suppression
as a CLI argument.

Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4335f275d7b4
Remove redundant pip warning suppression r=ahal
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: