Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit 0168a7d

Browse files
committed
reworked versioning tostore Git tags in a file
1 parent 9f20245 commit 0168a7d

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# editing
22
*~
3+
TAG
34

45
# Byte-compiled / optimized / DLL files
56
__pycache__/

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# `goedwig` changelog
22

3+
## 0.1.3
4+
5+
2021-10-10
6+
7+
* reworked versioning to store Git tags in a file
8+
9+
310
## 0.1.2
411

512
2021-10-10

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include README.md
22
include CHANGELOG.md
3+
include TAG
34

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ and to configure that locally:
3030
```
3131
pre-commit install
3232
git config --local core.hooksPath .git/hooks/
33+
git tag | sort -r | head -1 > TAG
3334
```
3435

3536

bin/push_pypi.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash -e
22

3+
git tag | sort -r | head -1 > TAG
4+
35
rm -rf dist
46
python setup.py sdist bdist_wheel
7+
58
twine upload --verbose dist/*

goedwig/version.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
import pathlib
1010
import typing
1111

12-
from git import Repo # type: ignore # pylint: disable=E0401
13-
1412
repo_path = pathlib.Path(dirname(__file__))
15-
repo = Repo(repo_path.parents[0])
16-
__version__ = str(repo.tags[-1])
13+
tag_file = repo_path.parents[0] / "TAG"
14+
__version__ = tag_file.read_text().strip()
1715

1816
MIN_PY_VERSION: typing.Tuple = (3, 8,)

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
GitPython >= 3.1
21
icecream >= 2.1

0 commit comments

Comments
 (0)