python-poetry / python-poetry/poetry

`recursive` flag for git based dependencies

Open
#8,300 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

When poetry install a dependency from git, let's say:

requests = { git = "https://github.com/kennethreitz/requests.git", branch = "develop" }

There is no control over the clone command that is being applied when poetry clones this repo. Since poetry supports dependencies from different sources (from local folders, from git repos, from pypi...) there is a specific combination that is not working to me.

Let's say that we have our main repo A. This one depends on a private git repo called B. So far, the pyproject.toml file from A would look like:

# A.pyproject.toml
B = { git = <URL_TO_B>, branch = "develop" }

When we do so, B will be cloned with no --recursive flag. At the same time, if B depends on any git submodules, let's say C, its pyproject.toml would look like this:

# B.pyproject.toml
C = { path = "submodules/C", develop = true }

However, when we perform poetry install on A repository, poetry will clone B in a non recursive way. Therefore B will not be able to install its dependencies as the submodule C will be missing.

As a solution, I would propose two alternative solutions:

  • Adding recursive keyword to those git-based dependencies
  • Adding some kind of git_args that would be directly forwarded to the git clone command. This could be helpful not also for the recursive problem but also in case the developer wants to control the cloning depth to reduce installation times.

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

No files or tests are named. Start by tracing how Poetry clones git dependencies and how path dependencies inside cloned repositories are installed; determine how a recursive option or forwarded git arguments would fit the dependency configuration. Done means a git dependency can request recursive cloning and its nested submodule dependency installs successfully, with the chosen behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
build-system, tooling
Issue type
Feature
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.