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
Copy file name to clipboardExpand all lines: docs/config.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,12 @@
2
2
3
3
## When is configuration needed?
4
4
5
-
Starting with setuptools-scm 8.1+, explicit configuration is **optional** in many cases:
5
+
Starting with setuptools-scm 9.0, explicit configuration is required to enable
6
+
version inference, either via the `[tool.setuptools_scm]` section or the
7
+
`use_scm_version` setup keyword. Listing `setuptools_scm` in `build-system.requires`
8
+
and declaring `project.dynamic = ["version"]` no longer auto-enables inference.
6
9
7
-
-**No configuration needed**: If `setuptools_scm` (or `setuptools-scm`) is in your `build-system.requires`, setuptools-scm will automatically activate with sensible defaults.
8
-
9
-
-**Configuration recommended**: Use the `[tool.setuptools_scm]` section when you need to:
10
+
Use the `[tool.setuptools_scm]` section when you need to:
10
11
- Write version files (`version_file`)
11
12
- Customize version schemes (`version_scheme`, `local_scheme`)
Both approaches will work with projects that support PEP 518 ([pip](https://pypi.org/project/pip) and
55
-
[pep517](https://pypi.org/project/pep517/)).
56
-
Tools that still invoke `setup.py` must ensure build requirements are installed
35
+
Projects must support PEP 518 ([pip](https://pypi.org/project/pip) and
36
+
[pep517](https://pypi.org/project/pep517/)). Tools that still invoke `setup.py`
37
+
must ensure build requirements are installed.
38
+
39
+
### Using the setup keyword
40
+
41
+
Alternatively, enable `setuptools-scm` via the `use_scm_version` keyword in `setup.py`.
42
+
This also counts as an explicit opt-in and does not require a tool section.
57
43
58
-
!!! info "How Automatic Detection Works"
44
+
!!! warning "Simplified activation removed"
59
45
60
-
When setuptools-scm is listed in `build-system.requires`, it automatically detects this during the build process and activates with default settings. This means:
46
+
Previous documentation described a "simplified" activation where listing
47
+
`setuptools_scm` in `build-system.requires` together with `project.dynamic = ["version"]`
48
+
would auto-enable version inference. This behavior has been removed due to
49
+
regressions and ambiguous activation. You must explicitly opt in via either:
61
50
62
-
- ✅ **Automatic activation**: No `[tool.setuptools_scm]` section needed
63
-
- ✅ **Default behavior**: Uses standard version schemes and SCM detection
64
-
- ✅ **Error handling**: Provides helpful error messages if configuration is missing
65
-
- ⚙️ **Customization**: Add `[tool.setuptools_scm]` section when you need custom options
51
+
- a `[tool.setuptools_scm]` section, or
52
+
- the `use_scm_version` setup keyword.
66
53
67
-
Both package names are detected: `setuptools_scm` and `setuptools-scm` (with dash).
54
+
The presence of `setuptools_scm` (or `setuptools-scm`) in `build-system.requires`
55
+
is still recommended to ensure the dependency is available during builds, but it
0 commit comments