Move all hard-coded version constants into a central _fallback module#1481
Merged
nathanjmcdougall merged 6 commits intomainfrom Mar 25, 2026
Merged
Move all hard-coded version constants into a central _fallback module#1481nathanjmcdougall merged 6 commits intomainfrom
_fallback module#1481nathanjmcdougall merged 6 commits intomainfrom
Conversation
Create src/usethis/_versions.py consolidating all version constants: - FALLBACK_UV_VERSION (from _backend/uv/version.py) - PRE_COMMIT_VERSION (from _integrations/pre_commit/version.py) - _RUFF_VERSION (from _tool/impl/base/ruff.py) - _SYNC_WITH_UV_VERSION (from _tool/impl/spec/pre_commit.py) - _PYPROJECT_FMT_VERSION (from _tool/impl/spec/pyproject_fmt.py) - _CODESPELL_VERSION (from _tool/impl/spec/codespell.py) Move all version up-to-dateness tests to tests/usethis/test_versions.py. Update all imports across source and test files. Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/8d9c42f4-daba-4906-ad52-a2db630360ff
…ting Remove leading underscores from version constants (now in _versions module): - _RUFF_VERSION → RUFF_VERSION - _SYNC_WITH_UV_VERSION → SYNC_WITH_UV_VERSION - _PYPROJECT_FMT_VERSION → PYPROJECT_FMT_VERSION - _CODESPELL_VERSION → CODESPELL_VERSION Add _versions to import-linter layer configuration. Apply auto-formatting fixes from ruff. Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/8d9c42f4-daba-4906-ad52-a2db630360ff
Copilot
AI
changed the title
[WIP] Move all hard-coded version constants into a central module
Move all hard-coded version constants into a central module
Mar 24, 2026
Collaborator
|
@copilot can we please rename these constants to have the |
nathanjmcdougall
requested changes
Mar 24, 2026
Rename all version constants to have the FALLBACK_ prefix: - PRE_COMMIT_VERSION → FALLBACK_PRE_COMMIT_VERSION - RUFF_VERSION → FALLBACK_RUFF_VERSION - SYNC_WITH_UV_VERSION → FALLBACK_SYNC_WITH_UV_VERSION - PYPROJECT_FMT_VERSION → FALLBACK_PYPROJECT_FMT_VERSION - CODESPELL_VERSION → FALLBACK_CODESPELL_VERSION FALLBACK_UV_VERSION already had the prefix. Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/c3521af3-873e-4d25-bdfe-0f6462a5461b
Contributor
Author
Done in 1cd109b. All constants now use the |
Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com> Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/cd749360-0035-4dad-81ab-87660c87081d
Copilot
AI
changed the title
Move all hard-coded version constants into a central module
Move all hard-coded version constants into a central Mar 24, 2026
_fallback module
nathanjmcdougall
approved these changes
Mar 24, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Version constants (
FALLBACK_UV_VERSION,_RUFF_VERSION,PRE_COMMIT_VERSION, etc.) were scattered across 6 source files with their up-to-dateness tests spread across 5 test files. Centralizes both for simpler maintenance.Changes
New
src/usethis/_fallback.py— single source of truth for all 6 version constants, consistently renamed with theFALLBACK_prefix:FALLBACK_UV_VERSION,FALLBACK_PRE_COMMIT_VERSION,FALLBACK_RUFF_VERSION,FALLBACK_SYNC_WITH_UV_VERSION,FALLBACK_PYPROJECT_FMT_VERSION,FALLBACK_CODESPELL_VERSIONNew
tests/usethis/test_fallback.py— consolidates all GitHub-tag up-to-dateness tests with a shared_skip_on_github_errorhelperUpdated 6 source files to import from
_fallbackinstead of defining constants locallyUpdated 5 test files to remove moved tests and clean up now-unused imports
.importlinter— registered_fallbackin the_types | errorslayerOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.