diff --git a/myproject/__init__.py b/myproject/__init__.py index f8e068e..8a0eea9 100644 --- a/myproject/__init__.py +++ b/myproject/__init__.py @@ -1,3 +1,5 @@ """The main module for MyProject.""" -__version__ = "0.1.0" +from importlib.metadata import version + +__version__ = version(__name__) diff --git a/pyproject.toml b/pyproject.toml index 5f84b4e..37a1f22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ pytest-cov = "^5.0.0" pytest-mypy = "^0.10.0" pytest-mock = "^3.7.0" pre-commit = "^3.0.4" -ruff = "^0.4.4" [tool.mypy] disallow_any_explicit = true diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 76d8514..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Unit tests for MyProject.""" - -from logging import getLogger - -# Disable flake8 logger as it can be rather verbose -getLogger("flake8").propagate = False diff --git a/tests/test_myproject.py b/tests/test_myproject.py index 64f1a3a..a369f07 100644 --- a/tests/test_myproject.py +++ b/tests/test_myproject.py @@ -3,6 +3,6 @@ from myproject import __version__ -def test_version(): +def test_version() -> None: """Check that the version is acceptable.""" assert __version__ == "0.1.0"