Skip to content

Commit

Permalink
fix: noxfile added to mypy, three fixes (#408)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
henryiii committed Jun 23, 2023
1 parent 363c992 commit 924a057
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -204,7 +204,7 @@ def downstream(session: nox.Session) -> None:
"clone",
args.project,
*remaining,
proj_dir,
str(proj_dir),
"--recurse-submodules",
external=True,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 924a057

Please sign in to comment.