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

Dependencies not installed for python <= 3.11 after changing requires-python #7618

Closed
blueraft opened this issue Sep 22, 2024 · 1 comment · Fixed by #7624
Closed

Dependencies not installed for python <= 3.11 after changing requires-python #7618

blueraft opened this issue Sep 22, 2024 · 1 comment · Fixed by #7624
Assignees
Labels
bug Something isn't working

Comments

@blueraft
Copy link
Contributor

This came up originally in the discord, but here's an MRE for this issue.

[project]
name = "mre"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "beautifulsoup4>=4.12.3",
    "httpx>=0.27.2",
    "lxml>=5.3.0",
    "pydantic>=2.9.2",
    "strenum>=0.4.15 ; python_full_version < '3.11'",
    "torf>=4.2.7",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

Running uv sync and uv tree gives the expected results here.

uv sync
Using Python 3.12.1
Creating virtual environment at: .venv
Resolved 17 packages in 14ms
Installed 17 packages in 16ms
 + annotated-types==0.7.0
 + anyio==4.6.0
 + beautifulsoup4==4.12.3
 + certifi==2024.8.30
 + flatbencode==0.2.1
 + h11==0.14.0
 + httpcore==1.0.5
 + httpx==0.27.2
 + idna==3.10
 + lxml==5.3.0
 + mre==0.1.0 (from file:///Users/ahmedilyas/temp/mre)
 + pydantic==2.9.2
 + pydantic-core==2.23.4
 + sniffio==1.3.1
 + soupsieve==2.6
 + torf==4.2.7
 + typing-extensions==4.12.2uv tree
Resolved 17 packages in 0.32ms
mre v0.1.0
├── beautifulsoup4 v4.12.3
│   └── soupsieve v2.6
├── httpx v0.27.2
│   ├── anyio v4.6.0
│   │   ├── idna v3.10
│   │   └── sniffio v1.3.1
│   ├── certifi v2024.8.30
│   ├── httpcore v1.0.5
│   │   ├── certifi v2024.8.30
│   │   └── h11 v0.14.0
│   ├── idna v3.10
│   └── sniffio v1.3.1
├── lxml v5.3.0
├── pydantic v2.9.2
│   ├── annotated-types v0.7.0
│   ├── pydantic-core v2.23.4
│   │   └── typing-extensions v4.12.2
│   └── typing-extensions v4.12.2
└── torf v4.2.7
    └── flatbencode v0.2.1

But if I change the requires-python >= 3.10, uv sync doesn't install any of the dependencies for python <= 3.11.

[project]
name = "mre"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "beautifulsoup4>=4.12.3",
    "httpx>=0.27.2",
    "lxml>=5.3.0",
    "pydantic>=2.9.2",
    "strenum>=0.4.15 ; python_full_version < '3.11'",
    "torf>=4.2.7",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
uv sync -p 3.10
Using Python 3.10.14
Removed virtual environment at: .venv
Creating virtual environment at: .venv
Resolved 17 packages in 37ms
   Built mre @ file:///Users/ahmedilyas/temp/mre
Prepared 1 package in 222ms
Installed 1 package in 0.82ms
 + mre==0.1.0 (from file:///Users/ahmedilyas/temp/mre)uv tree
Resolved 17 packages in 0.47ms
mre v0.1.0
diff --git a/pyproject.toml b/pyproject.toml
index 256c85f..ca65138 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,7 +3,7 @@ name = "mre"
 version = "0.1.0"
 description = "Add your description here"
 readme = "README.md"
-requires-python = ">=3.12"
+requires-python = ">=3.10"
 dependencies = [
     "beautifulsoup4>=4.12.3",
     "httpx>=0.27.2",
diff --git a/uv.lock b/uv.lock
index 9ec331f..683ae0f 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1,7 +1,7 @@
 version = 1
-requires-python = ">=3.12"
+requires-python = ">=3.10"
 resolution-markers = [
-    "python_full_version < '3.13'",
+    "python_full_version == '3.12.*'",
     "python_full_version >= '3.13'",
 ]

This gets fixed by deleting the lock file and re-locking, so I'm assuming it's a bug there.

@charliermarsh
Copy link
Member

Thanks, will take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants