python-poetry / python-poetry/poetry

path dependency inside a git dependency raises error

Open
#5,022 0 comments 0 reactions 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: Debian GNU/Linux 10 (buster)
  • Poetry version: 1.1.12

Issue

I have a project (A) that has a git+ssh dependency (B). B itself has a pyproject.toml that includes a path dependency (C - a wheel inside the repository of B).
If I run poetry install in A it will happily install B but it gives an error for C. It seems the issue is that the path to the "path dependency" C does not exist during the dep solving process - before cloning B - and therefore all properties of PackageInfo are None, not initialized. It fails here with name and version being None : https://github.com/python-poetry/poetry/blob/5814e335221047bbd5ca4d7def6994acc0a9c1ca/src/poetry/inspection/info.py#L141-L143

If I change the dependency B inside the A project.toml to a local path (instead of git) C is also installed and all works fine. The issue is present for a "path" dependency inside a git dependency.

Some background: C is a wheel (rust bindings) in a private repo that I "wrapped" in a pyproject.toml (I can not use setup.py "install_requires" together with poetry).

Thank you
Jan

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 failure with project A depending on git project B, where B declares a path dependency on wheel C. Inspect src/poetry/inspection/info.py around lines 141-143 and trace the dependency-solving path before B is cloned. Done means Poetry installs C successfully through the git dependency without the reported None name/version error.

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
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.