Skip to content

Commit f62c605

Browse files
fix #1001: document more version schemes + add examples
1 parent 8ac404a commit f62c605

File tree

2 files changed

+45
-10
lines changed

2 files changed

+45
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- fix #687: ensure calendar versioning tests use consistent time context to prevent failures around midnight in non-UTC timezones
2020
- reintroduce Python 3.9 entrypoints shim for compatibility
2121
- fix #1136: update customizing.md to fix missing import
22+
- fix #1001: document the missing version schemes and add examples in the docs
2223

2324
## v8.3.1
2425

docs/extending.md

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,41 @@ representing the version.
5353
`guess-next-dev (default)`
5454
: Automatically guesses the next development version (default).
5555
Guesses the upcoming release by incrementing the pre-release segment if present,
56-
otherwise by incrementing the micro segment. Then appends :code:`.devN`.
56+
otherwise by incrementing the micro segment. Then appends `.devN`.
5757
In case the tag ends with `.dev0` the version is not bumped
58-
and custom `.devN` versions will trigger a error.
58+
and custom `.devN` versions will trigger an error.
59+
60+
**Examples:**
61+
- Tag `1.0.0` → version `1.0.1.dev0` (if dirty or distance > 0)
62+
- Tag `1.0.0` → version `1.0.0` (if exact match)
63+
64+
`calver-by-date`
65+
: Calendar versioning scheme that generates versions based on dates.
66+
Uses the format `YY.MM.DD.patch` or `YYYY.MM.DD.patch` depending on the existing tag format.
67+
If the commit is on the same date as the latest tag, increments the patch number.
68+
Otherwise, uses the current date with patch 0. Supports branch-specific versioning
69+
for release branches.
70+
71+
**Examples:**
72+
- Tag `23.01.15.0` on same day → version `23.01.15.1.devN`
73+
- Tag `23.01.15.0` on different day (e.g., 2023-01-16) → version `23.01.16.0.devN`
74+
- Tag `2023.01.15.0` → uses 4-digit year format for new versions
75+
76+
`no-guess-dev`
77+
: Does no next version guessing, just adds `.post1.devN`.
78+
This is the recommended replacement for the deprecated `post-release` scheme.
79+
80+
**Examples:**
81+
- Tag `1.0.0` → version `1.0.0.post1.devN` (if distance > 0)
82+
- Tag `1.0.0` → version `1.0.0` (if exact match)
83+
84+
`only-version`
85+
: Only use the version from the tag, as given.
86+
87+
!!! warning "This means version is no longer pseudo unique per commit"
88+
89+
**Examples:**
90+
- Tag `1.0.0` → version `1.0.0` (always, regardless of distance or dirty state)
5991

6092
`post-release (deprecated)`
6193
: Generates post release versions (adds `.postN`)
@@ -64,6 +96,9 @@ representing the version.
6496

6597
!!! warning "the recommended replacement is `no-guess-dev`"
6698

99+
**Examples:**
100+
- Tag `1.0.0` → version `1.0.0.postN` (where N is the distance)
101+
67102
`python-simplified-semver`
68103
: Basic semantic versioning.
69104

@@ -73,6 +108,10 @@ representing the version.
73108

74109
This scheme is not compatible with pre-releases.
75110

111+
**Examples:**
112+
- Tag `1.0.0` on non-feature branch → version `1.0.1.devN`
113+
- Tag `1.0.0` on feature branch → version `1.1.0.devN`
114+
76115
`release-branch-semver`
77116
: Semantic versioning for projects with release branches.
78117
The same as `guess-next-dev` (incrementing the pre-release or micro segment)
@@ -81,14 +120,9 @@ representing the version.
81120
non-release branch, increments the minor segment and sets the micro segment to
82121
zero, then appends `.devN`
83122

84-
`no-guess-dev`
85-
: Does no next version guessing, just adds `.post1.devN`
86-
87-
`only-version`
88-
: Only use the version from the tag, as given.
89-
90-
!!! warning "This means version is no longer pseudo unique per commit"
91-
123+
**Examples:**
124+
- Tag `1.0.0` on release branch `release-1.0` → version `1.0.1.devN`
125+
- Tag `1.0.0` on development branch → version `1.1.0.devN`
92126

93127
### `setuptools_scm.local_scheme`
94128
Configures how the local part of a version is rendered given a

0 commit comments

Comments
 (0)