| 1 |
Project: setuptools-scm |
| 2 |
|
| 3 |
Purpose |
| 4 |
- Extract and infer Python package versions from SCM metadata (Git/Mercurial) at build/runtime. |
| 5 |
- Provide setuptools integrations (dynamic version, file finders) and fallbacks for archival/PKG-INFO. |
| 6 |
|
| 7 |
Tech Stack |
| 8 |
- Language: Python (3.8–3.13) |
| 9 |
- Packaging/build: setuptools (>=61), packaging; console scripts via entry points |
| 10 |
- Tooling: uv (dependency and run), pytest, mypy (strict), ruff (lint, isort), mkdocs (docs), tox (optional/matrix), wheel/build |
| 11 |
|
| 12 |
Codebase Structure (high level) |
| 13 |
- src/setuptools_scm/: library code |
| 14 |
- _cli.py, __main__.py: CLI entry (`python -m setuptools_scm`, `setuptools-scm`) |
| 15 |
- git.py, hg.py, hg_git.py: VCS parsing |
| 16 |
- _file_finders/: discover files for sdist |
| 17 |
- _integration/: setuptools and pyproject integration |
| 18 |
- version.py and helpers: version schemes/local version logic |
| 19 |
- discover.py, fallbacks.py: inference and archival fallbacks |
| 20 |
- testing/: pytest suite and fixtures |
| 21 |
- docs/: mkdocs documentation |
| 22 |
- pyproject.toml: project metadata, pytest and ruff config |
| 23 |
- tox.ini: alternate CI/matrix, flake8 defaults |
| 24 |
- uv.lock: locked dependencies |
| 25 |
|
| 26 |
Conventions |
| 27 |
- Use uv to run commands (`uv run ...`); tests live under `testing/` per pytest config. |
| 28 |
- Type hints throughout; strict mypy enforced; ruff governs lint rules and import layout (isort in ruff). |