You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor git describe command: use shim/runner pattern
Replace _validate_git_tags_available() functions with DRY shim/runner pattern:
- Create scripts/git_describe_command_runner.py: shared implementation
- Create git_describe_command_shim.py in each package: thin wrappers that
check for scripts/ directory and delegate to the runner
- Update pyproject.toml files to use git_describe_command_shim.py
- Remove all three copies of _validate_git_tags_available() from
build_hooks.py and setup.py
Benefits:
- DRY: single implementation in scripts/
- Portable: Python is always available (no git in PATH requirement)
- Clear error messages: shims check for scripts/ and provide context
- No import-time validation: only runs when setuptools-scm calls it
- Cleaner code: cuda_pathfinder/build_hooks.py is now just 13 lines
All three shim files are identical copies and must be kept in sync.
0 commit comments