Closed Bug 2050987 Opened 2 months ago Closed 19 days ago

`moz-phab self-update` fails when installed via `uv tool`: "No module named pip"

Categories

(Conduit :: moz-phab, defect, P2)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sheehan, Assigned: sheehan)

Details

Attachments

(1 file)

moz-phab self-update doesn't work when installing moz-phab via uv:

❯ moz-phab version
MozPhab 2.15.2 (Python 3.14.4, Linux)
❯ moz-phab self-update
Version 2.15.3 of `moz-phab` is now available
/home/sheehan/.local/share/uv/tools/mozphab/lib/python3.14/site-packages/setuptools/_distutils/cmd.py:90: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        This deprecation is overdue, please update your project and remove deprecated
        calls to avoid build errors in the future.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/home/sheehan/.local/share/uv/tools/mozphab/bin/python3: No module named pip
CommandError: command '/home/sheehan/.local/share/uv/tools/mozphab/bin/python3' failed to complete successfully
Run moz-phab again with '--trace' to show debugging output
❯ moz-phab version
MozPhab 2.15.2 (Python 3.14.4, Linux)

We use pip to update the install under the hood, and by default an install via uv tool won't include pip. This is higher priority now that ./mach install-moz-phab uses uv tool to manage installs under the hood.

moz-phab installed via uv tool has no pip, so self-update failed. Detect
these installs by looking for uv-receipt.toml at sys.prefix and dispatch to
uv tool upgrade instead. Read the version back afterwards, since uv exits zero
when it declines to upgrade a pinned or path-based install. Windows uv installs
now attempt the upgrade rather than printing the manual upgrade message.

Status: NEW → RESOLVED
Closed: 19 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: