CARVIEW |
Select Language
HTTP/2 200
date: Wed, 15 Oct 2025 15:23:06 GMT
server: Fly/5d9a8537e (2025-10-13)
content-type: text/html; charset=utf-8
content-encoding: gzip
via: 2 fly.io, 2 fly.io
fly-request-id: 01K7M7FGYZ85R3R9TR78340CB9-bom
Running pip install '.[docs]' on ReadTheDocs | Simon Willison’s TILs
Running pip install '.[docs]' on ReadTheDocs
I decided to use ReadTheDocs for my in-development datasette-enrichments project.
Previously when I've used ReadTheDocs I've had a docs/
folder in my project with its own docs/requirements.txt
file containing the requirements.
For this project I decided to try putting my documentation dependencies in a setup.py
file (which I will likely upgrade to pyproject.toml
in the future) like this:
# ...
extras_require={
"test": ["pytest", "pytest-asyncio", "black", "cogapp", "ruff"],
"docs": [
"sphinx==7.2.6",
"furo==2023.9.10",
"sphinx-autobuild",
"sphinx-copybutton",
"myst-parser",
"cogapp",
],
},
# ...
When I'm working on this project locally I install these dependencies like so:
pip install -e '.[docs]'
It took me a few iterations to figure it out, so here's how to run that same command on ReadTheDocs using the .readthedocs.yaml
configuration file:
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
sphinx:
configuration: docs/conf.py
formats:
- pdf
- epub
python:
install:
- method: pip
path: .
extra_requirements:
- docs
Related
- python Defining setup.py dependencies using a URL - 2022-08-13
- python Python packages with pyproject.toml and nothing else - 2023-07-07
- sphinx Adding Sphinx autodoc to a project, and configuring Read The Docs to build it - 2021-08-10
- sphinx Format code examples in documentation with blacken-docs - 2022-04-24
- python Freezing requirements with pip-tools - 2022-07-14
- github Configuring Dependabot for a Python project - 2022-01-14
- python Installing and upgrading Datasette plugins with pipx - 2020-05-04
- github-actions actions/setup-python caching for setup.py projects - 2022-11-28
- python A few notes on Rye - 2023-04-26
- python How to call pip programatically from Python - 2020-08-11
Created 2023-11-24T13:37:54-08:00 · Edit