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

Passing arguments to subtask in sequence task seems to invalidate subtask def #87

Closed
wsascha opened this issue Sep 1, 2022 · 3 comments · Fixed by #97
Closed

Passing arguments to subtask in sequence task seems to invalidate subtask def #87

wsascha opened this issue Sep 1, 2022 · 3 comments · Fixed by #97
Labels
bug Something isn't working

Comments

@wsascha
Copy link

wsascha commented Sep 1, 2022

Hey @nat-n, thanks again for your work, really appreciated! ❤️

This does not work for me:

[tool.poe.tasks.foo]
shell = "echo foo, ${arg}"
args = [{ name = "arg", positional = true, required = true }]

[tool.poe.tasks.bar]
sequence = ["foo ${arg}"]
args = [{ name = "arg", positional = true }]

When I call e.g. poe bar baz, I get

❯ poe bar baz
Traceback (most recent call last):
  File ".venv/bin/poe", line 8, in <module>
    sys.exit(main())
  File ".venv/lib/python3.8/site-packages/poethepoet/__init__.py", line 32, in main
    result = app(cli_args=sys.argv[1:])
  File ".venv/lib/python3.8/site-packages/poethepoet/app.py", line 45, in __call__
    self.config.validate()
  File ".venv/lib/python3.8/site-packages/poethepoet/config.py", line 176, in validate
    error = PoeTask.validate_def(task_name, task_def, self)
  File ".venv/lib/python3.8/site-packages/poethepoet/task/base.py", line 369, in validate_def
    task_type_issue = task_type._validate_task_def(
  File ".venv/lib/python3.8/site-packages/poethepoet/task/sequence.py", line 146, in _validate_task_def
    subtask_issue = cls.validate_def(
  File ".venv/lib/python3.8/site-packages/poethepoet/task/base.py", line 369, in validate_def
    task_type_issue = task_type._validate_task_def(
  File ".venv/lib/python3.8/site-packages/poethepoet/task/ref.py", line 56, in _validate_task_def
    referenced_task = config.tasks[task_ref]
KeyError: 'foo ${arg}'

Any idea what's going on? – Maybe I also use this the wrong way, but it seems pretty similar to the section on arguments for sequence tasks.

@wsascha wsascha changed the title Passing arguments to tasks in sequence seems to invalidate task def Passing arguments to subtask in sequence task seems to invalidate subtask def Sep 1, 2022
@nat-n nat-n added the bug Something isn't working label Sep 3, 2022
@nat-n
Copy link
Owner

nat-n commented Oct 8, 2022

Hi @wsascha, thanks for the kind feedback!

I finally got around to looking at this and quickly concluded that it's a bug that was introduced in v0.15.0.

It should be easy to fix, so I'll work on this next.

@nat-n
Copy link
Owner

nat-n commented Oct 9, 2022

Fixed in 0.16.4 🚀

@wsascha
Copy link
Author

wsascha commented Oct 11, 2022

Awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants