poetry: Managing local dependencies in both dev and prod environments

Viewed 22

Say I have two modules: a main application and a utility.

With poetry I can add the utility as local dependency to the main application thus:

poetry add ../utilities/mailer/dist/my_mailer-0.1.0-py3-none-any.whl

This then generates the following in the pyproj.toml of the main application:

[tool.poetry.dependencies]
python = "^3.6"
my-mailer = {path = "../utilities/mailer/dist/my_mailer-0.1.0-py3-none-any.whl"}

With this configuration I can run the application in the development environment.

However, if I want to install both the main application and the utility to production environment, i.e, my site-package directory, I need to change pyproj.toml to

[tool.poetry.dependencies]
python = "^3.6"
my-mailer = ">0.1.0"

This seems a bit clunky to me and I wonder whether there is a better way of handling the situation.

The problem is that the venv used by poetry for the main application correctly ignores the site-packages directory, which contains the utility when it is installed. However, it would be handy if I could allow just this single package from site-packages to be used within the venv. Is this possible?

0 Answers
Related