Build with Poetry

Build the documentation shown here with poetry install under build.jobs. It’s using the official and recommended way to install Poetry on Linux. See https://python-poetry.org/docs/#osx–linux–bashonwindows-install-instructions


pyproject.toml
 1[tool.poetry]
 2name = "test-builds"
 3version = "0.1.0"
 4description = "Experiments with Read the Docs' build system"
 5authors = ["Manuel Kaufmann <humitos@gmail.com>"]
 6license = "MIT"
 7
 8[tool.poetry.dependencies]
 9python = "^3.10"
10Sphinx = "^5.0.2"
11sphinx-autorun = "^1.1.1"
12sphinx-rtd-theme = "^2.0.0"
13
14[tool.poetry.dev-dependencies]
15
16[build-system]
17requires = ["poetry-core>=1.0.0"]
18build-backend = "poetry.core.masonry.api"

.readthedocs.yaml
 1version: 2
 2
 3build:
 4  os: "ubuntu-22.04"
 5  tools:
 6    python: "3.10"
 7  jobs:
 8    post_create_environment:
 9      # Install poetry
10      # https://python-poetry.org/docs/#installing-manually
11      - pip install poetry
12    post_install:
13      # Install dependencies with 'docs' dependency group
14      # https://python-poetry.org/docs/managing-dependencies/#dependency-groups
15      # VIRTUAL_ENV needs to be set manually for now, see #11150
16      - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install
17
18sphinx:
19  configuration: docs/conf.py

Sphinx configuration file used to build this docs (see full file),

docs/conf.py
 1# -*- coding: utf-8 -*-
 2
 3# Default settings
 4project = 'Test Builds'
 5extensions = [
 6    'sphinx_autorun',
 7]
 8
 9latex_engine = 'xelatex'  # allow us to build Unicode chars
10
11
12# Include all your settings here
13html_theme = 'sphinx_rtd_theme'
14
15
16
17

>>> # Build at
>>> import datetime
>>> datetime.datetime.utcnow()  # UTC
datetime.datetime(2024, 3, 12, 20, 45, 25, 731701)