diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fdd2aa4ecc53c55db94fc103265ce8d28e92c420..587cf7be0f04ba8dc05115d189d8b1e9f7fbc806 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,13 @@ Change Log All notable changes to this project will be documented in this file. This project adheres to `Semantic Versioning <http://semver.org/>`_. +v0.4.0 +****** + +Change packaging to use single namespace. +Usage like `from ska.logging import configure_logging` changes +to `from ska_logging import configure_logging`. + v0.3.0 ****** diff --git a/Makefile b/Makefile index 59dd6f5992046374b100733452e209806fc92c3a..9b9fafe861fb4d1a4032595eb8d0a596b7811d5e 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ lint: # it is running in an importable folder with the same name. python3 -m pip install pylint_junit pylint2junit; \ cd src; \ - pylint --output-format=parseable ska.logging.configuration | tee ../build/code_analysis.stdout; \ - pylint --output-format=pylint2junit.JunitReporter ska.logging.configuration > ../build/reports/linting.xml; + pylint --output-format=parseable ska_logging.configuration | tee ../build/code_analysis.stdout; \ + pylint --output-format=pylint2junit.JunitReporter ska_logging.configuration > ../build/reports/linting.xml; .PHONY: all test lint diff --git a/README.md b/README.md index 5fcc704997e928ea55e5892c3740774b1537287e..a7ecd163702eac7dacd89a109d58f2b74b5574e1 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ For Python applications, this is as simple as: ```python import logging -from ska.logging import configure_logging +from ska_logging import configure_logging def main(): configure_logging() @@ -29,7 +29,7 @@ be specified. It may be useful to link that to a command line option or environ ```python import logging -from ska.logging import configure_logging +from ska_logging import configure_logging def main(): configure_logging(logging.DEBUG) @@ -45,7 +45,7 @@ No validation is done by this library. If the filter is `None` (the default), t ```python import logging -from ska.logging import configure_logging +from ska_logging import configure_logging class TangoDeviceTagsFilter(logging.Filter): @@ -67,7 +67,7 @@ by the default configuration. ```python import logging.handlers -from ska.logging import configure_logging +from ska_logging import configure_logging ADDITIONAL_LOGGING_CONFIG = { @@ -96,7 +96,7 @@ A more practical use case is adding and removing handlers at runtime. ```python import logging import logging.handlers -from ska.logging import configure_logging, get_default_formatter +from ska_logging import configure_logging, get_default_formatter def main(): @@ -166,7 +166,7 @@ Code analysis * Use [Pylint](https://www.pylint.org) as the code analysis framework * By default it uses the [PEP8 style guide](https://www.python.org/dev/peps/pep-0008/) * Use the provided `code-analysis.sh` script in order to run the code analysis in the `module` and `tests` - * Code analysis should be run by calling `pylint ska.logging`. All pertaining options reside under the `.pylintrc` file. + * Code analysis should be run by calling `pylint ska_logging`. All pertaining options reside under the `.pylintrc` file. * Code analysis should only raise document related warnings (i.e. `#FIXME` comments) before merging the code Writing documentation diff --git a/docs/src/package/guide.rst b/docs/src/package/guide.rst index 3f55393ef6e3c55c8351b8b31bcbbf69829fb7d3..20e07ce743d972efe13a001c27b58658e96f2621 100644 --- a/docs/src/package/guide.rst +++ b/docs/src/package/guide.rst @@ -22,5 +22,5 @@ Public API Documentation Functions --------- -.. automodule:: ska.logging +.. automodule:: ska_logging :members: diff --git a/setup.py b/setup.py index 6821fbbc7e9c6052d687e16210ca8e249565b337..cc7388d0351134c8b313e3bd129d184c3f6b3cb3 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( author="Anton Joubert", author_email="ajoubert+ska@ska.ac.za", url="https://gitlab.com/ska-telescope/ska-logging", - packages=setuptools.find_namespace_packages(where="src", include=["ska.*"]), + packages=setuptools.find_namespace_packages(where="src"), package_dir={"": "src"}, include_package_data=True, license="BSD license", diff --git a/src/ska/logging/__init__.py b/src/ska_logging/__init__.py similarity index 100% rename from src/ska/logging/__init__.py rename to src/ska_logging/__init__.py diff --git a/src/ska/logging/configuration.py b/src/ska_logging/configuration.py similarity index 100% rename from src/ska/logging/configuration.py rename to src/ska_logging/configuration.py diff --git a/tests/test_configuration.py b/tests/test_configuration.py index d10ff72f9858cc5eb6e3ba9eab5e5e891060568d..e16881988768e724c57dbcb933349e2e30f822af 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -7,9 +7,9 @@ import logging.handlers import time import pytest -import ska.logging.configuration as configuration +import ska_logging.configuration as configuration -from ska.logging import configure_logging, get_default_formatter +from ska_logging import configure_logging, get_default_formatter @pytest.fixture @@ -104,7 +104,7 @@ def recording_tags_logger(): @pytest.mark.usefixtures("reset_logging") class TestConfigureLogging: - """Tests for :func:`~ska.logging.configuration.configure_logging`.""" + """Tests for :func:`~ska_logging.configuration.configure_logging`.""" def test_includes_console_handler(self, default_logger): assert get_named_handler(default_logger, "console") @@ -170,7 +170,7 @@ class TestConfigureLogging: @pytest.mark.usefixtures("reset_logging") class TestGetDefaultFormatter: - """Tests for :func:`~ska.logging.configuration.get_default_formatter`.""" + """Tests for :func:`~ska_logging.configuration.get_default_formatter`.""" def get_recorded_message(self, logger): logger.info("test message") @@ -199,7 +199,7 @@ class TestGetDefaultFormatter: class TestOverride: - """Tests for :func:`~ska.logging.configuration._override`. + """Tests for :func:`~ska_logging.configuration._override`. Code based on: https://github.com/ska-sa/katsdpcontroller/blob/