Skip to content

Commit

Permalink
Fix faulty validation of subtask names in sequence tasks (#219)
Browse files Browse the repository at this point in the history
Fixes #218
  • Loading branch information
nat-n authored Apr 30, 2024
1 parent 0bd2a08 commit 0cb96ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion poethepoet/task/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def __init__(

subtask_name = (
sub_task_def
if isinstance(sub_task_def, str)
if (
isinstance(sub_task_def, str)
and (sub_task_def[0].isalpha() or sub_task_def[0] == "_")
)
else SequenceTask._subtask_name(name, index)
)
task_type_key = self.task_type.resolve_task_type(
Expand Down
4 changes: 4 additions & 0 deletions tests/fixtures/sequences_project/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ sequence = [
{script = "os:getcwd()", cwd = ".", print_result = true}
]
cwd = "my_package"

[tool.poe.tasks.setup]
default_item_type = "cmd"
sequence = ["./tools/poetry-ci-install.sh"]

0 comments on commit 0cb96ca

Please sign in to comment.