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
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,17 @@
1
1
# Configuration
2
2
3
+
## When is configuration needed?
4
+
5
+
Starting with setuptools-scm 8.1+, explicit configuration is **optional** in many cases:
6
+
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
+
- Write version files (`version_file`)
11
+
- Customize version schemes (`version_scheme`, `local_scheme`)
# can be empty if no extra settings are needed, presence enables setuptools-scm
40
+
# Configure custom options here (version schemes, file writing, etc.)
41
+
version_file = "src/mypackage/_version.py"
21
42
```
22
43
23
-
That will be sufficient to require `setuptools-scm` for projects
24
-
that support PEP 518 ([pip](https://pypi.org/project/pip) and
44
+
Both approaches will work with projects that support PEP 518 ([pip](https://pypi.org/project/pip) and
25
45
[pep517](https://pypi.org/project/pep517/)).
26
46
Tools that still invoke `setup.py` must ensure build requirements are installed
27
47
48
+
!!! info "How Automatic Detection Works"
49
+
50
+
When setuptools-scm is listed in `build-system.requires`, it automatically detects this during the build process and activates with default settings. This means:
51
+
52
+
- ✅ **Automatic activation**: No `[tool.setuptools_scm]` section needed
53
+
- ✅ **Default behavior**: Uses standard version schemes and SCM detection
54
+
- ✅ **Error handling**: Provides helpful error messages if configuration is missing
55
+
- ⚙️ **Customization**: Add `[tool.setuptools_scm]` section when you need custom options
56
+
57
+
Both package names are detected: `setuptools_scm` and `setuptools-scm` (with dash).
58
+
28
59
### Version files
29
60
30
61
Version files can be created with the ``version_file`` directive.
0 commit comments