From e5cee24cb08f8c93f1012122ab0553761df75033 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 21 Jul 2022 12:41:45 +0200 Subject: [PATCH 1/2] Docs: `poetry` example on `build.jobs` section There multiple ways to install Poetry on Read the Docs and all of them at least one thing that I don't like. So, I'm recommending using the official one described as the first option in their own page --which is not perfect, but it's the official one :) --- 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 7f83ce74afb..41cb20a1ed7 100644 --- a/docs/user/build-customization.rst +++ b/docs/user/build-customization.rst @@ -241,6 +241,37 @@ To setup it, you need to define the version of Node.js to use and install the de - npm install -g jsdoc +Install dependencies with Poetry +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In case the project is managing Python dependencies with `Poetry `__, +it can use ``post_create_environment`` user-defined job to install them while building the documentation. +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 poetry + # https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions + - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + # Tell poetry to not use a virtual environment + - $HOME/.poetry/bin/poetry config virtualenvs.create false + # Install project's dependencies + - $HOME/.poetry/bin/poetry install + + sphinx: + configuration: docs/conf.py + + Override the build process -------------------------- From eb8d19788e337314bf9fd666bc004073058c62d8 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Thu, 21 Jul 2022 19:16:35 +0200 Subject: [PATCH 2/2] Update docs/user/build-customization.rst Co-authored-by: Anthony --- docs/user/build-customization.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user/build-customization.rst b/docs/user/build-customization.rst index 41cb20a1ed7..c8e833000fb 100644 --- a/docs/user/build-customization.rst +++ b/docs/user/build-customization.rst @@ -244,8 +244,8 @@ To setup it, you need to define the version of Node.js to use and install the de Install dependencies with Poetry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -In case the project is managing Python dependencies with `Poetry `__, -it can use ``post_create_environment`` user-defined job to install them while building the documentation. +Projects managed with `Poetry `__, +can use the ``post_create_environment`` user-defined job to use Poetry for installing Python dependencies. Take a look at the following example: