poetry: poetry add "requests[security]" fails on Poetry 1.2.0b1
If I run poetry add "requests[security]"
on Poetry 1.2.0b1, it fails with this message:
Package ‘requests’ is listed as a dependency of itself.
I downgraded to Poetry 1.1.13 where it works. Thanks for all your work!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (10 by maintainers)
Commits related to this issue
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Add Failing test for #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Add Failing test for #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Add Failing test for #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Add Failing test for #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fixes #5727 — committed to Darsstar/poetry by deleted user 2 years ago
- Fix the solver adding a package as a dependency of itself when extras are involved (#5769) * Add Failing test for #5727 * Fixes #5727 Co-authored-by: Dos Moonen <d.moonen@nki.nl> — committed to python-poetry/poetry by Darsstar 2 years ago
https://github.com/python-poetry/poetry/blob/89e3f7ba019e89c0901215d97e8af3694291cb28/src/poetry/puzzle/solver.py#L166-L173
I think that needs to become (seems to work for me)
is_same_package_as()
compares sources. Thex
dependency that gets added tox[y]
gets created out of thin air and has no source because of it. Causing it to not be considered the same package.dep
has no source,_package
can have a source. When_package
has a source they are not considered the same package. This explains why it works when you remove the source.Since that if is inside another if that tests whether it has features or not
provides()
seems to be a better choice thanis_same_package_as()
since it only compares the names and features.