poetry: local dependencies in dev and prod environments
Loris Bennett
loris.bennett at fu-berlin.de
Tue Sep 13 07:39:02 EDT 2022
Hi,
Say I have two modules: 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 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?
Cheers,
Loris
--
This signature is currently under construction.
More information about the Python-list
mailing list