Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PATH argument doesn't work after 0.32.1 #270

Open
pseusys opened this issue Jan 11, 2025 · 2 comments
Open

PATH argument doesn't work after 0.32.1 #270

pseusys opened this issue Jan 11, 2025 · 2 comments

Comments

@pseusys
Copy link

pseusys commented Jan 11, 2025

My setup includes poetry version 2.0.0 and poethepoet version 0.32.0 which I recently updated to 0.32.1.
After the update, commands like poetry poe -C PATH COMMAND do not work anymore.
The output looks like this:

Poe the Poet - A task runner that works well with poetry.
version 0.32.1

Error: No poe configuration found from location PATH

Usage:
  poetry poe [global options] task [task arguments]

Global options:
  -h, --help            Show this help page and exit
  --version             Print the version and exit
  -v, --verbose         Increase command output (repeatable)
  -q, --quiet           Decrease command output (repeatable)
  -d, --dry-run         Print the task contents but don't actually run it
  -C PATH, --directory PATH
                        Specify where to find the pyproject.toml
  -e EXECUTOR, --executor EXECUTOR
                        Override the default task executor
  --ansi                Force enable ANSI output
  --no-ansi             Force disable ANSI output

NO TASKS CONFIGURED

Although I am sure that in location PATH there is a pyproject.toml file with defined [tool.poe.tasks] block (because it still works locally on version 0.31.1).

UPD: This is most likely due to the --directory argument actually changes directory now.

@nat-n
Copy link
Owner

nat-n commented Jan 15, 2025

Hi @pseusys, thanks for the feedback.

I'm trying to unpack what could be going on here.

I need to investigate a bit more to confirm this but it looks to me like one issue might be that the poetry CLI is handling the -C option even though it comes after the poe task.

However this isn't quite enough to explain your issue, if you have a poetry project with poe tasks defined at ./foo then either poetry poe -C ./foo COMMAND or poetry -C ./foo poe COMMAND should work. The poetry plugin actually explicitly inherits the project directory from the poetry command.

I'll comment here again when I get more time to investigate.

@pseusys
Copy link
Author

pseusys commented Jan 15, 2025

However this isn't quite enough to explain your issue, if you have a poetry project with poe tasks defined at ./foo then either poetry poe -C ./foo COMMAND or poetry -C ./foo poe COMMAND should work. The poetry plugin actually explicitly inherits the project directory from the poetry command.

Actually, I have my my pyproject.toml root in subdirectory subdirA/subdirB.
I have tried both of the configurations you suggested and received the following results.
For both poetry poe -C subdirA/subdirB poe TASK (run from root) and poetry poe -C subdirB poe TASK (run from subdirB), I receive the error I specified above: Error: No poe configuration found from location subdirA/subdirB in the first case and Error: No poe configuration found from location subdirB in the second.
For poetry-C subdirA/subdirB poe poe TASK (run from root) and poetry -C subdirB poe poe TASK, on the contrary, I receive another interesting error: Error: Unrecognised task 'irA/subdirB' in the first case and Error: Unrecognised task 'irB' in the second. So apparently first 4 caracters of the argument are scipped (why?) and the rest are interpreted as poetry task...
Overall it looks really weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants