5050DEFAULT_CI_PYTHON = "3.11"
5151
5252
53+ def _install_groups (session : nox .Session , * groups : str ) -> None :
54+ """Install shared tooling without preinstalling SDK runtime dependencies."""
55+ pyproject = nox .project .load_toml (REPO_ROOT / "pyproject.toml" )
56+ session .install (* nox .project .dependency_groups (pyproject , * groups ))
57+
58+
5359def _install_packages (session : nox .Session , editable : bool = False ) -> None :
5460 """Install durabletask and the azure-functions-durable provider.
5561
@@ -291,7 +297,7 @@ def _stop_dts_emulator(container_name: str) -> None:
291297@nox .session
292298def lint (session : nox .Session ) -> None :
293299 """Run Flake8 and Ruff modernization checks without replacing formatting."""
294- session . install ( "flake8" , "ruff " )
300+ _install_groups ( session , "lint " )
295301 targets = session .posargs or (
296302 "durabletask" ,
297303 "durabletask-azuremanaged" ,
@@ -309,27 +315,19 @@ def lint(session: nox.Session) -> None:
309315@nox .session (python = ["3.11" ])
310316def typecheck_core (session : nox .Session ) -> None :
311317 """Run strict pyright checks for the core and Azure Managed packages."""
312- session .install ("-r" , "requirements.txt" )
313- session .install ("-r" , "examples/requirements.txt" )
314- for requirements in sorted ((REPO_ROOT / "examples" ).glob ("*/requirements.txt" )):
315- session .install ("-r" , str (requirements ))
318+ _install_groups (session , "test" , "typecheck" , "examples" )
316319 session .install (
317- "--force-reinstall" ,
318- "--no-deps" ,
319- str (REPO_ROOT ),
320+ f"{ REPO_ROOT } [azure-blob-payloads,opentelemetry]" ,
320321 str (AZUREMANAGED ),
321322 )
322- session .install (f"{ REPO_ROOT } [azure-blob-payloads,opentelemetry]" )
323- session .install ("pyright" )
324323 session .run ("pyright" , * session .posargs )
325324
326325
327326@nox .session (python = ["3.13" ])
328327def typecheck_functions (session : nox .Session ) -> None :
329328 """Run strict pyright checks for azure-functions-durable."""
330- session . install ( "-r " , "requirements.txt " )
329+ _install_groups ( session , "test " , "typecheck " )
331330 _install_packages (session , editable = True )
332- session .install ("pyright" )
333331 session .run (
334332 "pyright" ,
335333 "-p" ,
@@ -341,7 +339,7 @@ def typecheck_functions(session: nox.Session) -> None:
341339@nox .session (python = ["3.13" ])
342340def typecheck_functions_package (session : nox .Session ) -> None :
343341 """Check the installed Functions and core wheels with strict Pyright."""
344- session . install ( "build" , "pyright " )
342+ _install_groups ( session , "build" , "typecheck " )
345343 temp_dir = Path (session .create_tmp ())
346344 artifact_dir = temp_dir / "functions-dist"
347345 core_artifact_dir = temp_dir / "core-dist"
@@ -401,7 +399,9 @@ def typecheck_functions_package(session: nox.Session) -> None:
401399 "-c" ,
402400 "import sys; print(sys.executable)" ,
403401 silent = True ,
404- ).strip ()
402+ )
403+ assert python_path is not None
404+ python_path = python_path .strip ()
405405 session .run (
406406 "pyright" ,
407407 "--pythonpath" ,
@@ -420,8 +420,8 @@ def core_tests(session: nox.Session) -> None:
420420 arguments = ("--silent" , "--blobPort" , "10000" ),
421421 )
422422 try :
423- session . install ( "-r" , "requirements.txt " )
424- session .install ("-e" , f"{ REPO_ROOT } [azure-blob-payloads]" , "aiohttp " )
423+ _install_groups ( session , "test " )
424+ session .install ("-e" , f"{ REPO_ROOT } [azure-blob-payloads,opentelemetry] " )
425425 arguments = _pytest_arguments ("tests/durabletask" , session .posargs )
426426 session .run (
427427 "pytest" ,
@@ -442,8 +442,7 @@ def azuremanaged_tests(session: nox.Session) -> None:
442442 try :
443443 session .env ["TASKHUB" ] = "default"
444444 session .env ["ENDPOINT" ] = endpoint
445- session .install ("-r" , "requirements.txt" )
446- session .install ("-r" , "examples/requirements.txt" )
445+ _install_groups (session , "test" )
447446 session .install (
448447 "-e" ,
449448 str (REPO_ROOT ),
@@ -465,9 +464,8 @@ def azuremanaged_tests(session: nox.Session) -> None:
465464@nox .session (python = ["3.13" , "3.14" , "3.15" ])
466465def functions_unit (session : nox .Session ) -> None :
467466 """Run the azure-functions-durable unit tests (no func/azurite required)."""
468- session . install ( "-r" , "requirements.txt " )
467+ _install_groups ( session , "test " )
469468 _install_packages (session , editable = True )
470- session .install ("pytest" )
471469 arguments = _pytest_arguments ("tests/azure-functions-durable" , session .posargs )
472470 session .run (
473471 "pytest" , * _pytest_warning_arguments (session ), * arguments ,
@@ -510,10 +508,9 @@ def functions_e2e(session: nox.Session) -> None:
510508 )
511509 try :
512510 session .env ["E2E_PAYLOAD_CONTAINER" ] = _new_test_namespace ("payloads" )
513- session . install ( "-r" , "requirements.txt " )
511+ _install_groups ( session , "functions-e2e " )
514512 _install_packages (session , editable = True )
515- session .install ("-e" , f"{ REPO_ROOT } [azure-blob-payloads]" , "aiohttp" )
516- session .install ("pytest" , "opentelemetry-exporter-otlp-proto-grpc" )
513+ session .install ("-e" , f"{ REPO_ROOT } [azure-blob-payloads]" )
517514 for app in E2E_APPS :
518515 _link_app_venv (session , E2E_APPS_DIR / app )
519516 arguments = _pytest_arguments (
0 commit comments