Skip to content

Allow None return annotation on task execute#42

Merged
lukasbindreiter merged 1 commit into
mainfrom
stefan/allow-task-execute-none-annotation
Jul 16, 2026
Merged

Allow None return annotation on task execute#42
lukasbindreiter merged 1 commit into
mainfrom
stefan/allow-task-execute-none-annotation

Conversation

@snamber

@snamber snamber commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • accept Task.execute() -> None when annotations are postponed
  • preserve runtime rejection and static type checking for non-None return types
  • cover both accepted None and rejected int annotations through the real future-annotations compiler path

Verification

  • uv run --package tilebox-workflows pytest tilebox-workflows
  • uv run ruff check tilebox-workflows/tilebox/workflows/task.py tilebox-workflows/tests/test_task.py
  • uv run ty check tilebox-workflows/tilebox/workflows/task.py tilebox-workflows/tests/test_task.py
  • git diff --check

@snamber snamber requested a review from lukasbindreiter July 15, 2026 21:55
@@ -1,3 +1,5 @@
import __future__

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah maybe that's why I never noticed it, does the issue only occur when the __future__.annotations codemod is active?

@lukasbindreiter lukasbindreiter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just verified manually, static analysis tool still flag invalid Task subclasses.

@lukasbindreiter lukasbindreiter merged commit cb7e27c into main Jul 16, 2026
8 checks passed
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.

2 participants