Closed Bug 1731836 Opened 3 years ago Closed 3 years ago

Simply "./mach python" options

Categories

(Firefox Build System :: Mach Core, task)

task

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: mhentges, Assigned: mhentges)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Additional details in this comment.

  • --no-virtualenv is obsolete (was needed for get_and_diffoscope task in the past, but no longer). Remove it.
  • --no-activate is a stand-in for supporting the "get native python packages from system python" use case, which is obsolete.
  • --requirements is only used to download and install psutil: replace this with a --virtualenv argument that uses a centralized virtualenv. Use the mach virtualenv by default.

This will avoid an unnecessary common virtualenv activation in many cases, which will make the virtualenv=>virtualenv activation-compatibility check fail in less cases.

Assignee: nobody → mhentges
Status: NEW → ASSIGNED

--no-virtualenv was only needed for the get_and_diffoscope task
because we used to build and install psutil (from vendored source)
into new virtualenvs.
However, the get_and_diffoscope task didn't need psutil, and it
didn't have the environment needed to build the native psutil package.

Since we no longer build and install psutil into every virtualenv,
it's no longer needed for its one usage, which means that it can be
removed.

--requirements is replaced by --virtualenv, which removes an
ad-hoc pip package installation and embraces the centralized dep
system further.

--no-activate is now implied by default: ./mach python always
runs in a Mach-compatible environment (including sys.path additions),
but the common virtualenv is no longer activated by default. This
is good because it allows ./mach subprocesses (as there are in
CI, with ./mach python <script-that-calls-mach>). The only potential
downside is that ./mach python scripts implicitly pip install-ing
packages will now fail unless they specify a virtualenv, because
ad-hoc installations into the Mach virtualenv are, as of recently,
forbidden.

ipython==7.16.1 was the chosen version because it is the last
one compatible with Python 3.6.

Depends on D120397

Attachment #9251431 - Attachment description: Bug 1731836: Simplify `./mach python` arguments → WIP: Bug 1731836: Simplify `./mach python` arguments
Attachment #9251431 - Attachment description: WIP: Bug 1731836: Simplify `./mach python` arguments → Bug 1731836: Simplify `./mach python` arguments
Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/310c4d50978e
Simplify `./mach python` arguments r=ahal
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: