python-poetry / python-poetry/poetry
Repeated optional (extras) dependencies fail to resolve with poetry 1.6.1
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
- Poetry version: 1.6.1
- Python version: 3.10.12
- OS version and name: Ubuntu 22.04
- pyproject.toml: https://gist.github.com/jerkern/8cdd2bf4cce69278578c4952b51313d4
- I am on the latest stable Poetry version, installed using a recommended method.
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have consulted the FAQ and blog for any relevant entries or release notes.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption) and have included the output below.
Issue
This used to work in poetry 1.5.0, so it's a regression, see description of problem below.
I've created a MRE of the problem, the setup has two projects managed by poetry, pkga and pkgb.
pkga pyproject.toml: https://gist.github.com/jerkern/210a38f6b636ac37219cd8361ad83c5f
pkgb pyproject.toml: https://gist.github.com/jerkern/8cdd2bf4cce69278578c4952b51313d4
pkgb has a dependency on pkga as an extra, ie it's only a dependency if installed with eg pip install pkbg[usepkga]. The packages are developed in tandem, so I want to use the local version of pkga when developing pkgb, this is accomplished by creating an extra dependency group locallibs in the config for pkgb. So when working locally in pkgb I'd do poetry install --no-root -with locallibs.
This setup used to work fine with poetry 1.5.0, but after upgrading to poetry 1.6.1 I get this error
~/tmp/pkgb$ poetry update --with locallibs
Updating dependencies
Resolving dependencies... (0.0s)
Incompatible constraints in requirements of pkgb (0.1.0):
pkga @ file:///home/jerkern/tmp/pkga (0.1.0)
pkga (>=0.1.0,<0.2.0) ; extra == "usepkga" ; source=king
downgrading poetry the corresponding commands results in this
:~/tmp/pkgb$ poetry update --with locallibs
Updating dependencies
Resolving dependencies... (0.1s)
No dependencies to install or update
Writing lock file
Notice, it only happens when adding the source to for the pkga dependency, without that it works in 1.6.1 as well
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked pkga and pkgb pyproject.toml reproductions, then run poetry update --with locallibs under Poetry 1.6.1 and compare the result with 1.5.0. Done means the resolver accepts the local pkga dependency alongside its repeated optional dependency with a source configured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100