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: move overrides public API to vcs_versioning.overrides module
- Move GlobalOverrides class and all public accessor functions from _overrides.py to overrides.py
- Keep only internal implementation details (_read_pretended_version_for, _apply_metadata_overrides, etc.) in _overrides.py
- Add GlobalOverrides.from_active(**changes) method for creating modified copies
- Add GlobalOverrides.export(target) method for exporting to env or monkeypatch
- Make get_active_overrides() auto-create context from environment if none exists
- Remove redundant test_log_levels_when_unset test
- Update all internal imports to use public overrides module
- Add comprehensive tests for from_active() and export() methods
- Add integrator documentation at docs/integrators.md
This establishes a clean separation between public API (vcs_versioning.overrides)
and internal implementation (_overrides), making it easier for integrators to
discover and use the overrides system.
Copy file name to clipboardExpand all lines: docs/overrides.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,16 @@
1
1
# Overrides
2
2
3
+
!!! info "For Integrators"
4
+
5
+
If you're building a tool that integrates vcs-versioning (like hatch-vcs), see the [Integrator Guide](integrators.md) for using the overrides API with custom prefixes and the `GlobalOverrides` context manager.
6
+
3
7
## About Overrides
4
8
5
9
Environment variables provide runtime configuration overrides, primarily useful in CI/CD
6
10
environments where you need different behavior without modifying `pyproject.toml` or code.
7
11
12
+
All environment variables support both `SETUPTOOLS_SCM_*` and `VCS_VERSIONING_*` prefixes. The `VCS_VERSIONING_*` prefix serves as a universal fallback that works across all tools using vcs-versioning.
13
+
8
14
## Version Detection Overrides
9
15
10
16
### Pretend Versions
@@ -13,15 +19,15 @@ Override the version number at build time.
13
19
14
20
**setuptools-scm usage:**
15
21
16
-
The environment variable `SETUPTOOLS_SCM_PRETEND_VERSION` is used
22
+
The environment variable `SETUPTOOLS_SCM_PRETEND_VERSION`(or `VCS_VERSIONING_PRETEND_VERSION`) is used
17
23
as the override source for the version number unparsed string.
18
24
19
25
!!! warning ""
20
26
21
27
it is strongly recommended to use distribution-specific pretend versions
22
28
(see below).
23
29
24
-
`SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${DIST_NAME}`
30
+
`SETUPTOOLS_SCM_PRETEND_VERSION_FOR_${DIST_NAME}` or `VCS_VERSIONING_PRETEND_VERSION_FOR_${DIST_NAME}`
25
31
: Used as the primary source for the version number,
26
32
in which case it will be an unparsed string.
27
33
Specifying distribution-specific pretend versions will
@@ -31,7 +37,7 @@ as the override source for the version number unparsed string.
31
37
The dist name normalization follows adapted PEP 503 semantics, with one or
32
38
more of ".-\_" being replaced by a single "\_", and the name being upper-cased.
33
39
34
-
This will take precedence over ``SETUPTOOLS_SCM_PRETEND_VERSION``.
40
+
This will take precedence over the generic ``SETUPTOOLS_SCM_PRETEND_VERSION`` or ``VCS_VERSIONING_PRETEND_VERSION``.
35
41
36
42
### Pretend Metadata
37
43
@@ -112,8 +118,13 @@ Enable debug output from vcs-versioning.
112
118
113
119
**setuptools-scm usage:**
114
120
115
-
`SETUPTOOLS_SCM_DEBUG`
121
+
`SETUPTOOLS_SCM_DEBUG` or `VCS_VERSIONING_DEBUG`
116
122
: Enable debug logging for version detection and processing.
123
+
Can be set to:
124
+
- `1` or any non-empty value to enable DEBUG level logging
125
+
- A level name: `DEBUG`, `INFO`, `WARNING`, `ERROR`, or `CRITICAL` (case-insensitive)
126
+
- A specific log level integer: `10` (DEBUG), `20` (INFO), `30` (WARNING), etc.
0 commit comments