Skip to content

fix(execution): run sourceless tasks without paths - #936

Merged
tobiasraabe merged 8 commits into
mainfrom
codex/run-sourceless-tasks
Sep 22, 2026
Merged

tobiasraabe merged 8 commits into
mainfrom
codex/run-sourceless-tasks

Conversation

@tobiasraabe

Copy link
Copy Markdown
Member

Summary

  • distinguish actual dependency predecessors from the task's own source state
  • treat an unavailable task source state as changed instead of missing
  • rerun source-less TaskWithoutPath tasks on every build
  • retain missing-state errors for genuine dependencies

Root cause

Execution setup added the task's own signature to the set of dependency predecessors. When TaskWithoutPath.state() returned None because inspect.getsource() was unavailable, pytask therefore reported the task itself as a missing required dependency.

Impact

REPL-, notebook-, and dynamically created tasks without inspectable source now execute normally. Because their source cannot be compared safely, they are conservatively treated as changed and execute again on subsequent builds.

Validation

  • uv run --group test pytest --snapshot-warn-unused: 934 passed, 39 skipped, 4 xfailed
  • uv run --group test pytest tests/test_execute.py -q: 56 passed, 1 xfailed
  • uv run --group typing --group test --isolated ty check --python-platform linux: passed
  • project-locked uv run ruff check .: passed
  • project-locked ruff format --check for changed files: passed
  • all non-Ruff pre-commit hooks: passed

The repository's just recipes cannot locate their configured shell on this Windows checkout. The pre-commit Ruff 0.16 hook also reports new baseline rules across untouched main, while the project lock provides Ruff 0.15.16. This PR was checked with the project-locked Ruff version and does not alter lint configuration.

@tobiasraabe tobiasraabe changed the title Run sourceless tasks without paths fix(execution): run sourceless tasks without paths Aug 2, 2026
@tobiasraabe
tobiasraabe marked this pull request as ready for review August 2, 2026 18:45
@tobiasraabe
tobiasraabe added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit e890c04 Sep 22, 2026
23 checks passed
@tobiasraabe
tobiasraabe deleted the codex/run-sourceless-tasks branch September 22, 2026 20:56
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