Skip to content

Commit 2976aea

Browse files
committed
[skip ci] Add example formatted versions to examples of version formats
1 parent ad2cef1 commit 2976aea

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,17 @@ looks like this:
129129
.. code:: toml
130130
131131
[tool.versioningit.format]
132-
133132
# Format used when there have been commits since the most recent tag:
134133
distance = "{base_version}.post{distance}+{vcs}{rev}"
134+
# Example formatted version: 1.2.3.post42+ge174a1f
135135
136136
# Format used when there are uncommitted changes:
137137
dirty = "{base_version}+d{build_date:%Y%m%d}"
138+
# Example formatted version: 1.2.3+d20230922
138139
139140
# Format used when there are both commits and uncommitted changes:
140141
distance-dirty = "{base_version}.post{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
142+
# Example formatted version: 1.2.3.post42+ge174a1f.d20230922
141143
142144
Other format configurations of interest include:
143145

@@ -150,26 +152,41 @@ Other format configurations of interest include:
150152
151153
[tool.versioningit.format]
152154
distance = "{next_version}.dev{distance}+{vcs}{rev}"
155+
# Example formatted version: 1.2.4.dev42+ge174a1f
156+
153157
dirty = "{base_version}+d{build_date:%Y%m%d}"
158+
# Example formatted version: 1.2.3+d20230922
159+
154160
distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
161+
# Example formatted version: 1.2.4.dev42+ge174a1f.d20230922
155162
156163
- The format used by versioneer_:
157164

158165
.. code:: toml
159166
160167
[tool.versioningit.format]
161168
distance = "{base_version}+{distance}.{vcs}{rev}"
169+
# Example formatted version: 1.2.3+42.ge174a1f
170+
162171
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
172+
# Example formatted version: 1.2.3+42.ge174a1f.dirty
173+
163174
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
175+
# Example formatted version: 1.2.3+42.ge174a1f.dirty
164176
165177
- The format used by vcversioner_:
166178

167179
.. code:: toml
168180
169181
[tool.versioningit.format]
170182
distance = "{base_version}.post{distance}"
183+
# Example formatted version: 1.2.3.post42
184+
171185
dirty = "{base_version}"
186+
# Example formatted version: 1.2.3
187+
172188
distance-dirty = "{base_version}.post{distance}"
189+
# Example formatted version: 1.2.3.post42
173190
174191
.. _setuptools_scm: https://github.com/pypa/setuptools_scm
175192
.. _versioneer: https://github.com/python-versioneer/python-versioneer

docs/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,15 @@ looks like this:
124124
125125
# Format used when there have been commits since the most recent tag:
126126
distance = "{base_version}.post{distance}+{vcs}{rev}"
127+
# Example formatted version: 1.2.3.post42+ge174a1f
127128
128129
# Format used when there are uncommitted changes:
129130
dirty = "{base_version}+d{build_date:%Y%m%d}"
131+
# Example formatted version: 1.2.3+d20230922
130132
131133
# Format used when there are both commits and uncommitted changes:
132134
distance-dirty = "{base_version}.post{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
135+
# Example formatted version: 1.2.3.post42+ge174a1f.d20230922
133136
134137
Other format configurations of interest include:
135138

@@ -142,26 +145,41 @@ Other format configurations of interest include:
142145
143146
[tool.versioningit.format]
144147
distance = "{next_version}.dev{distance}+{vcs}{rev}"
148+
# Example formatted version: 1.2.4.dev42+ge174a1f
149+
145150
dirty = "{base_version}+d{build_date:%Y%m%d}"
151+
# Example formatted version: 1.2.3+d20230922
152+
146153
distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
154+
# Example formatted version: 1.2.4.dev42+ge174a1f.d20230922
147155
148156
- The format used by versioneer_:
149157

150158
.. code:: toml
151159
152160
[tool.versioningit.format]
153161
distance = "{base_version}+{distance}.{vcs}{rev}"
162+
# Example formatted version: 1.2.3+42.ge174a1f
163+
154164
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
165+
# Example formatted version: 1.2.3+42.ge174a1f.dirty
166+
155167
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
168+
# Example formatted version: 1.2.3+42.ge174a1f.dirty
156169
157170
- The format used by vcversioner_:
158171

159172
.. code:: toml
160173
161174
[tool.versioningit.format]
162175
distance = "{base_version}.post{distance}"
176+
# Example formatted version: 1.2.3.post42
177+
163178
dirty = "{base_version}"
179+
# Example formatted version: 1.2.3
180+
164181
distance-dirty = "{base_version}.post{distance}"
182+
# Example formatted version: 1.2.3.post42
165183
166184
.. _setuptools_scm: https://github.com/pypa/setuptools_scm
167185
.. _versioneer: https://github.com/python-versioneer/python-versioneer

0 commit comments

Comments
 (0)