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"
12
13[tool.poetry.dev-dependencies]
14
15[build-system]
16requires = ["poetry-core>=1.0.0"]
17build-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/#osx--linux--bashonwindows-install-instructions
11      - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
12      # Tell poetry to not use a virtual environment
13      - $HOME/.poetry/bin/poetry config virtualenvs.create false
14      # Install project's dependencies
15      - $HOME/.poetry/bin/poetry install
16
17sphinx:
18  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(2022, 7, 25, 8, 20, 44, 641061)