Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up docs Makefile #1466

Merged
merged 4 commits into from Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .ci/test_lint_doctests.py
Expand Up @@ -45,9 +45,6 @@ def test_run_pre_commit_hooks():

def test_run_doctests():
docs_folder = pathlib.Path(os.path.dirname(__file__)) / '..' / 'docs'
api_reference_folder = docs_folder / 'source' / 'api_reference'
# Remove the `api_reference` folder, which isn't automatically removed via `make clean`
shutil.rmtree(api_reference_folder, ignore_errors=True)
check_output(subprocess.run(['make', 'clean'], cwd=docs_folder, capture_output=True, text=True))
# Must build the html first to ensure that doctests in .. autosummary:: generated pages are included
check_output(subprocess.run(['make', 'html'], cwd=docs_folder, capture_output=True, text=True))
Expand Down
2 changes: 0 additions & 2 deletions STYLE_GUIDE.md
Expand Up @@ -409,7 +409,6 @@ In one terminal, run:
source path/to/composer_venv/bin/activate # activate your composer virtual env
cd composer/docs # cd to the docs folder insde your composer clone
make clean
rm -rf source/api_reference # make clean doesn't remove this folder
make html
```

Expand Down Expand Up @@ -477,7 +476,6 @@ Assuming you already have a development install of Composer (see these [instruct
source path/to/composer_venv/bin/activate # activate your composer virtual env
cd composer/docs # cd to the docs folder insde your composer clone
make clean
rm -rf source/api_reference # make clean doesn't remove this folder
make html # the html build must be completed first to ensure all doctests are identified
make doctest 2>/dev/null # For more verbosity, do not direct stderr to /dev/null
```
9 changes: 8 additions & 1 deletion docs/Makefile
Expand Up @@ -12,7 +12,14 @@ BUILDDIR = _build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
doctest:
@$(SPHINXBUILD) -M doctest "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) -q $(O)

clean:
rm -rf $(BUILDDIR)/*
rm -rf $(SOURCEDIR)/api_reference

.PHONY: help Makefile clean doctest

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down