Skip to content

Commit

Permalink
Use uv to install test dependencies into nox venvs
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Jan 18, 2025
1 parent a258b12 commit 11b70b7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 11b70b7

Please sign in to comment.