nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.39k stars 56 forks source link

Provide default poe root through env var #206

Closed emanueljg closed 4 months ago

emanueljg commented 5 months ago

There are a few environments in which it becomes very hard if not impossible to provide CLI args to get desired behavior. Would it be possible to read the desired Poe root through an env var?

$ export POE_ROOT='foo'
$ poe ...

would then be equal to

$ poe --root='foo'

but with the CLI options obviously taking precedence.

nat-n commented 5 months ago

Having a default value for the --root arg from the environment sounds reasonable. I suspect we'd need to make sure it doesn't collide with any env vars already used by poe (like POE_ROOT) to avoid unexpected behavior when for example invoking the poe CLI from within a poe task – more thought required on that question.

nat-n commented 4 months ago

This features is now available with 0.26.0 🚀

You can set the POE_PROJECT_DIR environment variable and poe will look there for the pyproject.toml