Skip to content

Commit

Permalink
docs: update for venv_backend
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Mar 7, 2024
1 parent 23e55d0 commit 2e06271
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,19 @@ You can also specify that the virtualenv should *always* be reused instead of re
def tests(session):
pass
You are not limited to virtualenv, there is a selection of backends you can choose from as venv, conda, mamba, or virtualenv (default):
You are not limited to virtualenv, there is a selection of backends you can choose from as venv, uv, conda, mamba, or virtualenv (default):

.. code-block:: python
@nox.session(venv_backend='venv')
def tests(session):
pass
You can chain together optional backends with ``|``, such as ``uv|virtualenv``
or ``mamba|conda``, and the first available backend will be selected. You
cannot put anything after a backend that can't be missing like ``venv`` or
``virtualenv``.

Finally, custom backend parameters are supported:

.. code-block:: python
Expand All @@ -183,6 +188,9 @@ Finally, custom backend parameters are supported:
def tests(session):
pass
If you need to check to see which backend was selected, you can access it via
``session.venv_backend``.


Passing arguments into sessions
-------------------------------
Expand Down
3 changes: 3 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ Note that using this option does not change the backend for sessions where ``ven

Backends that could be missing (``uv``, ``conda``, and ``mamba``) can have a fallback using ``|``, such as ``uv|virtualenv`` or ``mamba|conda``. This will use the first item that is available on the users system.

If you need to check to see which backend was selected, you can access it via
``session.venv_backend`` in your noxfile.

.. _opt-force-venv-backend:

Forcing the sessions backend
Expand Down

0 comments on commit 2e06271

Please sign in to comment.