Closed DouglasBlackwood closed 3 months ago
Hi @DouglasBlackwood, thanks for reporting this!
The looks annoying... does it stop you from being able to run tasks?
It's hard for me to tell what could be causing it. Could you help me understand how to reproduce this? An example pyproject.toml file to reproduce this would be super helpful!
Yeah, we have this problem in a couple of repositories. I'll try to reproduce it in a pet project tomorrow.
Looks like the problem occurs when we call a script. Here is a simple poe.toml
file to reproduce it.
[tool.poe.executor]
type = "poetry"
[tool.poe.tasks.linters]
deps = ["setup"]
help = "Run linters"
default_item_type = "cmd"
sequence = ["ruff check .", "ruff format --check ."]
[tool.poe.tasks.test]
deps = ["setup"]
help = "Run test suite"
cmd = "pytest -vv"
[tool.poe.tasks.setup]
help = "Sync poetry virtualenv"
executor = { type = "simple" }
default_item_type = "cmd"
sequence = ["./tools/poetry-ci-install.sh"]
We create a setup task to install dependencies before tests. The script behaves differently in the CI and on our computer, so we must use a Shell script.
We get the error Error: Invalid task 'setup' | Task names must start with a letter or underscore.
. It fails using Poe 0.26.0 but worked on the previous version 0.25.1.
There is no issue if we define the setup
task like so.
[tool.poe.tasks.setup]
help = "Sync poetry virtualenv"
executor = { type = "simple" }
default_item_type = "cmd"
sequence = ["poetry install --sync"]
Or like so
[tool.poe.tasks.setup]
help = "Sync poetry virtualenv"
executor = { type = "simple" }
cmd = "./tools/poetry-ci-install.sh"
It has something to do with sequence
and shell scripts I guess. The error message might be something else than Task names must start with a letter or underscore
.
Here is the pyproject.toml
I used.
[tool.poetry]
name = "poe-task-name-issue"
version = "0.1.0"
description = ""
authors = ["Charly Laurent <charly.laurent@mergify.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.12"
[tool.poetry.group.dev.dependencies]
poethepoet = "^0.26.0"
pytest = "^8.2.0"
ruff = "^0.4.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poe]
include = ["poe.toml"]
Hi
I just noticed a weird behavior with the latest release 0.26.0. Here is what I got when I run
poe
.It looks like a regression due to the recent refactor.