You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a follow up to #11946 (updating the uv example to rely on uv's
project management capabilities) , I added here a few paragraphs on what
the new `uv` example achieves.
I hope that makes it acceptable for integration @ericholscher .
@lengau , it would be appreciated if you could review, that this matches
your expectation as well.
Thank you
<!-- readthedocs-preview docs start -->
---
:books: Documentation previews :books:
- User's documentation (`docs`):
https://docs--12064.org.readthedocs.build/12064/
<!-- readthedocs-preview docs end -->
<!-- readthedocs-preview dev start -->
- Developer's documentation (`dev`):
https://dev--12064.org.readthedocs.build/12064/
<!-- readthedocs-preview dev end -->
---------
Co-authored-by: Alex Lowe <[email protected]>
Co-authored-by: Eric Holscher <[email protected]>
Co-authored-by: Manuel Kaufmann <[email protected]>
Co-authored-by: Eric Holscher <[email protected]>
Copy file name to clipboardExpand all lines: docs/user/build-customization.rst
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -450,33 +450,41 @@ Take a look at the following example:
450
450
Install dependencies with ``uv``
451
451
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
452
452
453
-
Projects can use `uv <https://github.com/astral-sh/uv/>`__,
454
-
to install Python dependencies, usually reducing the time taken to install compared to pip.
455
-
Take a look at the following example:
453
+
Projects managed with `uv <https://github.com/astral-sh/uv/>`__ can install `uv` with asdf,
454
+
and then rely on it to set up the environment and install the python project and its dependencies.
455
+
Read the Docs' own build steps expect it by setting the ``UV_PROJECT_ENVIRONMENT`` variable,
456
+
usually reducing the time taken to install compared to pip.
457
+
458
+
The following examples assumes a uv project as described in its
459
+
`projects concept <https://docs.astral.sh/uv/concepts/projects/>`__. As an introduction
460
+
refer to its `Working on projects guide <https://docs.astral.sh/uv/guides/projects/>`__.
461
+
The ``docs`` dependency group which should is pulled in during the ``uv sync`` step (if additional
462
+
extras are required they can be added with the `--extra attribute <https://docs.astral.sh/uv/concepts/projects/sync/#syncing-optional-dependencies>`__).
456
463
464
+
If a ``uv.lock`` file exists it is respected.
457
465
458
466
.. code-block:: yaml
467
+
459
468
:caption: .readthedocs.yaml
460
469
461
470
version: 2
462
471
472
+
sphinx:
473
+
configuration: docs/conf.py
474
+
463
475
build:
464
476
os: ubuntu-24.04
465
477
tools:
466
478
python: "3.13"
467
479
jobs:
468
-
create_environment:
480
+
pre_create_environment:
469
481
- asdf plugin add uv
470
482
- asdf install uv latest
471
483
- asdf global uv latest
472
-
- uv venv
484
+
create_environment:
485
+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
473
486
install:
474
-
- uv pip install -r requirements.txt
475
-
build:
476
-
html:
477
-
- uv run sphinx-build -T -b html docs $READTHEDOCS_OUTPUT/html
478
-
479
-
MkDocs projects could use ``NO_COLOR=1 uv run mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html`` instead.
0 commit comments