-
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
Locking dependencies fails when using python version constraints #5551
Comments
Hey there. This worked for me:
I have another problem though, after that. Having
Seems to be somewhat similar to #5407. I "fixed" that, by pinning sphinx to "~4.3.0". |
Hi, thanks for your reply. Indeed, locking dependencies seems to work with your snippet (at least for Looking at the issue you referenced, this might be some kind of inconsistency in the way |
I have tested this out with different versions of Using this snippet:
With Using |
Small nitpick:
I think you mean Flake8, when you say "have a dependency on importlib-metadata for Python < 3.8 according to its setup.py." Nevertheless, this indeed seems like an issue with Poetry. |
Sorry, yes, I got all the versions a bit mixed up in my head it seems...
So yes, I believe this is a regression bug of Poetry, as it should find a solution for this set of dependencies with the snippet above, like it did in |
Some more info that might help narrow this down: Using this snippet, which lets Poetry (version 1.1.13) do the dependency resolving around Sphinx:
Poetry will lock dependencies successfully, but only install
Restricting the supported python versions with It seems that Poetry incorrectly applies the dependency on |
I should have thought about the set of dependencies diligently, I see now that this was an misunderstanding on my side on the dependencies of Sphinx v4.5.0. It does have a dependency on "importlib-metadata>=4.4; python_version < '3.10'". So the behavior of Poetry in conjunction with Flake8 is correct, and the snippet in my opening post is not expected to be solvable. Thank you for your help @Qu4tro, I will close this issue now. |
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 have the following dependencies:
Locking the depencies with
poetry lock --no-update
fails with the following error (see Gist for full output ofpoetry lock -vvv --no-update
):I would expect
poetry
to find a solution whereflake8==4.0.1
is installed for all environments,sphinx==4.3.1
is installed for Python 3.7.* environments, andsphinx==4.5.0
is installed for all Python 3.8 environments and upwards.A work-around is to define specific versions of
flake8
for each Python environment:This correctly locks the dependencies, but it only works when using different versions of
flake8
for each kind of environment, which is impractical.Additional information
Similar failing command
A similar set of dependencies that fails is this one:
I would expect
poetry
to find a solution for Python 3.8 environments and upwards that installssphinx==4.5.0
and a compatible version ofimportlib-metadata
that is defined in the dependencies ofsphinx v4.5.0
. For Python 3.7 environments I would expectpoetry
to find a solution that installssphinx==4.3.1
and a version ofimportlib-metadata
that adheres to our dependency constraint.importlib-metadata
dependencies in referenced packagesflake8
andsphinx
The relevant lines concerning
importlib-metadata
in setup.cfg offlake8 v4.0.1
(unchanged fromflake8 v4.0.0
):In setup.py of
sphinx v4.5.0
:sphinx v4.3.1
does not seem to have a dependency onimportlib-metadata
.Possibly related issues: #5506, #5447, #4695
The text was updated successfully, but these errors were encountered: