Skip to content

Commit

Permalink
Support customisation of the ReadTheDocs installation of the project
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Apr 13, 2021
1 parent 417fa46 commit f3f652f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions repo_helper/files/docs.py
Expand Up @@ -198,7 +198,8 @@ def make_rtfd(repo_path: pathlib.Path, templates: jinja2.Environment) -> List[st
"""

file = PathPlus(repo_path / ".readthedocs.yml")
file.parent.maybe_make()

docs_dir = PathPlus(repo_path / templates.globals['docs_dir'])

sphinx_config = {
"builder": "html",
Expand All @@ -212,7 +213,11 @@ def make_rtfd(repo_path: pathlib.Path, templates: jinja2.Environment) -> List[st
]

install_config: List[Dict] = [{"requirements": r} for r in install_requirements]
install_config.append({"method": "pip", "path": '.'})

if (docs_dir / "rtd-extra-deps.txt").is_file():
install_config.append({"requirements": f"{templates.globals['docs_dir']}/rtd-extra-deps.txt"})
else:
install_config.append({"method": "pip", "path": '.'})

python_config = {"version": 3.8, "install": install_config}

Expand Down

0 comments on commit f3f652f

Please sign in to comment.