From 1f3d266abbd85a99ff47060dddc5d913179eb332 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Tue, 30 Dec 2025 15:15:07 +0100 Subject: [PATCH 1/2] Add ty overrides for version module --- pyproject.toml | 7 +++++++ src/pytask_latex/__init__.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bf69250..826cddd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,13 @@ unused-ignore-comment = "error" [tool.ty.terminal] error-on-warning = true +[[tool.ty.overrides]] +include = ["src/**/_version.py"] + +[tool.ty.overrides.rules] +invalid-type-form = "ignore" + + [tool.pytest.ini_options] testpaths = ["src", "tests"] markers = [ diff --git a/src/pytask_latex/__init__.py b/src/pytask_latex/__init__.py index d0fff47..e509ae9 100644 --- a/src/pytask_latex/__init__.py +++ b/src/pytask_latex/__init__.py @@ -3,7 +3,9 @@ from __future__ import annotations try: - from ._version import version as __version__ + from ._version import ( + version as __version__, # ty: ignore[unresolved-import, unused-ignore-comment] + ) except ImportError: # pragma: no cover # broken installation, we don't even try unknown only works because we do poor mans # version compare From 4f66ee3b548c108ca6eab2cdc80f4d4788b907d1 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Tue, 30 Dec 2025 15:31:01 +0100 Subject: [PATCH 2/2] Fix ty ignores --- pyproject.toml | 6 ++++++ src/pytask_latex/__init__.py | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 826cddd..456a6cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,12 @@ include = ["src/**/_version.py"] [tool.ty.overrides.rules] invalid-type-form = "ignore" +[[tool.ty.overrides]] +include = ["src/**/__init__.py"] + +[tool.ty.overrides.rules] +unused-ignore-comment = "ignore" + [tool.pytest.ini_options] testpaths = ["src", "tests"] diff --git a/src/pytask_latex/__init__.py b/src/pytask_latex/__init__.py index e509ae9..ac64b33 100644 --- a/src/pytask_latex/__init__.py +++ b/src/pytask_latex/__init__.py @@ -3,9 +3,7 @@ from __future__ import annotations try: - from ._version import ( - version as __version__, # ty: ignore[unresolved-import, unused-ignore-comment] - ) + from ._version import version as __version__ # ty: ignore[unresolved-import] except ImportError: # pragma: no cover # broken installation, we don't even try unknown only works because we do poor mans # version compare