Commit 8c655f0 1 parent c919c73 commit 8c655f0 Copy full SHA for 8c655f0
File tree 5 files changed +38
-18
lines changed
5 files changed +38
-18
lines changed Original file line number Diff line number Diff line change 20
20
- name : Install Dependencies
21
21
run : |
22
22
python -m pip install --upgrade pip
23
- pip install setuptools wheel
23
+ pip install build packaging setuptools wheel
24
24
25
25
- name : Build Distribution
26
26
run : |
27
- python setup.py sdist bdist_wheel
27
+ python -m build
Original file line number Diff line number Diff line change @@ -18,15 +18,12 @@ def get_version(short: bool = False) -> str:
18
18
Prints the version.
19
19
"""
20
20
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__ )]
25
22
26
23
if __version_info__ ["releaselevel" ] != "final" and not short :
27
24
vers .append (
28
- "{} {}" .format (
29
- __version_info__ ["releaselevel" ][ 0 ] ,
25
+ "-{}. {}" .format (
26
+ __version_info__ ["releaselevel" ],
30
27
__version_info__ ["serial" ],
31
28
)
32
29
)
Original file line number Diff line number Diff line change 1
1
# Primary Dependencies
2
2
3
3
# 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
7
9
# twine==5.1.1
8
- # wheel==0.44 .0
10
+ # wheel==0.45 .0
9
11
10
12
# Testing Dependencies
11
- # pytest==8.3.2
12
- # coverage==7.6.1
13
+ # pytest==8.3.3
14
+ # coverage==7.6.4
13
15
# pyflakes==3.2.0
14
- # pytest-cov==5 .0.0
16
+ # pytest-cov==6 .0.0
15
17
# pytest-flakes==4.0.5
16
18
# pytest-spec==4.0.0
17
19
37
39
# pkginfo==1.10.0
38
40
# platformdirs==4.3.6
39
41
# pluggy==1.5.0
42
+ # pyproject_hooks==1.2.0
40
43
# Pygments==2.18.0
41
44
# readme_renderer==44.0
42
45
# requests-toolbelt==1.0.0
Original file line number Diff line number Diff line change 1
- pytest == 8.3.2
2
- coverage == 7.6.1
1
+ # Testing Dependencies
2
+ pytest == 8.3.3
3
+ coverage == 7.6.4
3
4
pyflakes == 3.2.0
4
- pytest-cov == 5 .0.0
5
+ pytest-cov == 6 .0.0
5
6
pytest-flakes == 4.0.5
6
7
pytest-spec == 4.0.0
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments