poetry lock
creates wrong lockfile for dependencies from custom source with extras - while poetry add
works correctly
#8997
Labels
kind/bug
Something isn't working as expected
-vvv
option) and have included the output below.Issue
I ran across an issue when specifying a dependency that has a custom source and some extras to be installed.
poetry add --source "my-source" "my-lib[all]==1.2.3"
works correctly. The generated poetry.lock is also correct and can be used to recreate the environment.But, whenever I try to run
poetry lock
afterwards, the poetry.lock breaks in a way that makespoetry install
fail.poetry lock && poetry install
works without any issues if the dependency is defined without extras, i.e.,:But, whenever extras are specified for installation (no matter which ones or how many), it fails. The git diff shows, that
poetry lock
adds the specified packages[package.dependencies] + flask = {version = ">=1.0.2", optional = true, markers = "python_version >= \"3.7\" and python_version < \"4.0\" and (extra == \"flask\" or extra == \"all\")"}
but it also removes the package extras and source section (which are present after running above
poetry add
command and after running poetry lock when there are no extras specified for my-lib):On
poetry install --all-extras
this leads to:with an IndexError in
poetry/repositories/repository_pool.py:136
when running with-vvv
. But I guess, the error isn't really here but in the previouspoetry lock
command.The text was updated successfully, but these errors were encountered: