Repeated optional (extras) dependencies fail to resolve with poetry 1.6.1
- 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
- [x] I am on the latest stable Poetry version, installed using a recommended method.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- [x] I have consulted the FAQ and blog for any relevant entries or release notes.
- [x] 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
not a regression but a fix, sorry.
the first requirement demands that pkga come from a specific source, the path dependency contradicts that
not a regression but a fix, sorry.
the first requirement demands that pkga come from a specific source, the path dependency contradicts that
But surely it should be possible to have a local version of a library while still making sure the main dependency is sourced from an in-house repo and not accidentally from PyPI?
I can see the logic in that the two entries are different, but then maybe support a "dummy" source parameter for local folders?
this is not possible, I'm pretty sure there are other issues on this tracker discussing similar