Skip to content

Type pre/post dependencies as Task and Call sequences - #1096

Open
Hugohong258 wants to merge 1 commit into
pyinvoke:2.2from
Hugohong258:fix-pre-post-task-types
Open

Hugohong258 wants to merge 1 commit into
pyinvoke:2.2from
Hugohong258:fix-pre-post-task-types

Conversation

@Hugohong258

Copy link
Copy Markdown

Task.pre and Task.post are annotated as strings or lists of strings, but the executor accepts Task/Call dependencies and @task(dependency) stores a tuple. Annotate them as sequences of Task or Call objects. The mypy regression covers mixed tuple/list dependencies, the reported tuple comparison and an invalid-element control that prevents a broad Any annotation from hiding the problem. Fixes #1065. Earlier PR #1093 was closed by its author; this change also adds a type-checking regression and keeps dependency types limited to the objects the executor accepts.

Validation: the fixture reports seven errors on the base with both pinned mypy 0.971 and mypy 2.4.0, then passes after the change. On WSL Linux/Python 3.14.4, 109 related task/executor/type tests pass and 1 is skipped. Mixed Task/Call execution-order checks also pass on Windows/Python 3.12.3 and Linux/Python 3.14.4. Black 22.8, Flake8 4 with an external host entry-point API adapter, and pinned mypy over all 48 source files pass. The pinned checker used a Linux/Python 3.9 static target, not a Python 3.9 runtime. The full unit suite, integrations and older-runtime CI matrix were not run. Based on 2.2 per the contribution guide.

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

Successfully merging this pull request may close these issues.

1 participant