diff --git a/noxfile.py b/noxfile.py index 8b6d9df..1abc577 100644 --- a/noxfile.py +++ b/noxfile.py @@ -89,6 +89,8 @@ PACKAGE_LOCATION = "src/" DOCS_BUILD = ".cache/docs/" DOCS_LOCATION = "docs/" +SCRIPTS_LOCATION = "scripts/" + TESTS_LOCATION = "tests/" # Locations of all *.py files @@ -97,7 +99,7 @@ SRC_LOCATIONS = ( "migrations/env.py", "migrations/versions/", NOXFILE_LOCATION, - "scripts/", + SCRIPTS_LOCATION, PACKAGE_LOCATION, TESTS_LOCATION, ) @@ -186,7 +188,7 @@ def lint_code(session: nox.Session) -> None: If no extra arguments are provided, all source files are linted. Otherwise, they are interpreted as paths the linters work on recursively. - `mypy` always checks the noxfile and the entire package regardless + `mypy` always checks the noxfile, the scripts, and the package regardless because it needs the whole program to follow types across modules. """ start(session) @@ -250,7 +252,7 @@ def lint_code(session: nox.Session) -> None: session.run("ruff", "check", *locations) session.run("mypy", "--version") - session.run("mypy", NOXFILE_LOCATION, PACKAGE_LOCATION) + session.run("mypy", NOXFILE_LOCATION, SCRIPTS_LOCATION, PACKAGE_LOCATION) @nox.session(name="test", python=MAIN_PYTHON) diff --git a/scripts/get_update_info_for_dependencies.py b/scripts/get_update_info_for_dependencies.py index 9ca926e..4100244 100755 --- a/scripts/get_update_info_for_dependencies.py +++ b/scripts/get_update_info_for_dependencies.py @@ -14,6 +14,7 @@ import json import pathlib import textwrap import tomllib +import typing as t PKG_CONSIDERED_OLD = 2 # years after release when a package is considered "old" @@ -23,7 +24,7 @@ PROJECT_ROOT = pathlib.Path(__file__).resolve().parent.parent REPORT_FILE = PROJECT_ROOT / ".cache/dependencies_checked.txt" -def get_direct_dependencies(lock_file: dict) -> dict[str, str]: +def get_direct_dependencies(lock_file: dict[str, t.Any]) -> dict[str, str]: """Map the direct dependencies to "main" or their extra or group. `lock_file` is a mapping as returned from `load_lock_file()`. @@ -41,7 +42,7 @@ def get_direct_dependencies(lock_file: dict) -> dict[str, str]: return labels -def get_pinned_packages(lock_file: dict) -> dict[str, str]: +def get_pinned_packages(lock_file: dict[str, t.Any]) -> dict[str, str]: """Map all packages from PyPI to their versions. `lock_file` is a mapping as returned from `load_lock_file()`. @@ -84,7 +85,7 @@ def get_years_since_release( return round(years_since_release, 1), latest_version -def load_lock_file() -> dict: +def load_lock_file() -> dict[str, t.Any]: """Load the uv.lock file.""" return tomllib.loads((PROJECT_ROOT / "uv.lock").read_text())