fix(formatting): read ruff pin from pyproject.toml, not missing requirements-dev.txt - #440
Open
latent-9 wants to merge 1 commit into
Open
fix(formatting): read ruff pin from pyproject.toml, not missing requirements-dev.txt#440latent-9 wants to merge 1 commit into
latent-9 wants to merge 1 commit into
Conversation
…rements-dev.txt formatting.sh checked the required ruff version by grepping requirements-dev.txt, but that file does not exist in the repo; dev dependencies live in pyproject.toml ([project.optional-dependencies] dev = ["ruff == 0.11.10"]). Under 'set -eo pipefail' the version check therefore always fails (empty required version), so the script aborts before formatting for every contributor who runs it. Read the pin from pyproject.toml instead, tolerating the spaced 'ruff == x.y.z' form.
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.
Is your pull request related to a problem? Please describe.
formatting.shaborts before it formats anything, for every contributor who runs it. Line 34 checks the required ruff version by greppingrequirements-dev.txt:But
requirements-dev.txtdoes not exist in the repo — dev dependencies live inpyproject.toml:Since the script runs under
set -eo pipefail, the failedgrepmakes the required-version substring empty, sotool_version_checksees a mismatch and doesexit 1:Why should this feature be added?
The dev formatting helper is currently unusable. This repoints the version check at the real source of truth (
pyproject.toml) and tolerates its spacedruff == x.y.zpin (the oldcut -d=logic assumed the unspacedruff==form). One-line change.Examples
bash formatting.sh→grep: requirements-dev.txt: No such file or directory→Wrong ruff version installed: is required, not 0.11.10.→ exit 1.ruff format/ruff checkrun.Additional context
Verified locally under
set -eo pipefail: the new extraction yields exactly0.11.10frompyproject.toml, matches a correct install, and still flags a wrong one.bash -nclean.