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

Commit c4c3b76

Browse files
authored
Merge pull request #7 from DerwenAI/update
reworked versioning to store Git tags in a Py module
2 parents 0168a7d + f70d545 commit c4c3b76

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

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.4
4+
5+
2021-10-10
6+
7+
* reworked versioning to store Git tags in a Py module
8+
9+
310
## 0.1.3
411

512
2021-10-10

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ 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
33+
```
34+
35+
Then initialize the tag-base versioning:
36+
```
37+
TAG = $(git tag | sort -r | head -1)
38+
echo "'git tag'" > goedwig/tag.py
39+
echo "TAG = '$TAG'" >> goedwig/tag.py
3440
```
3541

3642

bin/push_pypi.sh

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

3-
git tag | sort -r | head -1 > TAG
3+
TAG = $(git tag | sort -r | head -1)
4+
echo "'git tag'" > goedwig/tag.py
5+
echo "TAG = '$TAG'" >> goedwig/tag.py
46

57
rm -rf dist
68
python setup.py sdist bdist_wheel

goedwig/tag.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
'git tag'
2+
TAG = 'v0.1.3'

goedwig/version.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
Git tag sets a version string.
66
"""
77

8-
from os.path import dirname
9-
import pathlib
108
import typing
119

12-
repo_path = pathlib.Path(dirname(__file__))
13-
tag_file = repo_path.parents[0] / "TAG"
14-
__version__ = tag_file.read_text().strip()
10+
from .tag import TAG
11+
12+
__version__ = TAG
1513

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

0 commit comments

Comments
 (0)