CI: GitHub Actions workflow for the Python sample - #3
Merged
Conversation
One workflow per sample implementation, named after the sample, so another language sample lands as a sibling file rather than a new matrix dimension. .github/workflows/python.yml runs the two commands python/README.md already documents — ruff check src tests, and pytest — with pytest across Python 3.11, 3.12 and 3.13 (pyproject requires >= 3.11). Path filters keep it to changes under python/, so spec, registry and proposal edits do not start a run. Concurrency cancels superseded pull request runs but never main. ruff format is deliberately not a gate: four existing files would be reformatted, and the documented check is ruff check alone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The first run annotated every job: actions/checkout@v4 and actions/setup-python@v5 target Node.js 20 and were being forced onto Node 24. checkout v5+ and setup-python v6+ declare node24; going to v7 of each clears the annotation. Neither bump touches inputs used here — setup-python v7 only removes the pip-install input, and checkout v7 only restricts pull_request_target and workflow_run checkouts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
@sanderroosendaal just for completeness sake I had Claude add a CI run to make sure we don't accidentally break anything during the writing/iteration process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Adds
.github/workflows/python.yml: the first CI workflow in the repository,covering the
python/sample. One workflow per sample implementation, namedafter the sample — a second language sample lands as a sibling file
(
dotnet.yml,swift.yml) rather than as another dimension of one big matrix.A header comment in the file records that convention.
The workflow runs the two commands
python/README.mdalready documents, andnothing else:
ruffruff check src testspytestpytest -v3.11 is the floor because
pyproject.tomlsetsrequires-python >= 3.11.Details worth knowing:
python/**plus the workflow file itself, so editing thespec, the registry or a proposal starts no runs.
defaults.run.working-directory: python, so each step is literally thecommand from the README — no wrapper scripts to drift out of sync.
fail-fast: false, so one Python version failing does not hide the others.permissions: contents: read; pip cache keyed onpython/pyproject.toml.mainruns.workflow_dispatchfor manual runs.Also adds the status badge and a short CI note to
python/README.md.Verified before opening this
Installed the sample into clean virtualenvs on 3.11, 3.12 and 3.13 and ran the
exact step sequence from the
python/directory. All three: 41 passed, 1skipped, ruff clean. The skip is
test_rowingdata_golden_file_if_present,which looks for
../rowingdata/testdata/rowingdata_standard_example.fit; thatfile is not in this repository, so it skips on CI by design.
Two things deliberately left out
ruff format --checkis not a gate. It currently fails onsrc/rowing_data/reader.py,src/rowing_data/validation.py,tests/sample_sessions.pyandtests/test_fields.py. The documented checkis
ruff checkalone, so gating on formatting would have meant either red CIon day one or reformatting code outside the scope of this change. Easy to add
in a follow-up if wanted.
tests/fixtures/stroke-boundary.fitfromtests/generate_fixtures.pyproduces different bytes than what is committed (
b9af16d8…committed vs172a9072…generated);gps-update.fitreproduces exactly, and repeatedruns are deterministic, so the committed file appears to predate a code
change rather than being nondeterministic. Interop tests still pass because
they assert semantics, not bytes. For a repository where sample files are the
evidence, a byte-reproducibility check is worth having — it needs that
fixture regenerated first, which belongs in its own pull request.
Class of change
changed compliance level. Requires a linked proposal.
Links
Compatibility
Does any existing conforming file become non-conforming, or change meaning?
No specification text, field ID, scale or unit is touched. This adds CI
configuration and a README note only.
Checklist
registry/field-ids.mdupdated, if any field IDis touched — n/a, no field ID touched
obligations separately where they differ — n/a, no normative text
spec/FIT_STANDARD.mdnot changed — versions areassigned at release
n/a, no file contents change; local run results above