poetry-dotenv-plugin
poetry-dotenv-plugin copied to clipboard
Documentation clarification / implementation change
Hi, thanks this seems like a very useful plugin for poetry
.
The documentation is a little confusing. It says this works for poetry commands (plural). However, the environment variables seem to only be read for the poetry run
command. To have the variables available for other commands such as poetry install
you have to execute poetry run poetry install
. This looks strange but it works.
Do you need to clarify this in the documentation? Or are you planning to update the code so that the variables are read for all poetry commands?
Hi @covuworie, thanks for the feedback.
It should work for any poetry command that inherits from EnvCommand
(install does) since all commands should be emitting COMMAND
events which this plugin is attaching to.
If you run poetry install -vvv
do you see the message Loading environment variables.
at some point in the output? That should indicate that the plugin is loading the environment variables, and works from my testing. If that message is getting printed out, then it may have to do with how the poetry install
command does the actual installing. I'm assuming you're trying to install a package that requires certain environment variables to exist at install time?