Skip to content

Commit

Permalink
Set include_standard=True in noxfile (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
FasterSpeeding authored Nov 28, 2024
1 parent 470915f commit 44fca44
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions python/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ def _tracked_files(session: nox.Session, *, force_all: bool = False) -> collecti
return output.splitlines()


def _install_deps(session: nox.Session, *groups: str, only_dev: bool = True) -> None:
def _install_deps(session: nox.Session, *groups: str, include_standard: bool = False) -> None:
if not groups:
return

target_type = "group"

if only_dev:
target_type = "only-group"
target_type = "only-group"
if include_standard:
target_type = "group"

session.run_install(
"uv",
Expand Down Expand Up @@ -215,7 +214,7 @@ def slot_check(session: nox.Session) -> None:
"""Check this project's slotted classes for common mistakes."""
# TODO: don't require installing .?
# https://github.com/pypa/pip/issues/10362
_install_deps(session, "lint")
_install_deps(session, "lint", include_standard=True)
session.install(".")
session.run("slotscheck", "-m", _CONFIG.assert_project_name())

Expand Down Expand Up @@ -352,7 +351,7 @@ def reformat(session: nox.Session) -> None:
def test(session: nox.Session) -> None:
"""Run this project's tests using pytest."""
# https://github.com/pypa/pip/issues/10362
_install_deps(session, "tests")
_install_deps(session, "tests", include_standard=True)
session.install(".")

if _CONFIG.extra_test_installs:
Expand All @@ -367,7 +366,7 @@ def test_coverage(session: nox.Session) -> None:
"""Run this project's tests while recording test coverage."""
project_name = _CONFIG.assert_project_name()
# https://github.com/pypa/pip/issues/10362
_install_deps(session, "tests")
_install_deps(session, "tests", include_standard=True)

if _CONFIG.extra_test_installs:
session.run_install("uv", "pip", "install", *_CONFIG.extra_test_installs)
Expand All @@ -394,7 +393,7 @@ def _run_pyright(session: nox.Session, /, *args: str) -> None:
@_filtered_session(name="type-check", reuse_venv=True)
def type_check(session: nox.Session) -> None:
"""Statically analyse and veirfy this project using Pyright."""
_install_deps(session, "type-checking")
_install_deps(session, "type-checking", include_standard=True)

if _CONFIG.extra_typing_installs:
session.run_install("uv", "pip", "install", *_CONFIG.extra_typing_installs)
Expand All @@ -415,7 +414,7 @@ def verify_types(session: nox.Session) -> None:
project_name = _CONFIG.assert_project_name()
# TODO: is installing . necessary here?
# https://github.com/pypa/pip/issues/10362
_install_deps(session, "type-checking")
_install_deps(session, "type-checking", include_standard=True)
session.install(".")
_run_pyright(session, "--verifytypes", project_name, "--ignoreexternal")

Expand Down

0 comments on commit 44fca44

Please sign in to comment.