From 65d042117d54ac49a4d938cd2f835978d3f8c6dc Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Tue, 28 May 2024 14:49:54 +0100 Subject: [PATCH 1/4] Add missing return-type annotation --- tests/test_myproject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From da25d1ea7c721affd80d06e5e0d75d2c42578228 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Tue, 28 May 2024 12:37:28 +0100 Subject: [PATCH 2/4] Remove unnecessary tests/__init__.py file --- tests/__init__.py | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 tests/__init__.py 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 From fb2f48809d9e3e9b86245af4b994ed413c6c11fe Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Tue, 28 May 2024 14:46:46 +0100 Subject: [PATCH 3/4] Use importlib to find package version --- myproject/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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__) From abad7ed64c8853257396b80289a75b03218ecdcc Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Tue, 28 May 2024 15:37:00 +0100 Subject: [PATCH 4/4] Drop ruff from dev dependencies --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) 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