diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..2b8e26dcb --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,17 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required: the version of this file's schema. +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/en_us/dashboard/source/conf.py + fail_on_warning: true + +# Optionally set the version of Python and requirements required to build your docs +python: + version: "3.8" + install: + - requirements: requirements/doc.txt diff --git a/Makefile b/Makefile index 819e6ed2f..2bcb5404f 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ DJANGO_VERSION=django22 DJANGO_SETTINGS_MODULE ?= "analytics_dashboard.settings.local" -.PHONY: requirements clean +.PHONY: requirements clean docs requirements: requirements.py requirements.js @@ -158,3 +158,5 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp mv requirements/test.tmp requirements/test.txt +docs: + tox -e docs diff --git a/tox.ini b/tox.ini index a32a131a6..099ddefb9 100644 --- a/tox.ini +++ b/tox.ini @@ -6,8 +6,6 @@ envlist = py38-django{22,30,31}-{a11y,accept,check_isort,create_acceptance_test_ DJANGO_SETTINGS_MODULE = analytics_dashboard.settings.test [testenv] -envdir = - py38: {toxworkdir}/py38 passenv = API_SERVER_URL API_AUTH_TOKEN @@ -64,3 +62,17 @@ commands = accept: pytest -v acceptance_tests --ignore=acceptance_tests/course_validation a11y: pytest -v a11y_tests -k 'not NUM_PROCESSES==1' --ignore=acceptance_tests/course_validation +[testenv:docs] +deps = + -r{toxinidir}/requirements/doc.txt +allowlist_externals = + make + env +setenv = +# -W will treat warnings as errors. + SPHINXOPTS = -W +commands = +# -e allows for overriding setting from the environment. +# -C changes the directory to `docs` before running the command. + make -e -C docs/en_us/dashboard clean + make -e -C docs/en_us/dashboard html