From 924a05733dedea6d376589dacf58bb3188552d10 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 23 Jun 2023 17:21:17 -0400 Subject: [PATCH] fix: noxfile added to mypy, three fixes (#408) Adding mypy checking found three (edit: technically two, the Path/str one is a bug in nox's types, I think) bugs in the noxfile. One of them closes #404. Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 3 ++- noxfile.py | 6 +++--- pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a9d9971..afbfeb52 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,7 +69,7 @@ repos: tests/packages/dynamic_metadata/src/dynamic/__init__.py| tests/packages/.*/setup.py ) - files: ^(src|tests) + files: ^(src|tests|noxfile.py) args: [] additional_dependencies: - build @@ -81,6 +81,7 @@ repos: - importlib-resources - markdown-it-py<3 # Python 3.7 compat needed for mypy check - ninja + - nox - packaging - pyproject_metadata - pytest diff --git a/noxfile.py b/noxfile.py index f5cb8ad1..cef823bb 100644 --- a/noxfile.py +++ b/noxfile.py @@ -36,7 +36,7 @@ def pylint(session: nox.Session) -> None: def _run_tests( session: nox.Session, *, - install_args: Sequence[str], + install_args: Sequence[str] = (), run_args: Sequence[str] = (), extras: Sequence[str] = (), ) -> None: @@ -147,7 +147,7 @@ def build(session: nox.Session) -> None: """ session.install("build") - session.run("python", "-m", "build", **session.posargs) + session.run("python", "-m", "build", *session.posargs) EXAMPLES = ["c", "abi3", "pybind11", "nanobind", "swig", "cython"] @@ -204,7 +204,7 @@ def downstream(session: nox.Session) -> None: "clone", args.project, *remaining, - proj_dir, + str(proj_dir), "--recurse-submodules", external=True, ) diff --git a/pyproject.toml b/pyproject.toml index ed07fd84..6193fb3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,7 +136,7 @@ markers = [ [tool.mypy] -files = ["src", "tests"] +files = ["src", "tests", "noxfile.py"] mypy_path = ["$MYPY_CONFIG_FILE_DIR/src"] python_version = "3.7" warn_unused_configs = true