11"""Nox sessions."""
22
33import os
4- import shlex
54import shutil
65import sys
76from pathlib import Path
8- from textwrap import dedent
97from tempfile import NamedTemporaryFile
108
119import nox
@@ -37,7 +35,9 @@ def precommit(session: Session) -> None:
3735 "--show-diff-on-failure" ,
3836 ]
3937 session .run (
40- "uv" , "pip" , "install" ,
38+ "uv" ,
39+ "pip" ,
40+ "install" ,
4141 "black" ,
4242 "darglint" ,
4343 "flake8" ,
@@ -50,7 +50,7 @@ def precommit(session: Session) -> None:
5050 "pre-commit" ,
5151 "pre-commit-hooks" ,
5252 "pyupgrade" ,
53- external = True
53+ external = True ,
5454 )
5555 session .run ("pre-commit" , * args )
5656
@@ -60,16 +60,17 @@ def safety(session: Session) -> None:
6060 """Scan dependencies for insecure packages."""
6161 with NamedTemporaryFile (delete = False ) as requirements :
6262 session .run (
63- "uv" , "pip" , "compile" ,
63+ "uv" ,
64+ "pip" ,
65+ "compile" ,
6466 "pyproject.toml" ,
65- "--output-file" , requirements .name ,
66- external = True
67+ "--output-file" ,
68+ requirements .name ,
69+ external = True ,
6770 )
68- session .run (
69- "uv" , "pip" , "install" , "safety" ,
70- external = True
71- )
72- # TODO(Altay): Remove the CVE ignore once its resolved. Its not critical, so ignoring now.
71+ session .run ("uv" , "pip" , "install" , "safety" , external = True )
72+ # TODO(Altay): Remove the CVE ignore once its resolved.
73+ # It's not critical, so ignoring now.
7374 ignore = ["70612" ]
7475 try :
7576 session .run (
@@ -99,9 +100,15 @@ def tests(session: Session) -> None:
99100 """Run the test suite."""
100101 session .run_always ("uv" , "pip" , "install" , "-e" , ".[cloud]" , external = True )
101102 session .run (
102- "uv" , "pip" , "install" ,
103- "coverage[toml]" , "pytest" , "pygments" , "pytest-dependency" , "s3fs" ,
104- external = True
103+ "uv" ,
104+ "pip" ,
105+ "install" ,
106+ "coverage[toml]" ,
107+ "pytest" ,
108+ "pygments" ,
109+ "pytest-dependency" ,
110+ "s3fs" ,
111+ external = True ,
105112 )
106113 try :
107114 session .run ("coverage" , "run" , "--parallel" , "-m" , "pytest" , * session .posargs )
@@ -127,7 +134,9 @@ def coverage(session: Session) -> None:
127134def typeguard (session : Session ) -> None :
128135 """Runtime type checking using Typeguard."""
129136 session .run_always ("uv" , "pip" , "install" , "-e" , "." , external = True )
130- session .run ("uv" , "pip" , "install" , "pytest" , "typeguard" , "pygments" , external = True )
137+ session .run (
138+ "uv" , "pip" , "install" , "pytest" , "typeguard" , "pygments" , external = True
139+ )
131140 session .run ("pytest" , f"--typeguard-packages={ package } " , * session .posargs )
132141
133142
@@ -155,14 +164,16 @@ def docs_build(session: Session) -> None:
155164
156165 session .run_always ("uv" , "pip" , "install" , "-e" , "." , external = True )
157166 session .run (
158- "uv" , "pip" , "install" ,
167+ "uv" ,
168+ "pip" ,
169+ "install" ,
159170 "sphinx" ,
160171 "sphinx-click" ,
161172 "sphinx-copybutton" ,
162173 "furo" ,
163174 "myst-nb" ,
164175 "linkify-it-py" ,
165- external = True
176+ external = True ,
166177 )
167178
168179 build_dir = Path ("docs" , "_build" )
@@ -178,15 +189,17 @@ def docs(session: Session) -> None:
178189 args = session .posargs or ["--open-browser" , "docs" , "docs/_build" ]
179190 session .run_always ("uv" , "pip" , "install" , "-e" , "." , external = True )
180191 session .run (
181- "uv" , "pip" , "install" ,
192+ "uv" ,
193+ "pip" ,
194+ "install" ,
182195 "sphinx" ,
183196 "sphinx-autobuild" ,
184197 "sphinx-click" ,
185198 "sphinx-copybutton" ,
186199 "furo" ,
187200 "myst-nb" ,
188201 "linkify-it-py" ,
189- external = True
202+ external = True ,
190203 )
191204
192205 build_dir = Path ("docs" , "_build" )
0 commit comments