Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python export version in dirname does not always match reality #21716

Open
cburroughs opened this issue Dec 4, 2024 · 0 comments
Open

python export version in dirname does not always match reality #21716

cburroughs opened this issue Dec 4, 2024 · 0 comments
Labels

Comments

@cburroughs
Copy link
Contributor

Describe the bug
In the example-python repository with interpreter_constraints = ["==3.11.*"]

$ pants export --resolve=python-default
15:32:39.29 [INFO] Initialization options changed: reinitializing scheduler...
15:32:39.49 [INFO] Initializing Nailgun pool for 16 processes...
15:32:41.48 [INFO] Scheduler initialized.
/home/ecsb/.cache/pants/named_caches/pex_root/installed_wheels/0d74a0c79aa366e646d6e0f55dfbb91dde26ea01fbfee6178871d92a8018c0ca/pex-2.16.2-py2.py3-none-any.whl/pex/venv/installer.py:131: PEXWarning: You asked for --pip to be installed in the venv at /home/ecsb/src/o/example-python/dist/export/python/virtualenvs/python-default/3.11.9,
but the PEX at /home/ecsb/src/o/example-python/dist/export/python/virtualenvs/python-default/3.11.9/.4b4ae2fdd23744428b0f18f348f92998.tmp/python-default.pex already contains:
setuptools 56.2
Uninstalling venv versions and using versions from the PEX.
  pex_warnings.warn(
Found existing installation: setuptools 74.1.3
Uninstalling setuptools-74.1.3:
  Successfully uninstalled setuptools-74.1.3
Wrote mutable virtualenv for python-default (using Python 3.11.9) to dist/export/python/virtualenvs/python-default/3.11.9
$ dist/export/python/virtualenvs/python-default/3.11.9/bin/python
Python 3.11.10 (main, Nov 11 2024, 20:28:02) [GCC 13.3.1 20241024] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

And when running the Pants tests:

>               assert ppc0.argv[3:7] == (
                    "venv",
                    "--pip",
                    "--collisions-ok",
                    f"--prompt={resolve}/{current_interpreter}",
                )
E               AssertionError: assert equals failed
E                 (                                (                               
E                   'venv',                          'venv',                       
E                   '--pip',                         '--pip',                      
E                   '--collisions-ok',               '--collisions-ok',            
E                   '--prompt=a/3.11.9',             '--prompt=a/3.11.10',         
E                 )                                )

src/python/pants/backend/python/goals/export_test.py:158: AssertionError

Pants version
2.23.0 and main

OS
Linux

Additional info

I started out thinking we needed to include the minor version or something in the cache key, but I see we are already hashing the entire Python binary. Cache scope last changed in #17207 broader discussion in #10769 (but as I said I think the hashing should already cover this.)

@cburroughs cburroughs added the bug label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant