From 533692d5371e670064b021d8cb4966d2fc0332bd Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 18 Apr 2024 11:55:55 +0200 Subject: [PATCH] Docs: explain how to use `uv` to install dependencies Raised in https://github.com/readthedocs/readthedocs.org/issues/11289 --- docs/user/build-customization.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/user/build-customization.rst b/docs/user/build-customization.rst index a0334d5cc6f..d74f81c6185 100644 --- a/docs/user/build-customization.rst +++ b/docs/user/build-customization.rst @@ -356,6 +356,37 @@ Take a look at the following example: configuration: docs/conf.py +Install dependencies with ``uv`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Projects managed with `uv `__, +can use the ``post_create_environment`` user-defined job to use ``uv`` for installing Python dependencies. +Take a look at the following example: + + +.. code-block:: yaml + :caption: .readthedocs.yaml + + version: 2 + + build: + os: "ubuntu-22.04" + tools: + python: "3.10" + jobs: + post_create_environment: + # Install uv + - pip install uv + post_install: + # Install dependencies with 'docs' dependency group + # VIRTUAL_ENV needs to be set manually for now. + # See https://github.com/readthedocs/readthedocs.org/pull/11152/ + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install .[docs] + + sphinx: + configuration: docs/conf.py + + Update Conda version ^^^^^^^^^^^^^^^^^^^^