uv
uv copied to clipboard
Special case pip entrypoint names
on Alma Linux 9.2, using uv 0.1.3 python3.x all installed via pyenv
> venv foo -p 3.8 --seed
Using Python 3.8.18 interpreter at /opt/tools/pyenv/var/repo/versions/3.8.18/bin/python3.8
Creating virtualenv at: foo
+ setuptools==69.1.0
+ pip==24.0
+ wheel==0.42.0
> ls -al foo/bin
activate*
pip
pip3
pip3.10 <-- should be pip3.8
python
python3
python3.8
the pip / pip3 / pip3.10 are all identical and correct, so it's just an incorrect filename.
all other versions also create a pip3.10:
> venv foo -p 3.9 --seed
> venv foo -p 3.11 --seed
> venv foo -p 3.12 --seed
Thanks for the report! No idea why this would be.
Isn't that -p?
@henryiii , Yes, corrected.
My guess is that it's a caching issue. We cache interpreter metadata using the ctime, to avoid having to run the Python interpreter on every invocation (which is expensive, in a relative sense). Perhaps the ctime isn't changing here?
Err wait, sorry -- so it creates a file named pip3.10, but pip3.10 is actually pip3.8?
There is no version info in the pip-entrypoint.
> cat pip | pip3 | pip3.10
#!/tmp/foo/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
sys.exit(main())
pip has an entrypoint pip3.10 in its wheel: https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl. I think you're supposed to special case pip entrypoints (https://github.com/pypa/pip/pull/11547)?
The pip discord pointed me to https://github.com/pypa/pip/blob/3898741e29b7279e7bffe044ecfbe20f6a438b1e/src/pip/_internal/operations/install/wheel.py#L283, we should special case pip.
Better link imo: https://inspector.pypi.io/project/pip/24.0/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl/pip-24.0.dist-info/entry_points.txt
@konstin - Do you mind taking this one?
Reopening because the upstream fix breaks my workaround: https://github.com/pypa/pip/pull/12536