Skip to content

Commit 8c655f0

Browse files
committed
prepare for pypi build
1 parent c919c73 commit 8c655f0

File tree

5 files changed

+38
-18
lines changed

5 files changed

+38
-18
lines changed

.github/workflows/build.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- name: Install Dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install setuptools wheel
23+
pip install build packaging setuptools wheel
2424
2525
- name: Build Distribution
2626
run: |
27-
python setup.py sdist bdist_wheel
27+
python -m build

honu/version.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ def get_version(short: bool = False) -> str:
1818
Prints the version.
1919
"""
2020
assert __version_info__["releaselevel"] in ("alpha", "beta", "final")
21-
vers = ["{major}.{minor}".format(**__version_info__)]
22-
23-
if __version_info__["micro"]:
24-
vers.append(".{micro}".format(**__version_info__))
21+
vers = ["{major}.{minor}.{micro}".format(**__version_info__)]
2522

2623
if __version_info__["releaselevel"] != "final" and not short:
2724
vers.append(
28-
"{}{}".format(
29-
__version_info__["releaselevel"][0],
25+
"-{}.{}".format(
26+
__version_info__["releaselevel"],
3027
__version_info__["serial"],
3128
)
3229
)

requirements.txt

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# Primary Dependencies
22

33
# Packaging Dependencies
4-
# black==24.8.0
5-
# pip==24.2
6-
# setuptools==72.2.0
4+
# black==24.10.0
5+
# build==1.2.2.post1
6+
# packaging==24.2
7+
# pip==24.3.1
8+
# setuptools==75.3.0
79
# twine==5.1.1
8-
# wheel==0.44.0
10+
# wheel==0.45.0
911

1012
# Testing Dependencies
11-
# pytest==8.3.2
12-
# coverage==7.6.1
13+
# pytest==8.3.3
14+
# coverage==7.6.4
1315
# pyflakes==3.2.0
14-
# pytest-cov==5.0.0
16+
# pytest-cov==6.0.0
1517
# pytest-flakes==4.0.5
1618
# pytest-spec==4.0.0
1719

@@ -37,6 +39,7 @@
3739
# pkginfo==1.10.0
3840
# platformdirs==4.3.6
3941
# pluggy==1.5.0
42+
# pyproject_hooks==1.2.0
4043
# Pygments==2.18.0
4144
# readme_renderer==44.0
4245
# requests-toolbelt==1.0.0

tests/requirements.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
pytest==8.3.2
2-
coverage==7.6.1
1+
# Testing Dependencies
2+
pytest==8.3.3
3+
coverage==7.6.4
34
pyflakes==3.2.0
4-
pytest-cov==5.0.0
5+
pytest-cov==6.0.0
56
pytest-flakes==4.0.5
67
pytest-spec==4.0.0

tests/test_version.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Test semantic versioning in the package
3+
"""
4+
5+
import re
6+
7+
from honu.version import get_version
8+
9+
10+
def test_semver():
11+
"""
12+
Ensure that the current version is a semantic version
13+
"""
14+
semver = re.compile(
15+
r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" # noqa
16+
)
17+
18+
assert semver.match(get_version(short=False)) is not None
19+
assert semver.match(get_version(short=True)) is not None

0 commit comments

Comments
 (0)