Skip to content

Commit

Permalink
Switch from katversion to setuptools-scm for versioning
Browse files Browse the repository at this point in the history
katversion doesn't support the full range of version specifiers
including beta versions. This also allows setup.py to finally be
removed.
  • Loading branch information
bmerry committed Apr 16, 2024
1 parent f6509b1 commit d69184d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.coverage
/.eggs
/.mypy_cache
/src/aiokatcp/_version.py
src/aiokatcp.egg-info
*.pyc
__pycache__
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ files = src/aiokatcp, examples, tests

[mypy-async_solipsism.*]
ignore_missing_imports = True

[mypy-katversion.*]
ignore_missing_imports = True
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[build-system]
requires = ["setuptools", "katversion", "setuptools_scm"]
requires = ["setuptools", "setuptools_scm"]

[tool.setuptools_scm]
version_file = "src/aiokatcp/_version.py"

[tool.isort]
profile = "black"
Expand Down
30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

15 changes: 2 additions & 13 deletions src/aiokatcp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017, 2022, 2023 National Research Foundation (SARAO)
# Copyright 2017, 2022-2024 National Research Foundation (SARAO)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
Expand All @@ -25,18 +25,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# BEGIN VERSION CHECK
# Get package version when locally imported from repo or via -e develop install
try:
import katversion as _katversion
except ImportError:
import time as _time

__version__ = "0.0+unknown.{}".format(_time.strftime("%Y%m%d%H%M"))
else:
__version__ = _katversion.get_version(__path__[0])
# END VERSION CHECK

from ._version import __version__
from .client import ( # noqa: F401
AbstractSensorWatcher,
Client,
Expand Down

0 comments on commit d69184d

Please sign in to comment.