ci: reject Git sources in root pyproject.toml - #4113
Open
TomCC7 wants to merge 1 commit into
Open
Conversation
TomCC7
marked this pull request as ready for review
September 13, 2026 03:01
TomCC7
requested review from
Dreamsorcerer,
leshy,
paul-nechifor and
spomichter
as code owners
September 13, 2026 03:01
Contributor
|
Comment on lines
+267
to
+272
| if any("git" in entry for entry in entries): | ||
| rejected.append(name) | ||
| if rejected: | ||
| sys.exit( | ||
| "::error file=pyproject.toml::Git sources are not allowed in root " | ||
| "pyproject.toml. Use published packages instead: " + ", ".join(rejected) |
Contributor
There was a problem hiding this comment.
The root manifest still configures graspgenx from Git, and this new check rejects every source with a git entry. Because it runs before lint dependencies are installed, the required lint check exits immediately and cannot complete until this source is removed, published, or explicitly handled.
Artifacts
- The executable script is the exact CI guard logic extracted from workflow lines 257–274, showing what was run against the root manifest.
- Running the extracted guard from the repository root exited 1 and rejected graspgenx, proving lint stops before dependency installation.
- The captured root manifest declaration identifies graspgenx as a Git source, tying it directly to the guard failure.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #4113 +/- ##
==========================================
- Coverage 78.63% 78.63% -0.01%
==========================================
Files 1467 1467
Lines 138746 138746
Branches 11931 11931
==========================================
- Hits 109108 109106 -2
- Misses 26278 26280 +2
Partials 3360 3360
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 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.
Contribution path
Problem
The root
pyproject.tomlcan acquire Git source overrides such as the pinned GraspGenX checkout. We want CI to enforce a published-package policy for this PyPI project.Solution
Add a check at the start of the existing lint job, before dependency installation. Python's standard-library TOML parser detects
gitkeys in[tool.uv.sources], including separate source tables and conditional source lists, and reports the offending package names. Comments and index sources are allowed. The existing requiredci-completejob already depends on lint.This draft intentionally fails on the existing
graspgenxGit source. That dependency needs to be addressed before merging; this PR only adds the guard.How to Test
Run the workflow step locally from the repository root:
Verified eight cases locally: existing GraspGenX source, index sources, absent sources, commented Git source, separate source table with a quoted key, conditional Git source, malformed TOML, and the current file with the Git override removed. All produced the expected exit status. YAML parsing,
git diff --check, and commit hooks passed.AI assistance
Implemented and verified by Codex (GPT-6).
Checklist
— Codex