From 11b70b7ecda80c84de9a453769d6343c809af886 Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Sat, 18 Jan 2025 14:50:40 -0600 Subject: [PATCH] Use uv to install test dependencies into nox venvs --- noxfile.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 9f17d5d..71cdaef 100644 --- a/noxfile.py +++ b/noxfile.py @@ -16,11 +16,22 @@ DEFAULT_COVERAGE_FORMATS = ['html', 'term'] -@nox.session(python=['3.10', '3.11', '3.12', '3.13']) +def install_deps(session): + """Install project and test dependencies into a nox session using uv""" + session.env['UV_PROJECT_ENVIRONMENT'] = session.virtualenv.location + session.run_install( + 'uv', + 'sync', + '--frozen', + '--all-extras', + ) + + +@nox.session(python=['3.10', '3.11', '3.12', '3.13'], venv_backend='uv') def test(session): """Run tests for a specific python version""" test_paths = session.posargs or ['test'] - session.install('.', 'pytest', 'pytest-xdist') + install_deps(session) session.run('pytest', '-n', 'auto', *test_paths)