ci: consolidate pyproject2conda invocation through the prek hook#882
Open
drbenvincent wants to merge 1 commit into
Open
ci: consolidate pyproject2conda invocation through the prek hook#882drbenvincent wants to merge 1 commit into
drbenvincent wants to merge 1 commit into
Conversation
Replaces the bespoke `pip install pyproject2conda` + `pyproject2conda yaml ...` + `tail -n +10 ... | diff -u` sequence in the `check-environment-yml` job with a single call to the existing `pyproject2conda-yaml` prek hook, then a `git diff --exit-code` against the committed `environment.yml`. Removes: - A second pin for pyproject2conda (the prek hook `rev` is now the only one). - A second copy of the long argument list, which previously had to be kept in sync by hand with `.pre-commit-config.yaml`. - The `tail -n +10` magic-number header skip (still tracked separately for any other places that might depend on a similar pattern). Local `prek run --all-files` and CI now exercise the same hook with the same args by construction. Closes #879. Made-with: Cursor
2 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #882 +/- ##
==========================================
- Coverage 94.60% 94.59% -0.02%
==========================================
Files 80 80
Lines 12764 12764
Branches 770 770
==========================================
- Hits 12076 12074 -2
- Misses 485 486 +1
- Partials 203 204 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Replaces the bespoke
pip install pyproject2conda+pyproject2conda yaml ...+tail -n +10 ... | diff -usequence in thecheck-environment-ymljob with a single call to the existingpyproject2conda-yamlprek hook, then agit diff --exit-codeagainst the committedenvironment.yml.After this PR:
pyproject2condalives only in.pre-commit-config.yaml(the prek hookrev). Bumping the tool requires editing exactly one file..pre-commit-config.yaml. Localprek run --all-filesand thecheck-environment-ymlCI job exercise the same hook with the same args by construction.tail -n +10magic-number header skip is gone; the prek hook writes the workspaceenvironment.ymlin place, so a plaingit diffis sufficient.Why
#878 unblocked CI by pinning
pyproject2conda<0.23in the workflow, but it had to add an inline comment reminding maintainers to bump the workflow pin and the prek hookrevin lockstep. That's exactly the dual-pin smell that motivates this consolidation. See #879 for the design discussion.Notes for reviewers
j178/prek-action@cbc2f23...SHA pin already used by theprekjob in this workflow, so no new third-party action is introduced.permissions: contents: readis unchanged; the job still does not need write access.prek run pyproject2conda-yaml --all-files), which the previousdiff -udid not.Test plan
check-environment-ymljob passes on this PR (no drift betweenenvironment.ymlandpyproject.toml).environment.ymlis out of date (e.g. push a deliberate desync to a scratch branch and confirm the new error message appears).rev: v0.22.1is the version actually executed in CI (visible in the action logs).Related
Made with Cursor