I'm trying to solve what I assume is a common problem with poetry but am unable to find the relevant documentation. My project includes multiple packages and uses pyproject.toml and poetry to manage dependencies with this structure
/pyproject.toml
/poetry.lock
/package1/pyproject.toml
/package1/poetry.lock
/package1/src/package1/...
/package1/pyproject.toml
includes pypi dependencies in [tool.poetry.dependencies]
and defines the buildable package as
packages = [
{ include = "package1", from = "./src" },
]
/pyproject.toml
references package1
with
[tool.poetry.dependencies]
package1 = { path = "./package1", develop = true }
Finally, my Dockerfile installs the application with
WORKDIR /app/package1
RUN poetry install
WORKDIR /app
RUN poetry install
The problem is that Poetry installs each "project" (identified by the pyproject.toml file) in a separate virtual environment, and doesn't seem to support installing both in the same environment. When I execute the application it can find package1
but none of package1
's dependencies.
How can I get everything installed in the same environment?
How am I supposed to handle this situation?