python-poetry / python-poetry/poetry

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

Open
#3,684 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: ArchLinux
  • Poetry version: 1.1.4
  • Link of a Gist with the contents of your pyproject.toml file:

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two-project setup from the issue using pyproject.toml, poetry.lock, the custom package source, and the git dependency with the compiler extra. Start with poetry install and compare the installed dependency set before and after; done means transitive extra dependencies are retained instead of being uninstalled.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.