Skip to content

Commit 371426a

Browse files
committed
chore: read dep groups in noxfile
Signed-off-by: Henry Schreiner <[email protected]>
1 parent d14ec5b commit 371426a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

noxfile.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@ def install_and_run(session: nox.Session, script: str, *args: str, **kwargs: Any
2121
return session.run("python", script, *args, **kwargs)
2222

2323

24+
def dep_group(group: str) -> list[str]:
25+
return nox.project.load_toml("pyproject.toml")["dependency-groups"][group] # type: ignore[no-any-return]
26+
27+
2428
@nox.session
2529
def tests(session: nox.Session) -> None:
2630
"""
2731
Run the unit and regular tests.
2832
"""
29-
session.install("-e.[test]")
33+
session.install("-e.", *dep_group("test"))
3034
if session.posargs:
3135
session.run("pytest", *session.posargs)
3236
else:
@@ -123,7 +127,7 @@ def update_pins(session: nox.Session) -> None:
123127
"""
124128
Update the python, docker and virtualenv pins version inplace.
125129
"""
126-
session.install("-e.[bin]")
130+
session.install("-e.", *dep_group("bin"))
127131
session.run("python", "bin/update_pythons.py", "--force")
128132
session.run("python", "bin/update_docker.py")
129133
session.run("python", "bin/update_virtualenv.py", "--force")
@@ -166,7 +170,7 @@ def docs(session: nox.Session) -> None:
166170
"""
167171
Build the docs. Will serve unless --non-interactive
168172
"""
169-
session.install("-e.[docs]")
173+
session.install("-e.", *dep_group("docs"))
170174
session.run("mkdocs", "serve" if session.interactive else "build", "--strict", *session.posargs)
171175

172176

0 commit comments

Comments
 (0)