diff --git a/docs/conf.py b/docs/conf.py index a2ca944..3b452ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,7 @@ with open(Path(BASE_DIR, "..", "keyosk", "__about__.py")) as infile: project = ABOUT["__title__"] copyright = "2019, Ethan Paul" -author = ", ".join(ABOUT["__authors__"]) +author = "Ethan Paul " # The full version, including alpha/beta/rc tags release = ABOUT["__version__"] diff --git a/keyosk/__about__.py b/keyosk/__about__.py index e5a233e..2f76b77 100644 --- a/keyosk/__about__.py +++ b/keyosk/__about__.py @@ -1,12 +1,3 @@ -"""Access package info programatically without duplication""" -import importlib.resources - -import toml - -PYPROJECT = toml.loads(importlib.resources.read_text("keyosk", "pyproject.toml")) - -__authors__ = PYPROJECT["tool"]["poetry"]["authors"] -__summary__ = PYPROJECT["tool"]["poetry"]["description"] -__title__ = PYPROJECT["tool"]["poetry"]["name"] -__url__ = PYPROJECT["tool"]["poetry"]["repository"] -__version__ = PYPROJECT["tool"]["poetry"]["version"] +# pylint: disable=missing-docstring +__version__ = "0.1.0-alpha-1" +__title__ = "keyosk" diff --git a/keyosk/pyproject.toml b/keyosk/pyproject.toml deleted file mode 120000 index 1e11d78..0000000 --- a/keyosk/pyproject.toml +++ /dev/null @@ -1 +0,0 @@ -../pyproject.toml \ No newline at end of file diff --git a/tests/test_about.py b/tests/test_about.py new file mode 100644 index 0000000..a232119 --- /dev/null +++ b/tests/test_about.py @@ -0,0 +1,22 @@ +from pathlib import Path + +import toml + +from keyosk import __about__ + + +PYPROJECT_PATH = Path("pyproject.toml") + + +def test_version(): + with PYPROJECT_PATH.open() as infile: + pyproject = toml.load(infile) + + assert __about__.__version__ == pyproject["tool"]["poetry"]["version"] + + +def test_title(): + with PYPROJECT_PATH.open() as infile: + pyproject = toml.load(infile) + + assert __about__.__title__ == pyproject["tool"]["poetry"]["name"]