Skip to content
Snippets Groups Projects
Commit c4c6db5a authored by Anton Joubert's avatar Anton Joubert
Browse files

SAR-54 update setup.py to use katversion

`katversion` allows for automatic versioning based on the git status.
Tags with semantic versions are automatically picked up.

Also added some missing information to `setup.py`.
parent 6fad038f
No related branches found
No related tags found
No related merge requests found
SKA Logging Configuration SKA Logging Configuration Library
========================= =================================
[![Documentation Status](https://readthedocs.org/projects/ska-logging/badge/?version=latest)](https://developer.skatelescope.org/projects/ska-logging/en/latest/?badge=latest) [![Documentation Status](https://readthedocs.org/projects/ska-logging/badge/?version=latest)](https://developer.skatelescope.org/projects/ska-logging/en/latest/?badge=latest)
......
...@@ -8,8 +8,7 @@ with open("README.md") as readme_file: ...@@ -8,8 +8,7 @@ with open("README.md") as readme_file:
setup( setup(
name="ska_logging", name="ska_logging",
version="0.1.0", description="Square Kilometre Array logging configuration library",
description="",
long_description=readme + "\n\n", long_description=readme + "\n\n",
author="Anton Joubert", author="Anton Joubert",
author_email="ajoubert+ska@ska.ac.za", author_email="ajoubert+ska@ska.ac.za",
...@@ -29,17 +28,22 @@ setup( ...@@ -29,17 +28,22 @@ setup(
"Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Astronomy",
], ],
python_requires=">=3.5", python_requires=">=3.5",
test_suite="tests", test_suite="tests",
install_requires=[], install_requires=[],
setup_requires=[ setup_requires=[
# dependency for automatic git-based version
"katversion",
# dependency for `python setup.py test` # dependency for `python setup.py test`
"pytest-runner", "pytest-runner",
# dependencies for `python setup.py build_sphinx` # dependencies for `python setup.py build_sphinx`
"sphinx", "sphinx",
"recommonmark", "recommonmark",
], ],
use_katversion=True,
tests_require=["pytest", "pytest-cov", "pytest-json-report", "pycodestyle"], tests_require=["pytest", "pytest-cov", "pytest-json-report", "pycodestyle"],
extras_require={"dev": ["prospector[with_pyroma]", "yapf", "isort"]}, extras_require={"dev": ["prospector[with_pyroma]", "black", "isort"]},
) )
...@@ -3,9 +3,21 @@ ...@@ -3,9 +3,21 @@
"""Module init code.""" """Module init code."""
__all__ = ("configure_logging",) __all__ = ("configure_logging",)
__version__ = "0.1.0"
__author__ = "Anton Joubert" __author__ = "Anton Joubert"
__email__ = "ajoubert+ska@ska.ac.za" __email__ = "ajoubert+ska@ska.ac.za"
from .configuration import configure_logging from .configuration import configure_logging
# BEGIN VERSION CHECK
# Get package version when locally imported from repo or via -e develop install
try:
import katversion as _katversion
except ImportError: # pragma: no cover
import time as _time
__version__ = "0.0+unknown.{}".format(_time.strftime("%Y%m%d%H%M"))
else: # pragma: no cover
__version__ = _katversion.get_version(__path__[0])
# END VERSION CHECK
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment