Skip to content

Commit 654050b

Browse files
authored
Add bumpver and fix pypi publish (#26)
* Add bumpver * Don't update version during publish * Fix misc MANIFEST/pyproject things * Rewrite URLs in README.md before publish
1 parent 1d475ac commit 654050b

File tree

4 files changed

+38
-46
lines changed

4 files changed

+38
-46
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,14 @@ jobs:
5353
exit 1
5454
fi
5555
56-
echo "Updating version to: $VERSION"
57-
echo "version=$VERSION" >> $GITHUB_OUTPUT
58-
59-
# Check that required files exist
60-
if [[ ! -f pyproject.toml ]]; then
61-
echo "Error: pyproject.toml not found"
62-
exit 1
63-
fi
64-
65-
if [[ ! -f src/pn5180_tagomatic/__init__.py ]]; then
66-
echo "Error: src/pn5180_tagomatic/__init__.py not found"
67-
exit 1
68-
fi
69-
70-
# Update pyproject.toml
71-
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
72-
73-
# Update __init__.py
74-
sed -i "s/^__version__ = .*/__version__ = \"$VERSION\"/" src/pn5180_tagomatic/__init__.py
75-
76-
# Verify changes
7756
echo "pyproject.toml version:"
7857
grep "^version = " pyproject.toml
7958
echo "__init__.py version:"
8059
grep "^__version__ = " src/pn5180_tagomatic/__init__.py
60+
61+
# Updating links.
62+
BASE_URL="https://github.com/bofh69/PN5180-tagomatic/tree/$VERSION"
63+
sed -i "s#](\\([^h#]\\)#$BASE_URL/\\1#" README.md
8164
8265
- name: Install build dependencies
8366
run: |

MANIFEST.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
include README.md
55
include LICENSE
6+
include REUSE.toml
67
include pyproject.toml
78
recursive-include src *.py
8-
recursive-include sketch *.ino *.md *.jpg
9+
recursive-include tests *.py
10+
recursive-include sketch *.md *.jpg
911
recursive-include LICENSES *.txt
10-
include .reuse/dep5

pyproject.toml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ version = "0.1.0"
1111
description = "USB based RFID reader with Python interface"
1212
readme = "README.md"
1313
requires-python = ">=3.10"
14-
license = {text = "GPL-3.0-or-later"}
14+
license = "GPL-3.0-or-later"
15+
license-files = [
16+
"LICENSE",
17+
"LICENSES/*",
18+
"REUSE.toml",
19+
]
1520
authors = [
16-
{name = "PN5180-tagomatic contributors"}
21+
{name = "Sebastian Andersson"}
1722
]
18-
keywords = ["rfid", "pn5180", "usb", "reader", "raspberry-pi-pico"]
23+
keywords = ["rfid", "pn5180", "reader"]
1924
classifiers = [
2025
"Development Status :: 3 - Alpha",
2126
"Intended Audience :: Developers",
@@ -37,11 +42,12 @@ dependencies = [
3742

3843
[project.optional-dependencies]
3944
dev = [
45+
"black>=23.0.0",
46+
"bumpver>=2025.1131",
47+
"mypy>=1.0.0",
4048
"pytest>=7.0.0",
4149
"pytest-cov>=4.0.0",
4250
"ruff>=0.1.0",
43-
"mypy>=1.0.0",
44-
"black>=23.0.0",
4551
"types-pyserial>=3.5.0",
4652
]
4753

@@ -102,3 +108,23 @@ addopts = [
102108
"--cov-report=html",
103109
"--cov-report=xml",
104110
]
111+
112+
[tool.bumpver]
113+
current_version = "0.1.0"
114+
version_pattern = "MAJOR.MINOR.PATCH[-PYTAGNUM]"
115+
commit_message = "bump version {old_version} -> {new_version}"
116+
tag_message = "{new_version}"
117+
tag_scope = "default"
118+
pre_commit_hook = ""
119+
post_commit_hook = ""
120+
commit = true
121+
tag = true
122+
push = false
123+
124+
[tool.bumpver.file_patterns]
125+
"pyproject.toml" = [
126+
'current_version = "{pep440_version}"',
127+
]
128+
"src/pn5180_tagomatic/__init__.py" = [
129+
'__version__ = "{pep440_version}"',
130+
]

src/pn5180_tagomatic/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)