nat-n / poethepoet

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

Tasks run in the current directory by default #180

Closed dbohdan closed 9 months ago

dbohdan commented 9 months ago

In version 0.24.2 (since commit https://github.com/nat-n/poethepoet/commit/51a6fd7953e5b8b85babe37eacc7225a7626b06b? I haven't bisected it.) the default task behavior has changed. Tasks run in the current directory instead of the project directory. This looks like a bug, because the documentation says:

By default tasks are run from the project root – that is the parent directory of the pyproject.toml file.

The change is the easiest to demonstrate if you define a task that prints the current directory.

[tool.poe.tasks.pwd]
cmd = "pwd"

Then run,

> pipx install poethepoet==0.24.1
...
> poe --root proj pwd
Poe => pwd
/home/user/proj
> pipx uninstall poethepoet
...
> pipx install poethepoet==0.24.2
...
> poe --root proj pwd
Poe => pwd
/home/user

As a temporary workaround, you can add cwd = "" to your tasks.

nat-n commented 9 months ago

Hi @dbohdan, thanks for reporting this, looks like a bug slipped in as part of this change.

nat-n commented 9 months ago

Aaaaaaaaaand it's fixed 0.24.3 🚀

dbohdan commented 9 months ago

Yay!