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

resolver: requiring PyQt5 produces non-portable locks #9907

Closed
neutrinoceros opened this issue Dec 15, 2024 · 3 comments
Closed

resolver: requiring PyQt5 produces non-portable locks #9907

neutrinoceros opened this issue Dec 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@neutrinoceros
Copy link

neutrinoceros commented Dec 15, 2024

Ok this is a weird one. Let's start with what uv 0.5.9 does (or older versions too, as far as I could check):

mkdir test
cd test
uv init
uv add PyQt5

and let's look at the relevant portion of the resulting lock file. For context, PyQt5-Qt5 is a dependency to PyQt5:

[[package]]
name = "pyqt5-qt5"
version = "5.15.15"
source = { registry = "https://pypi.org/simple" }
wheels = [
    { url = "https://files.pythonhosted.org/packages/4a/6e/a5789bac6310208756fc6a36fd7e01caa86ea6ae7abbb5922dcea003a215/PyQt5_Qt5-5.15.15-py3-none-macosx_10_13_x86_64.whl", hash = "sha256:eb74072935958a830887115b1de1ff26341fc2d5881b28129de39612b10a260e", size = 39147807 },
    { url = "https://files.pythonhosted.org/packages/92/4c/c9026ca280f2cd4bef562cfb0a5050eb23f1e7fe1b85aa8455eb6ea437bf/PyQt5_Qt5-5.15.15-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f8b174725fbe29c1a22f8acce5798933a65c8a083f1d9833ff212479ec2b3c14", size = 36953104 },
    { url = "https://files.pythonhosted.org/packages/95/70/1ba9b828387f42e0812b496ed637a950bf57a5d59b844d034841e8f9fb4f/PyQt5_Qt5-5.15.15-py3-none-manylinux2014_x86_64.whl", hash = "sha256:611505d04ffb06a5e5bcf98f5ff0e4e15ba7785565ccbe7bd3b2e40642ea3bdd", size = 59827278 },
]

It is evident that the version that uv selected (the current latest) doesn't have wheels for windows. Unfortunately there a no source distribution either, so this lock file just doesn't port to windows.
Looking at https://pypi.org/simple/pyqt5-qt5/

PyQt5_Qt5-5.15.2-py3-none-macosx_10_13_intel.whl
PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl
PyQt5_Qt5-5.15.2-py3-none-win32.whl
PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl
PyQt5_Qt5-5.15.11-1-py3-none-macosx_11_0_arm64.whl
PyQt5_Qt5-5.15.11-py3-none-macosx_10_13_x86_64.whl
PyQt5_Qt5-5.15.11-py3-none-macosx_11_0_arm64.whl
PyQt5_Qt5-5.15.12-py3-none-macosx_10_13_x86_64.whl
PyQt5_Qt5-5.15.12-py3-none-macosx_11_0_arm64.whl
PyQt5_Qt5-5.15.13-py3-none-macosx_10_13_x86_64.whl
PyQt5_Qt5-5.15.13-py3-none-macosx_11_0_arm64.whl
PyQt5_Qt5-5.15.14-py3-none-macosx_10_13_x86_64.whl
PyQt5_Qt5-5.15.14-py3-none-macosx_11_0_arm64.whl
PyQt5_Qt5-5.15.14-py3-none-manylinux2014_x86_64.whl
PyQt5_Qt5-5.15.15-py3-none-macosx_10_13_x86_64.whl
PyQt5_Qt5-5.15.15-py3-none-macosx_11_0_arm64.whl
PyQt5_Qt5-5.15.15-py3-none-manylinux2014_x86_64.whl

we can see that there are wheels for older versions on Windows (PyQt5-Qt5==5.15.2). Unfortunately no single version has wheels for all major platforms: PyQt5-Qt5==5.15.2 misses a wheel for macosx + arm64.

My expectation would be that uv's resolver could detect this problem and fork the requirements automatically, but it doesn't.
Admittedly this is an exceptional setup, and I would understand that it falls out of scope somehow, especially considering that it could be resolved downstream if PyQt5-Qt5 just shipped more wheels. I just thought it was similar (at least in spirit) to the problem solved by #9827, so I figured it was worth a shot.

Meanwhile, a usable workaround for me is to manually write the fork in my requirements as

"PyQt5-Qt5==5.15.2 ; platform_system == 'Windows'",
"PyQt5-Qt5>=5.15.14 ; platform_system != 'Windows'",

which I can hide away from users into a dependency group (where a user-visible requirement would be much more inconvenient).

@charliermarsh
Copy link
Member

Thanks! This is another case of #9711: for packages that lack source distributions, we can end up with "incomplete" resolutions.

@charliermarsh charliermarsh added the bug Something isn't working label Dec 15, 2024
@neutrinoceros
Copy link
Author

Oh, sorry I missed it ! Of course, feel free to close this one as a dup'
Thanks !

@charliermarsh
Copy link
Member

I'll merge into that issue. I'm thinking about that problem now.

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

No branches or pull requests

2 participants