Poetry: Is there a way to depend on local dependencies?

Created on 16 Apr 2018  路  9Comments  路  Source: python-poetry/poetry

If I prefer to include my vendored dependencies directly in my repository, is there a way for me to specify them as a dependency?

e.g., if I have vendor/foo, it seems it'd be nice if I could specify a dependency like

[tool.poetry.dependencies]
foo-package = {path = "vendor/foo"}
Configuration Feature Installation

Most helpful comment

This is now supported in release 0.9.0.

All 9 comments

If they are in a distribution format (tarball or wheel), yes you can (since version 0.8.0), like so:

[tool.poetry.dependencies]
foo-package = { file = "relative/path/to/distribution" }

yeah, I saw file... but what if they're not?

When I'm working in Rust, I can point to any directory that has a Cargo.toml as another dependency with {path = "vendor/foo"} syntax. What about a similar thing for any directory with a pyproject.toml?

I plan on adding this, yes. It will most likely land in the next feature release.

This is now supported in release 0.9.0.

@sdispater I can't find a documentation for this feature, can you explain what is the syntax to do this?

The documentation is here: https://poetry.eustace.io/docs/versions/#path-dependencies

@sdispater ah perfect, thank you!

Can I somehow make this so poetry only uses the defined path if available, but if not, still checks normal repositories?

But what about already installed dependencies, like another project (library) installed

Was this page helpful?
0 / 5 - 0 ratings