Skip to content

Commit 4ecb666

Browse files
committed
add versioning doc
1 parent 81d99b5 commit 4ecb666

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

software_engineering/versioning.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
2+
# Versioning
3+
4+
There are a couple of approaches for versioning:
5+
6+
### Static versioning
7+
8+
Write the version into the `pyproject.toml` file and that's it.
9+
10+
[project]
11+
name = "Pac"
12+
version = "1.0.0"
13+
14+
This version will be used when creating a release or source dist with uv.
15+
16+
### Dynamic versioning
17+
18+
Use a Python file that contains the version number. The build tool will use the `__version__` variable from the referenced file:
19+
20+
[project]
21+
name = "Pac"
22+
dynamic = ["version"]
23+
24+
[tool.hatch.version]
25+
path = "pac/__about__.py"
26+
27+
### Semantic Versioning
28+
29+
Semantic Versioning adds meaning to a version with three numbers like 3.12.7 (`MAJOR.MINOR.PATCH`). You can use the number to identify incompatible versions. See [semver.org/](https://semver.org/)
30+
31+
The [hatch-semver](https://github.com/fleetingbytes/hatch-semver) tool helps maintaining semantic versions.
32+
33+
### Git Tag
34+
The command `git tag` allows you to label commits in your version history with a specific version number, e.g.:
35+
36+
git tag 1.2.3
37+
38+
Inspect your tags with
39+
40+
git tag
41+
42+
or
43+
44+
git log
45+
46+
To integrate Git Tags in your versioning, you may want to use [hatch-vcs](https://github.com/ofek/hatch-vcs).
47+
48+
### bump-my-version
49+
50+
When using an automatic build system, you may want to count up your version number automatically.
51+
One tool for that purpose is bump-my-version [github.com/callowayproject/bump-my-version](https://github.com/callowayproject/bump-my-version).
52+
53+
### Versioning Data with DVC
54+
55+
see [www.python4data.science/en/latest/productive/dvc/index.html](https://www.python4data.science/en/latest/productive/dvc/index.html)
56+
57+
----
58+
59+
Summarized from [https://python-basics-tutorial.readthedocs.io/en/latest/packs/distribution.html](https://python-basics-tutorial.readthedocs.io/en/latest/packs/distribution.html) by Veit Schiele.

0 commit comments

Comments
 (0)