python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.9k stars 2.28k forks source link

Transitive extra dependencies for package uninstalled when running `poetry install` #3684

Open sajomathews opened 3 years ago

sajomathews commented 3 years ago

Issue

I believe this might be related to #3224

Similar to the issue above, the problem is that if I add a package using poetry add and then run poetry install, the dependencies are getting uninstalled. Unlike #3224 though, in my case the package I am adding does not have any extras. However, the package in question is a private package (also built using poetry) which depends on another package with extras.

Steps to reproduce

Create a new project with a dependency on a package with extras

poetry new vaa-protocols
poetry add git+https://github.com/danielgtaylor/python-betterproto.git -E compiler
poetry publish -r local --build

Then create a package that depends on this package

poetry new test
poetry add vaa-protocols --source local
poetry install --no-root

Now if we run poetry install, a bunch of dependencies get uninstalled. This happens under the following specific scenarious:

  1. poetry.lock file must be present. Deleting the lock file and running install does not trigger this behavious
  2. This only happens if the package vaa-protocols is installed from a custom pypi. It does not happen when using a directory or pointing to a wheel directly.
  3. This only happens when I get betterproto from git. It does not happen if I get the latest package from Pypi.
dimbleby commented 2 years ago

hard to reproduce, since pypi (and test pypi) don't allow publishing wheels that contain direct dependencies...

probably fixed? who knows.