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

uv pip compile --universal resolves to wrong python_full_version specifier on python3.8 #6412

Closed
ungrichtepfl opened this issue Aug 22, 2024 · 2 comments · Fixed by #6268
Closed
Assignees
Labels
bug Something isn't working resolver Related to the package resolver

Comments

@ungrichtepfl
Copy link

ungrichtepfl commented Aug 22, 2024

Happens with uv version 0.3.1 on a Ubuntu 20.04.6 LTS x86_64 machine.

Steps to reproduce.

  1. Create a python3.8 virtualenv
python3.8 -m venv venv
  1. Create requirements.in
coverage[toml]
pandas
matplotlib
  1. Run uv pip compile in the virtualenv:
uv pip compile --universal -o requirements.txt requirements.in
  1. This generates:
# This file was autogenerated by uv via the following command:
#    uv pip compile --universal -o requirements-py38.txt requirements.in
contourpy==1.1.1
    # via matplotlib
coverage==7.6.1
    # via -r requirements.in
cycler==0.12.1
    # via matplotlib
fonttools==4.53.1
    # via matplotlib
importlib-resources==6.4.4 ; python_full_version < '3.10'
    # via matplotlib
kiwisolver==1.4.5
    # via matplotlib
matplotlib==3.7.5
    # via -r requirements.in
numpy==1.24.4 ; python_full_version < '3.12'
    # via
    #   contourpy
    #   matplotlib
    #   pandas
numpy==1.26.4 ; python_full_version >= '3.12'
    # via
    #   contourpy
    #   matplotlib
    #   pandas
packaging==24.1
    # via matplotlib
pandas==2.0.3
    # via -r requirements.in
pillow==10.4.0
    # via matplotlib
pyparsing==3.1.2
    # via matplotlib
python-dateutil==2.9.0.post0
    # via
    #   matplotlib
    #   pandas
pytz==2024.1
    # via pandas
six==1.16.0
    # via python-dateutil
tomli==2.0.1 ; python_full_version == '3.11'
    # via coverage
tzdata==2024.1
    # via pandas
zipp==3.20.0 ; python_full_version < '3.10'
    # via importlib-resources

For which the third to last entry (tomli) is wrong:

tomli==2.0.1 ; python_full_version == '3.11'
    # via coverage

converage needs tomli for python < 3.11.

Running the same uv binary in a python3.9 virtualenv however, generates the correct python specifier:

# This file was autogenerated by uv via the following command:
#    uv pip compile --universal -o requirements-py39.txt requirements.in
contourpy==1.2.1
    # via matplotlib
coverage==7.6.1
    # via -r requirements.in
cycler==0.12.1
    # via matplotlib
fonttools==4.53.1
    # via matplotlib
importlib-resources==6.4.4 ; python_full_version < '3.10'
    # via matplotlib
kiwisolver==1.4.5
    # via matplotlib
matplotlib==3.9.2
    # via -r requirements.in
numpy==2.0.1
    # via
    #   contourpy
    #   matplotlib
    #   pandas
packaging==24.1
    # via matplotlib
pandas==2.2.2
    # via -r requirements.in
pillow==10.4.0
    # via matplotlib
pyparsing==3.1.2
    # via matplotlib
python-dateutil==2.9.0.post0
    # via
    #   matplotlib
    #   pandas
pytz==2024.1
    # via pandas
six==1.16.0
    # via python-dateutil
tomli==2.0.1 ; python_full_version <= '3.11'
    # via coverage
tzdata==2024.1
    # via pandas
zipp==3.20.0 ; python_full_version < '3.10'
    # via importlib-resources

Also, running it without the --universal flag generates a correct requirements.txt:

# This file was autogenerated by uv via the following command:
#    uv pip compile -o requirements.txt requirements.in
contourpy==1.1.1
    # via matplotlib
coverage==7.6.1
    # via -r requirements.in
cycler==0.12.1
    # via matplotlib
fonttools==4.53.1
    # via matplotlib
importlib-resources==6.4.4
    # via matplotlib
kiwisolver==1.4.5
    # via matplotlib
matplotlib==3.7.5
    # via -r requirements.in
numpy==1.24.4
    # via
    #   contourpy
    #   matplotlib
    #   pandas
packaging==24.1
    # via matplotlib
pandas==2.0.3
    # via -r requirements.in
pillow==10.4.0
    # via matplotlib
pyparsing==3.1.2
    # via matplotlib
python-dateutil==2.9.0.post0
    # via
    #   matplotlib
    #   pandas
pytz==2024.1
    # via pandas
six==1.16.0
    # via python-dateutil
tomli==2.0.1
    # via coverage
tzdata==2024.1
    # via pandas
zipp==3.20.0
    # via importlib-resources

This may be related to #6269.

@charliermarsh charliermarsh added bug Something isn't working resolver Related to the package resolver labels Aug 22, 2024
@charliermarsh
Copy link
Member

Ok, I've confirmed this is fixed by #6268 -- sorry about that!

@charliermarsh
Copy link
Member

\cc @BurntSushi

@BurntSushi BurntSushi self-assigned this Aug 22, 2024
BurntSushi added a commit that referenced this issue Sep 3, 2024
These are regression tests for #6269, #6412 and #6836. In this commit,
their test outputs are all wrong. We'll update these snapshots after
fixing the underlying bug by refactoring how `requires-python`
simplification works.
BurntSushi added a commit that referenced this issue Sep 3, 2024
The `tomli` dependency is now included for `python_version <= 3.11`,
which is what is expected.

Fixes #6412
BurntSushi added a commit that referenced this issue Sep 3, 2024
These are regression tests for #6269, #6412 and #6836. In this commit,
their test outputs are all wrong. We'll update these snapshots after
fixing the underlying bug by refactoring how `requires-python`
simplification works.
BurntSushi added a commit that referenced this issue Sep 3, 2024
The `tomli` dependency is now included for `python_version <= 3.11`,
which is what is expected.

Fixes #6412
BurntSushi added a commit that referenced this issue Sep 3, 2024
These are regression tests for #6269, #6412 and #6836. In this commit,
their test outputs are all wrong. We'll update these snapshots after
fixing the underlying bug by refactoring how `requires-python`
simplification works.
BurntSushi added a commit that referenced this issue Sep 3, 2024
The `tomli` dependency is now included for `python_version <= 3.11`,
which is what is expected.

Fixes #6412
BurntSushi added a commit that referenced this issue Sep 3, 2024
These are regression tests for #6269, #6412 and #6836. In this commit,
their test outputs are all wrong. We'll update these snapshots after
fixing the underlying bug by refactoring how `requires-python`
simplification works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolver Related to the package resolver
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants