diff --git a/README.md b/README.md index bb4f94d466ae9d83381ca2736cdaed145921d856..e15c9cc17ca10b1294694991596bab2f4aac83f2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -SKA Logging Configuration -========================= +SKA Logging Configuration Library +================================= [](https://developer.skatelescope.org/projects/ska-logging/en/latest/?badge=latest) diff --git a/setup.py b/setup.py index 0b0484fc2171fdad0e5c69d523a1cd3978ee4ea9..306618d964689f56e9ffd952b2cd54f5ffc94cf2 100644 --- a/setup.py +++ b/setup.py @@ -8,8 +8,7 @@ with open("README.md") as readme_file: setup( name="ska_logging", - version="0.1.0", - description="", + description="Square Kilometre Array logging configuration library", long_description=readme + "\n\n", author="Anton Joubert", author_email="ajoubert+ska@ska.ac.za", @@ -29,17 +28,22 @@ setup( "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering :: Astronomy", ], python_requires=">=3.5", test_suite="tests", install_requires=[], setup_requires=[ + # dependency for automatic git-based version + "katversion", # dependency for `python setup.py test` "pytest-runner", # dependencies for `python setup.py build_sphinx` "sphinx", "recommonmark", ], + use_katversion=True, 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"]}, ) diff --git a/ska_logging/__init__.py b/ska_logging/__init__.py index c781de4ee5f6a66e6043b74d2d1e8fb1673987a1..f90d3da80dc28123a54e35ab31136c7c4564a33e 100644 --- a/ska_logging/__init__.py +++ b/ska_logging/__init__.py @@ -3,9 +3,21 @@ """Module init code.""" __all__ = ("configure_logging",) -__version__ = "0.1.0" __author__ = "Anton Joubert" __email__ = "ajoubert+ska@ska.ac.za" 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