I really like Read the Docs - a great documentation hosting platform, free for open source and community projects.
I really like Pipenv for managing my Python project dependencies.
Unfortunately Read the Docs have decided to not support Pipenv. This is perfectly reasonable of them - it’s their service, and everything they decide to support incurs a cost. Alas it’s not quite ideal for me!
Fortunately both tools provide useful compatibility features that make it pretty straightforward to get them working together:
- Read the Docs will let you run commands before dependencies are installed with
build.jobs.pre_install
- Pipenv will generate a
requirements.txt
withpipenv requirements
So all you need to do is add the following to your .readthedocs.yaml
and off you go:
build:
jobs:
pre_install:
- "pip install pipenv"
- "pipenv requirements > requirements.txt"