Skip to content

Commit 5057f6a

Browse files
humitosagjohnson
andauthored
Docs: poetry example on build.jobs section (#9445)
* 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 :) * Update docs/user/build-customization.rst Co-authored-by: Anthony <[email protected]> Co-authored-by: Anthony <[email protected]>
1 parent 142e6b6 commit 5057f6a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/user/build-customization.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,37 @@ To setup it, you need to define the version of Node.js to use and install the de
241241
- npm install -g jsdoc
242242
243243
244+
Install dependencies with Poetry
245+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246+
247+
Projects managed with `Poetry <https://python-poetry.org/>`__,
248+
can use the ``post_create_environment`` user-defined job to use Poetry for installing Python dependencies.
249+
Take a look at the following example:
250+
251+
252+
.. code-block:: yaml
253+
:caption: .readthedocs.yaml
254+
255+
version: 2
256+
257+
build:
258+
os: "ubuntu-22.04"
259+
tools:
260+
python: "3.10"
261+
jobs:
262+
post_create_environment:
263+
# Install poetry
264+
# https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions
265+
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
266+
# Tell poetry to not use a virtual environment
267+
- $HOME/.poetry/bin/poetry config virtualenvs.create false
268+
# Install project's dependencies
269+
- $HOME/.poetry/bin/poetry install
270+
271+
sphinx:
272+
configuration: docs/conf.py
273+
274+
244275
Override the build process
245276
--------------------------
246277

0 commit comments

Comments
 (0)