Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented the use of the "subdirectory" parameter #5949

Merged
merged 5 commits into from
Aug 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/dependency-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,20 @@ poetry config http-basic.git-org-project username token
poetry add git+https://github.com/org/project.git
```

In cases where the package you want to install is located in a subdirectory of the VCS repo, you can use the subdirectory option:
AKuederle marked this conversation as resolved.
Show resolved Hide resolved

```toml
[tool.poetry.dependencies]
# Install a package named `subdir_package` from a folder called `subdir` within the repo
subdir_package = { git = "https://github.com/mypackage_with_subdirs.git", subdirectory = "subdir" }
```

When using `poetry add` to achive the same options, you can use the same URL formatting that is also supported by [pip](https://pip.pypa.io/en/stable/topics/vcs-support/#url-fragments).

```bash
poetry add "https://github.com/mypackage_with_subdirs.git#subdirectory=subdir"
```

{{% note %}}
With Poetry 1.2 releases, the default git client used is [Dulwich](https://www.dulwich.io/).

Expand Down