Open stephen-spar opened 8 months ago
Hi @stephen-spar, thanks for reporting this issue.
It looks like the square brackets from the argument are getting picked up in the cmd task as glob pattern to be interpreted. I agree that this is surprising, and I'm going to leave this issue open to think about how to improve it.
This is a quirk of the design at the intersection of how cmd tasks implement shell like features (including parameter expansion and glob expansion) and how they interpolate CLI arguments as env vars.
I think you can get around this by quoting the parameter expansion in your task definition like so:
[tool.poe.tasks.add]
sequence = [{ cmd = "poetry add \"$package\"" }, { ref = "sync-dev-deps" }]
args = [{ name = "package", positional = true }]
The logic here is similar to bash, where you can disable glob expansion with quotes.
@nat-n ah, thank you for the workaround - works a treat. Appreciate your quick response, and again, thanks for the phenomenal tool, it vastly improves the DX of the project I'm working on. Keep up the great work!!
Issue
When including square brackets in an argument (either positional or non-positional), it seems to break how poe sends along the arguments to the actual task.
Reproduction
This works as expected:
This does not:
Use Case
I have a sequence command to install poetry packages (
poe add
) which runspoetry add $package
, and then a second command to sync them with my dev container:All good if I'm trying to install something like
django
ornumpy
, but for something with "extra" packages (ex.django-anymail[mailgun]
), I'm not able to utilize this command and need to fall back topoetry add "django-anymail[mailgun]"
.Hopefully this isn't documented anywhere - if it is, feel free to point me in that direction and close the issue! Thanks so much for the awesome package, fits my needs exactly.