-
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
Incorrect python version checking #2177
Comments
As a workaround you can:
|
I can confirm this. I have the same issue, but the workaround does not work for me either. Basically it is unusable for me currently. |
@shenek I might be mistaken, but isn't the solver doing what it is supposed to be doing here? Which is, raising an error because the dependencies have a stronger constraint on the python version? The project python version I believe that the workaround might be the right fix here. Adding debug logs as it might be useful for further triage.
|
@abn Imagine that my deps look like this:
and the
So the packages are not installed because the But currently there is a combination that would match the requirements.
And the solver was unable to find it. Note that I'm still considering python as an ordinary dependency here. |
I cannot comment on the expected behaviour with authority unfortunately. From the code, what I can tell is that the solver takes atleast some inspiration from https://github.com/dart-lang/pub/blob/master/doc/solver.md - someone from the core team will need to address that. The above example might not be representative of the issue here. I believe that the scenario above will be solved without issue. Considering the python version as just another dependency might be misleading here. In original scenario, we are saying;
However, since I guess poetry's default behaviour could be to handle this scenario by implicitly updating compatible python versions if the upper bound is not specified. Personally, I'd prefer it being explicit because the package will not work with python |
Yes, that is what I also expected. Basically I expected Poetry to make every incompatibility narrow down the usable versions, until there is no usable version left for one of the specified packages and only then give an error, as there is no possibility to reconcile versions of packages. However, the bug only happens since I upgraded Poetry. I don't know what version I had before, but something definitely changed, because before it worked just fine. |
@ZelphirKaltstahl was it the exact same dependency? Or something else, if so do you have a minimal |
@abn Sorry for the late reply. I have something like 10-20 environments on my machine and I don't know which one it was. If I find a minimal example, I'll share it here. |
I found one where the error happens: [tool.poetry]
name = "envy the little env"
version = "0.1.0"
description = "my new env"
authors = ["me"]
[tool.poetry.dependencies]
python = "^3.6"
pandas = "^1.0.0"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api" $ poetry --version
/home/user/.poetry/lib/poetry/_vendor/py2.7/subprocess32.py:149: RuntimeWarning: The _posixsubprocess module is not being used. Child process reliability may suffer if your program uses threads.
"program uses threads.", RuntimeWarning)
Poetry version 1.0.5 |
Hello, @abn is correct. poetry expect that all dependencies are defined in a way, that they are compatible to all python versions to which the project is compatible. Independent from the currently used python version. Moreover it expect to find a major version of a dependency that is compatible to the python version. And that's the part that is tricky with pandas. pandas 1.0 needs a python >=3.6.1 < 4.0. For python 3.6.0 you can only use a version <1.0. So there are two ways to solve this.
fin swimmer |
Ah OK, I think that I understand it better now. I would like to add, that this behavior is unusual for anyone having used requirements.txt, pipenv or npm before. Which does not need to be a bad thing. Here is a suggestion: Perhaps we could take this as an example and put it in the readme, somewhere more visible, so that people do not come with different expectations and do not hit this problem. |
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. |
-vvv
option).Issue
I tried to install dependency which uses setuptools and
python_requires='>=3.6'
.But this seems to be in conflict with python requirement. Of my
pyproject.toml
.It causes:
And I'm using python version
3.7
which should match here.The text was updated successfully, but these errors were encountered: