uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv pip check` gives a different result to `pip check`

Open strickvl opened this issue 1 year ago • 2 comments

Added uv pip check to replace pip check in our CI (i.e. here. The CI passed previously without issue when running pip check, but when switching to uv I get the following error:

Run uv pip check
Checked 81 packages in 0.71ms
Found 1 incompatibility
The package `pip` has multiple installed distributions:
  - /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pip-23.0.1.dist-info
  - /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/pip-24.0.dist-info
Error: Process completed with exit code 1.

Is there any guidance / docs on how uv's pip check differs from normal pip check?

strickvl avatar Mar 18 '24 20:03 strickvl

The things we check for:

  • Package has no METADATA, or the METADATA can't be parsed.
  • Package has a Requires-Python that doesn't match the current interpreter.
  • Package has a dependency on a package that isn't installed.
  • Package has a dependency on a package; it's installed, but not at a compatible version.
  • Multiple versions of a package are installed in the virtual environment.

charliermarsh avatar Mar 18 '24 20:03 charliermarsh

I'm not sure what pip check looks for exactly. Seems like it doesn't validate the last point.

charliermarsh avatar Mar 18 '24 20:03 charliermarsh

Ok so the trick there was just to use virtual environments instead of installing into the raw global system... Thanks for this explanation. I'm sure what you wrote above would be useful for an eventual docs page for uv, along with guidance around using uv with github actions.

strickvl avatar Mar 19 '24 08:03 strickvl

I'll add these to the docs!

charliermarsh avatar Mar 19 '24 15:03 charliermarsh