Skip to content

Commit

Permalink
Documented the use of the "subdirectory" parameter (python-poetry#5949)
Browse files Browse the repository at this point in the history
* Documented the use of the "subdirectory" parameter

* Moved the subdir documentation up

* Update docs/dependency-specification.md

Co-authored-by: Mathieu Kniewallner <[email protected]>

* Added @mkniewallner editorial changes

Co-authored-by: Mathieu Kniewallner <[email protected]>

* Fixed final URL

Co-authored-by: Mathieu Kniewallner <[email protected]>

Co-authored-by: Mathieu Kniewallner <[email protected]>
  • Loading branch information
2 people authored and emilien fugier committed Aug 4, 2022
1 parent 7de044d commit a800474
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/dependency-specification.md
Original file line number Diff line number Diff line change
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 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
Expand Down

0 comments on commit a800474

Please sign in to comment.