python-poetry / python-poetry/poetry

poetry has issues when adding git repositories with recursive submodules, when they are optional or private

Open
#8,915 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • Poetry version: 1.7.1
  • Python version: 3.10.12
  • OS version and name: ubuntu 23.10
  • pyproject.toml: not relevant, fresh, out-of-the-box has the same problem.
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Poetry automatically does a recursive clone on sub-modules of a git repository. In some situations, this is not the desired behavior.

I have a two projects with the this problem.

First one:
  • main repo
    • sub-module with a lot of training data

Example: github.com/xyntopia/pydoxtools:

So when doing:

poetry add git+https://github.com/xyntopia/pydoxtools.git

You will get errors which are also misleading, because they don't give you any hint that the "Repository not found" refers to a submodule and not the repository itself.

Repository not found.

because the submodule is not uploaded on github but somewhere else (the submodule has a relative path).

The module installs without any problems, when using pip:

pip install "git+https://github.com/xyntopia/pydoxtools.git"

Now, I consider the sub-module optional, as it contains a large dataset and shouldn't be downloaded automatically.

Second one:
  • main repo
    • plugins
      • plugin one
      • plugin from a private repository

so both repos work without cloning the sub-modules recursively. in fact it breaks the installation, because it can't download them with the right permissions or other things.

Proposal

Add a flag which turns off the default recursive-download, or some pass-through "args" command, which can pass through flags to git. I would add it myself somewhere here:

def clone(self, repository: str, dest: Path) -> str:

just don't know where to collect and pass the flags to this function...

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

Start with poetry-core/src/poetry/core/vcs/git.py at the clone(repository: str, dest: Path) entry point. Reproduce with the pydoxtools repository and a repository containing optional or private submodules, comparing Poetry's behavior with pip. Done means the requested installation no longer fails solely because recursive submodules cannot be fetched, and any resulting error identifies the relevant submodule.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.