Universal resolution can generate un-installable requirements with environments
(tempenv-564a2572618) ~/.v/tempenv-564a2572618 ❯❯❯ uv version
uv 0.4.0 (Homebrew 2024-08-28)
(tempenv-564a2572618) ~/.v/tempenv-564a2572618 ❯❯❯ cat uv.toml
environments = ["python_version >= '3.10'", "python_version >= '3.8' and python_version < '3.10'", "python_version < '3.8'"]
(tempenv-564a2572618) ~/.v/tempenv-564a2572618 ❯❯❯ echo 'build' | uv pip compile - --universal -p 3.7
warning: The requested Python version 3.7 is not available; 3.12.5 will be used to build dependencies instead.
Resolved 12 packages in 5ms
# This file was autogenerated by uv via the following command:
# uv pip compile - --universal -p 3.7
build==1.1.1 ; python_full_version < '3.8'
build==1.2.1 ; python_full_version >= '3.8'
colorama==0.4.6 ; os_name == 'nt'
# via build
importlib-metadata==6.7.0 ; python_full_version < '3.8'
# via build
importlib-metadata==8.4.0 ; python_full_version < '3.10.2'
# via build
packaging==24.0 ; python_full_version < '3.8'
# via build
packaging==24.1 ; python_full_version >= '3.8'
# via build
pyproject-hooks==1.1.0
# via build
tomli==2.0.1 ; python_full_version < '3.11'
# via build
typing-extensions==4.7.1 ; python_full_version < '3.8'
# via importlib-metadata
zipp==3.15.0 ; python_full_version < '3.8'
# via importlib-metadata
zipp==3.20.1 ; python_full_version < '3.10.2'
# via importlib-metadata
The resolutions for importlib-metadata are not usable on Python 3.7, because both of the following match the markers:
importlib-metadata==6.7.0 ; python_full_version < '3.8'
# via build
importlib-metadata==8.4.0 ; python_full_version < '3.10.2'
# via build
@BurntSushi - Can you check if this is fixed on your branch?
I feel like I should apologize for constantly dragging weird universal resolution issues in, like a cat dragging in mice.
Haha no, it’s good!
On main, I get this:
$ echo 'build' | run-uv main -- pip compile - --universal -p 3.7
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
warning: uv is only compatible with Python >=3.8, found Python 3.7.9
Resolved 12 packages in 96ms
# This file was autogenerated by uv via the following command:
# uv pip compile - --universal -p 3.7
build==1.1.1 ; python_full_version < '3.10'
build==1.2.1 ; python_full_version >= '3.10'
colorama==0.4.6 ; os_name == 'nt'
# via build
importlib-metadata==6.7.0 ; python_full_version < '3.10'
# via build
importlib-metadata==8.4.0 ; python_full_version < '3.10.2'
# via build
packaging==24.0 ; python_full_version < '3.10'
# via build
packaging==24.1 ; python_full_version >= '3.10'
# via build
pyproject-hooks==1.1.0
# via build
tomli==2.0.1 ; python_full_version < '3.11'
# via build
typing-extensions==4.7.1 ; python_full_version < '3.8'
# via importlib-metadata
zipp==3.15.0 ; python_full_version < '3.10'
# via importlib-metadata
zipp==3.20.1 ; python_full_version < '3.10.2'
# via importlib-metadata
Notice that the markers here are different from yours @alex, but they are still overlapping and thus incorrect.
On my branch, I get:
$ echo 'build' | run-uv pr1 -- pip compile - --universal -p 3.7
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12s
warning: uv is only compatible with Python >=3.8, found Python 3.7.9
Resolved 12 packages in 38ms
# This file was autogenerated by uv via the following command:
# uv pip compile - --universal -p 3.7
build==1.1.1 ; python_full_version < '3.10'
build==1.2.1 ; python_full_version >= '3.10'
colorama==0.4.6 ; os_name == 'nt'
# via build
importlib-metadata==6.7.0 ; python_full_version < '3.10'
# via build
importlib-metadata==8.4.0 ; python_full_version >= '3.10' and python_full_version < '3.10.2'
# via build
packaging==24.0 ; python_full_version < '3.10'
# via build
packaging==24.1 ; python_full_version >= '3.10'
# via build
pyproject-hooks==1.1.0
# via build
tomli==2.0.1 ; python_full_version < '3.11'
# via build
typing-extensions==4.7.1 ; python_full_version < '3.8'
# via importlib-metadata
zipp==3.15.0 ; python_full_version < '3.10'
# via importlib-metadata
zipp==3.20.1 ; python_full_version >= '3.10' and python_full_version < '3.10.2'
# via importlib-metadata
The markers are not overlapping but quite constraining. I haven't dug in to see whether that's correct or not, but these requirements are at least valid.
I also get a different warning:
warning: uv is only compatible with Python >=3.8, found Python 3.7.9
Where as @alex's output has:
warning: The requested Python version 3.7 is not available; 3.12.5 will be used to build dependencies instead.
I spot checked those markers against the build source, and they look right.
All righty, that means this should be fixed by: https://github.com/astral-sh/uv/pull/6268
Great, thanks.
On Fri, Aug 30, 2024 at 7:55 AM Andrew Gallant @.***> wrote:
All righty, that means this should be fixed by: #6268
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
-- All that is necessary for evil to succeed is for good people to do nothing.