Skip to content

Commit 0ff8ac6

Browse files
authored
Use --no-binary option on ReadTheDocs (#156)
Per discussion in readthedocs/readthedocs.org#10789, ReadTheDocs doesn’t ever plan to support a way to set the `--no-binary` flag in a pip install step. However, there is a newer feature that allows us to specify pre/post install commands, so this is attempt to install that way instead. Overall, the goal here is to get away from `requirements.txt` files and smooth a path towards `pyproject.toml` and other more modern tools.
1 parent bb5c8e5 commit 0ff8ac6

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

.readthedocs.yaml

+8-12
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ build:
1515
- libssl-dev
1616
- openssl
1717
- libcurl4-openssl-dev
18-
19-
python:
20-
install:
21-
# Install first to make sure the --no-binary option is used for html5-parser/lxml.
22-
# (The option is not preserved when installing from the wayback package definition.)
23-
- requirements: "requirements.txt"
24-
- method: pip
25-
path: "."
26-
extra_requirements:
27-
- server
28-
- docs
29-
- requirements: "requirements-experimental.txt"
18+
jobs:
19+
post_install:
20+
# Use job hooks so we can specify the `--no-binary` option, which is not
21+
# possible in the `python.install` section of this config file.
22+
- python -m pip install '.[server,docs]' --no-binary lxml --upgrade --upgrade-strategy only-if-needed
23+
# Experimental dependencies are not supported in standard package
24+
# metadata, so we need to pip install them directly.
25+
- python -m pip install --exists-action=w -r requirements-experimental.txt
3026

3127
sphinx:
3228
configuration: docs/source/conf.py

0 commit comments

Comments
 (0)