Skip to content

ci: dry-run pip install for changed example requirements files - #931

Open
bnusunny wants to merge 1 commit into
mainfrom
ci/verify-requirements-dry-run
Open

bnusunny wants to merge 1 commit into
mainfrom
ci/verify-requirements-dry-run

Conversation

@bnusunny

Copy link
Copy Markdown
Contributor

Suggested by @vicheey in review on #922.

Adds a requirements job to Verify Examples. It runs pip install --dry-run --ignore-installed -r on each examples/**/requirements.txt the pull request changes, so a pin set that cannot install (like the fastapi/starlette pairs fixed in #922) fails CI instead of a user's sam build. Most examples have no matrix entry, so nothing else catches this today.

  • Only changed files, diffed against the same base as select-examples.sh. Push and manual runs skip.
  • Each file uses the Python its example targets: the template Runtime, else the Dockerfile python:X.Y base, else 3.12. 3.12, 3.13 and 3.14 are installed.
  • Added to examples-verified so it counts in the aggregate check.

Tested the step's shell locally: it passes on #922's files, fails with a file annotation on the current examples/flask pins, and skips when nothing relevant changed.

Resolve each changed examples/**/requirements.txt with pip --dry-run on the
Python its example targets (template Runtime, else Dockerfile base, else
3.12), so pin sets that cannot install fail the pull request instead of a
user's sam build. Wired into examples-verified.

Suggested in review on #922.

This branch has not been deployed

No deployments
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