-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Handle version solving of python just like any other package #5709
Comments
Hello @ucodery, there are mainly two reasons why Poetry treated the
As it stand now, Poetry will not change the handling of the python requirements made by project. I hope I could give you enough insights to understand why. fin swimmer |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Darwin 19.6.0
Poetry version: 1.2.0b2.dev0
Issue
poetry handles the required python version of a package different than the required version of any python package. Specifically, when there is a ceiling on the python version of a require package's python requirement but not on the requiring package's python requirement, poetry raises a SolverProblemError.
A concrete example of this is when a package, A, depends on python>=3.0 and package B, and package B depends on python^3. This will fail to solve, showing something like
The current project's Python requirement (>=3.0) is not compatible with some of the required packages Python requirement: b requires Python >=3.0,<4, so it will not be satisfied for Python >=4
. This has let to a lot of user confusion (I've found at least #5591 and #1930, which link to further issues).I believe that this behavior is confusing to users because they can see that there is some overlap between the two python required versions; most likely that overlap includes the actual python versions currently being use by poetry to solve. This is further confusing because python packages (all other entries in
tool.poetry.dependencies
except python) do solve when there are multiple requirement ranges for a single package as long as all ranges overlap at at least one real version. They do not have to match completely as python does. A real example of this diverging behavior is show in the test file attached at the end of this report.The workaround often proposed to this solve error is to restrict the python version your project is compatible. But this just propagates the most pessimistic upper-bound of python to downstream projects. Left alone, this will make ranges such as
^
,~
even more so, a poison that will spread to entire branches of python dependencies. One low-level package using^3
will force all its users, direct and indirect, to also place this upper-bound on4
even though there is no practical environment that would actually fail this ceiling.Low ceilings of python packages are not forced on downstream users, don't force python ceilings.
The text was updated successfully, but these errors were encountered: