Commit 83e6c318 by Arne Küderle Committed by GitHub

Documented the use of the "subdirectory" parameter (#5949)

* Documented the use of the "subdirectory" parameter

* Moved the subdir documentation up

* Update docs/dependency-specification.md

Co-authored-by: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>

* Added @mkniewallner editorial changes

Co-authored-by: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>

* Fixed final URL

Co-authored-by: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>

Co-authored-by: Mathieu Kniewallner <mathieu.kniewallner@gmail.com>
parent fd4af829
......@@ -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 repository, you can use the `subdirectory` option, similarly to what [pip](https://pip.pypa.io/en/stable/topics/vcs-support/#url-fragments) provides:
```toml
[tool.poetry.dependencies]
# Install a package named `subdir_package` from a folder called `subdir` within the repository
subdir_package = { git = "https://github.com/myorg/mypackage_with_subdirs.git", subdirectory = "subdir" }
```
with the corresponding `add` call:
```bash
poetry add "https://github.com/myorg/mypackage_with_subdirs.git#subdirectory=subdir"
```
To use an SSH connection, for example in the case of private repositories, use the following example syntax:
```toml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment