Repository navigation
test(docs): cite models/base.py by symbol so the guard stops drifting (#5201) - #5217
Merged
Merged
Conversation
…#5201) `docs/generate-cpu-offload-autograd.md` cited `gptqmodel/models/base.py:3939` for `generate`. Three merges after #5165 repaired it, #5176 and #5182 moved `def generate` to 3948, outside `LINE_WINDOW`, so `test_docs_contract_refs.py::test_contract_reference_resolves` was red on `main`. Cite the symbol instead, as the test's own header already recommends for a file that moves often. The registry keeps one `SYMBOL_CITATION` entry instead of the line-anchored duplicate. Also convert the remaining guarded `base.py:359` citation (`_quantize_summary_counts`) and add `test_models_base_citations_use_the_symbol_form`, which rejects any future line-numbered citation into `models/base.py` in the registry. That file grows with nearly every fix PR, so a line citation drifts within a couple of merges.
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.
Fixes #5201.
Problem
mainis red:docs/generate-cpu-offload-autograd.md:18citedgptqmodel/models/base.py:3939-3944forgenerate. #5165 repaired that citation whendef generatewas at 3902; #5176 moved it to 3941 and #5182 to 3948, outsideLINE_WINDOW = 8.Fix
gptqmodel/models/base.py::generatein the doc, as the test header already recommends for a file that moves often.SYMBOL_CITATIONentry.base.py:359citation (_quantize_summary_countsindocs/quantize-run-summary.md) to the symbol form.test_models_base_citations_use_the_symbol_form, which rejects any future line-numbered citation intomodels/base.pyin the registry. That file grows with nearly every fix PR, so this is the third round of the same breakage.Verification
The new guard fails as intended when a line citation is reintroduced:
ruff checkclean.