@@ -21,12 +21,16 @@ def install_and_run(session: nox.Session, script: str, *args: str, **kwargs: Any
21
21
return session .run ("python" , script , * args , ** kwargs )
22
22
23
23
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
+
24
28
@nox .session
25
29
def tests (session : nox .Session ) -> None :
26
30
"""
27
31
Run the unit and regular tests.
28
32
"""
29
- session .install ("-e.[ test]" )
33
+ session .install ("-e." , * dep_group ( " test" ) )
30
34
if session .posargs :
31
35
session .run ("pytest" , * session .posargs )
32
36
else :
@@ -123,7 +127,7 @@ def update_pins(session: nox.Session) -> None:
123
127
"""
124
128
Update the python, docker and virtualenv pins version inplace.
125
129
"""
126
- session .install ("-e.[ bin]" )
130
+ session .install ("-e." , * dep_group ( " bin" ) )
127
131
session .run ("python" , "bin/update_pythons.py" , "--force" )
128
132
session .run ("python" , "bin/update_docker.py" )
129
133
session .run ("python" , "bin/update_virtualenv.py" , "--force" )
@@ -166,7 +170,7 @@ def docs(session: nox.Session) -> None:
166
170
"""
167
171
Build the docs. Will serve unless --non-interactive
168
172
"""
169
- session .install ("-e.[ docs]" )
173
+ session .install ("-e." , * dep_group ( " docs" ) )
170
174
session .run ("mkdocs" , "serve" if session .interactive else "build" , "--strict" , * session .posargs )
171
175
172
176
0 commit comments