diff --git a/Makefile b/Makefile index 00e7f61b46448d1df0db3db61e41cd4afa43b88f..6759f51a0becaeb692d91d519a416a2901f5c2b3 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ lint: # FIXME pylint needs to run twice since there is no way go gather the text and junit xml output at the same time pip3 install pylint2junit; \ - pylint --output-format=parseable ska_logging | tee ./build/code_analysis.stdout; \ - pylint --output-format=pylint2junit.JunitReporter ska_logging > ./build/reports/linting.xml; + pylint --output-format=parseable src/ska/ska_logging | tee ./build/code_analysis.stdout; \ + pylint --output-format=pylint2junit.JunitReporter src/ska/ska_logging > ./build/reports/linting.xml; .PHONY: all test lint diff --git a/setup.cfg b/setup.cfg index 3ec5355b0abc125332a6f8865c1e2aecc72bf2e6..4ab4b6f5c81e6982f3ad1bf01ad0ab68981aff1c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ test = pytest [coverage:run] branch = True -source = ska_logging +source = src [tool:pytest] testpaths = tests diff --git a/setup.py b/setup.py index 306618d964689f56e9ffd952b2cd54f5ffc94cf2..797393bd6a70c212a5f86f6a637dc15dd037b45e 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import setuptools from setuptools import setup with open("README.md") as readme_file: @@ -13,8 +14,9 @@ setup( author="Anton Joubert", author_email="ajoubert+ska@ska.ac.za", url="https://gitlab.com/ska-telescope/ska-logging", - packages=["ska_logging"], - package_dir={"ska_logging": "ska_logging"}, + packages=setuptools.find_namespace_packages(where="src", include=["ska.*"]), + namespace_packages=["ska"], + package_dir={"": "src"}, include_package_data=True, license="BSD license", zip_safe=False, diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 6b1d558910e9cf6799d5eb05aa43770bd586d331..b80e84a4db28a1c2932e843f71f3c7c1e43efd7b 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 +import ska.ska_logging.configuration as configuration -from ska_logging import configure_logging, get_default_formatter +from ska.ska_logging import configure_logging, get_default_formatter @pytest.fixture @@ -211,21 +211,21 @@ class TestOverride: """ def test_add(self): - out = ska_logging.configuration._override({"a": 1}, {"b": 2}) + out = configuration._override({"a": 1}, {"b": 2}) assert out == {"a": 1, "b": 2} def test_remove(self): - out = ska_logging.configuration._override({"a": 1, "b": 2}, {"b": None}) + out = configuration._override({"a": 1, "b": 2}, {"b": None}) assert out == {"a": 1} - out = ska_logging.configuration._override(out, {"b": None}) # Already absent + out = configuration._override(out, {"b": None}) # Already absent assert out == {"a": 1} def test_replace(self): - out = ska_logging.configuration._override({"a": 1, "b": 2}, {"b": 3}) + out = configuration._override({"a": 1, "b": 2}, {"b": 3}) assert out == {"a": 1, "b": 3} def test_recurse(self): orig = {"a": {"aa": 1, "ab": 2}, "b": {"ba": {"c": 10}, "bb": [5]}} override = {"a": {"aa": [], "ab": None, "ac": 3}, "b": {"bb": [1, 2]}} - out = ska_logging.configuration._override(orig, override) + out = configuration._override(orig, override) assert out == {"a": {"aa": [], "ac": 3}, "b": {"ba": {"c": 10}, "bb": [1, 2]}}