Skip to content

Commit

Permalink
prepare for pypi build
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Nov 26, 2024
1 parent c919c73 commit 8c655f0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install build packaging setuptools wheel
- name: Build Distribution
run: |
python setup.py sdist bdist_wheel
python -m build
9 changes: 3 additions & 6 deletions honu/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@ def get_version(short: bool = False) -> str:
Prints the version.
"""
assert __version_info__["releaselevel"] in ("alpha", "beta", "final")
vers = ["{major}.{minor}".format(**__version_info__)]

if __version_info__["micro"]:
vers.append(".{micro}".format(**__version_info__))
vers = ["{major}.{minor}.{micro}".format(**__version_info__)]

if __version_info__["releaselevel"] != "final" and not short:
vers.append(
"{}{}".format(
__version_info__["releaselevel"][0],
"-{}.{}".format(
__version_info__["releaselevel"],
__version_info__["serial"],
)
)
Expand Down
17 changes: 10 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Primary Dependencies

# Packaging Dependencies
# black==24.8.0
# pip==24.2
# setuptools==72.2.0
# black==24.10.0
# build==1.2.2.post1
# packaging==24.2
# pip==24.3.1
# setuptools==75.3.0
# twine==5.1.1
# wheel==0.44.0
# wheel==0.45.0

# Testing Dependencies
# pytest==8.3.2
# coverage==7.6.1
# pytest==8.3.3
# coverage==7.6.4
# pyflakes==3.2.0
# pytest-cov==5.0.0
# pytest-cov==6.0.0
# pytest-flakes==4.0.5
# pytest-spec==4.0.0

Expand All @@ -37,6 +39,7 @@
# pkginfo==1.10.0
# platformdirs==4.3.6
# pluggy==1.5.0
# pyproject_hooks==1.2.0
# Pygments==2.18.0
# readme_renderer==44.0
# requests-toolbelt==1.0.0
Expand Down
7 changes: 4 additions & 3 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pytest==8.3.2
coverage==7.6.1
# Testing Dependencies
pytest==8.3.3
coverage==7.6.4
pyflakes==3.2.0
pytest-cov==5.0.0
pytest-cov==6.0.0
pytest-flakes==4.0.5
pytest-spec==4.0.0
19 changes: 19 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Test semantic versioning in the package
"""

import re

from honu.version import get_version


def test_semver():
"""
Ensure that the current version is a semantic version
"""
semver = re.compile(
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
)

assert semver.match(get_version(short=False)) is not None
assert semver.match(get_version(short=True)) is not None

0 comments on commit 8c655f0

Please sign in to comment.