Skip to content

fix(ci): don't request the pip cache when no Python manifest exists#330

Merged
jdfalk merged 1 commit into
mainfrom
fix/python-ci-no-manifest
Jul 20, 2026
Merged

fix(ci): don't request the pip cache when no Python manifest exists#330
jdfalk merged 1 commit into
mainfrom
fix/python-ci-no-manifest

Conversation

@jdfalk

@jdfalk jdfalk commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

reusable-ci.yml's Python job set cache: pip unconditionally.
actions/setup-python fails the job outright when it finds no
requirements.txt or pyproject.toml:

No file in ... matched to [**/requirements.txt or **/pyproject.toml],
make sure you have checked out the target repository

So any repository that acquires its first Python file while having no dependency
manifest goes red — a single stdlib-only script is enough to activate the job.

Found during the TODO fan-out: adding scripts/assemble_todo.py to
falkcorp/cockroach-rollout-agent — a repo with zero Python files and no
manifest, whose CI on main was green — turned it red. The fan-out surfaced the
bug, but it was latent for any repo in this situation.

Fix

Detect the manifest first, and request the pip cache only when there is
something to cache. Otherwise setup-python runs uncached and emits a notice.

Testing

  • Detection verified both ways: a tree containing requirements.txt resolves to
    cache=pip; an empty tree resolves to no cache.
  • actionlint passes on the modified workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_013vU67T2LJDCbYTBs9ZFAf2

reusable-ci.yml's Python job set `cache: pip` unconditionally.
actions/setup-python fails the job outright when no requirements.txt or
pyproject.toml is present, so any repo that gained its first Python file
without a dependency manifest went red - a single stdlib-only script is
enough to activate the job.

Found during the TODO fan-out: adding scripts/assemble_todo.py to
falkcorp/cockroach-rollout-agent, which has zero Python files and no
manifest, turned that repo's previously green CI red.

The manifest is detected first and the pip cache requested only when
there is something to cache; otherwise setup-python runs uncached and
emits a notice. Verified the detection both ways (a tree with a
requirements.txt resolves to cache=pip, an empty one to no cache), and
actionlint passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013vU67T2LJDCbYTBs9ZFAf2
@jdfalk
jdfalk merged commit 4ee18c2 into main Jul 20, 2026
34 of 40 checks passed
@jdfalk
jdfalk deleted the fix/python-ci-no-manifest branch July 20, 2026 01:27
jdfalk added a commit to falkcorp/cockroach-rollout-agent that referenced this pull request Jul 20, 2026
Picks up falkcorp/github-common#330, which stops setup-python from
failing when a repo has Python sources but no dependency manifest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013vU67T2LJDCbYTBs9ZFAf2
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