Wheels and PEP440 resolver
See original GitHub issueDescription
In one of my projects CI, we build the projects and all its dependencies into wheels then install all these in a docker container:
python3 setup.py bdist_wheel
pip3 wheel -w dist/ .
[...]
pip3 install dist/*
The project has an internal dependency, referenced using PEP440 style to be able to specify the origin AND the version:
install_requires=['utilities @ https://xxx.com/utilities-3.6.0-py3-none-any.whl']
When doing the installation, the resolver fails, with the following logs:
ERROR: Cannot install cloud==3.2.12 and utilities 3.6.0 (from /home/olemoign/dist/utilities-3.6.0-py3-none-any.whl) because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested utilities 3.6.0 (from /home/olemoign/dist/utilities-3.6.0-py3-none-any.whl)
cloud 3.2.12 depends on utilities 3.6.0 (from https://xxx.com/utilities-3.6.0-py3-none-any.whl)
The resolver seems to be unable to reconcile that it’s the same version. Is there any way to solve this?
Expected behavior
Functional installation.
pip version
21.1.1
Python version
3.8.9
OS
Ubuntu 21.04
How to Reproduce
Full description posted above. I can create github repos if needed.
Output
ERROR: Cannot install cloud==3.2.12 and utilities 3.6.0 (from /home/olemoign/dist/utilities-3.6.0-py3-none-any.whl) because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested utilities 3.6.0 (from /home/olemoign/dist/utilities-3.6.0-py3-none-any.whl)
cloud 3.2.12 depends on utilities 3.6.0 (from https://xxx.com/utilities-3.6.0-py3-none-any.whl)
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Improve error message for wheels with non-compliant versions
It appears that when installing from wheel, the package version number is parsed using a regex that only matches PEP 440 compliant version ......
Read more >Generating PEP-440 compliant development releases ...
I want to generate releases tagged with a githash to ease rapid shared development. Think shared development of editable installs without having ...
Read more >Dependency Resolution - pip documentation v22.3.1
Changed in version 20.3: pip's dependency resolver is now capable of ... detailed specification of supported comparison operators can be found in PEP...
Read more >[Distutils] Re: PEP 440 Issue
... seem to resolve an issue with my project > wherein I try to install using pip command and it returns: > >...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s because the old resolver ignored the conflict, not because it wasn’t there…
You’re not. There’s been a lot of publicity over “dependency confusion” attacks, which are basically the problem you have (private name shadowed by a project on PyPI). There’s work going on to look for solutions at the PyPI level (around reserving namespaces) and we’re looking at responses from pip’s side (not necessarily fixes, more ways to help people not accidentally stumble into the problem, which doesn’t help you because you’re aware of the issue).
For your situation, though, the best resolution is probably to simply remove
utilities-3.6.0-py3-none-any.whl
from yourdist
directory so you get it via the direct URL.Thank you very much for your detailed answer. Much appreciated.