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 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/dependency-specification.md
Expand Up @@ -145,6 +145,20 @@ flask = { git = "https://github.com/pallets/flask.git", rev = "38eb5d3b" }
numpy = { git = "https://github.com/numpy/numpy.git", tag = "v0.13.2" }
```

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
AKuederle marked this conversation as resolved.
Show resolved Hide resolved
subdir_package = { git = "https://github.com/mypackage_with_subdirs.git", subdirectory = "subdir" }
AKuederle marked this conversation as resolved.
Show resolved Hide resolved
```

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).
AKuederle marked this conversation as resolved.
Show resolved Hide resolved

```bash
poetry add "https://github.com/mypackage_with_subdirs.git#subdirectory=subdir"
AKuederle marked this conversation as resolved.
Show resolved Hide resolved
```

To use an SSH connection, for example in the case of private repositories, use the following example syntax:

```toml
Expand Down