Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit fc97ab8

Browse files
committed
docs: Add a target to build docs locally for testing.
1 parent 3166815 commit fc97ab8

2 files changed

Lines changed: 22 additions & 7 deletions

File tree

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ help: ## display this help message
1010
@echo "Please use \`make <target>' where <target> is one of"
1111
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'
1212

13-
.PHONY: requirements develop clean diff.report view.diff.report quality static
13+
.PHONY: requirements develop clean diff.report view.diff.report quality static docs
1414

1515
requirements: ## install base requirements
1616
pip3 install -q -r requirements/base.txt
@@ -144,3 +144,6 @@ travis_docker_push: travis_docker_tag travis_docker_auth ## push to docker hub
144144
docker push "openedx/analytics-data-api:$$TRAVIS_COMMIT"
145145
docker push 'openedx/analytics-data-api:latest-newrelic'
146146
docker push "openedx/analytics-data-api:$$TRAVIS_COMMIT-newrelic"
147+
148+
docs:
149+
tox -e docs

tox.ini

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@ skipsdist = True
33
envlist = py38-django{22,30,31}-{check_isort,pycodestyle,pylint,isort,tests}
44

55
[testenv]
6-
envdir =
7-
py38: {toxworkdir}/py38
8-
passenv =
6+
passenv =
97
ELASTICSEARCH_LEARNERS_HOST
108
COVERAGE_DIR
11-
setenv =
9+
setenv =
1210
tests: DJANGO_SETTINGS_MODULE = analyticsdataserver.settings.test
1311
NODE_BIN = ./node_modules/.bin
1412
PATH = $PATH:$NODE_BIN
15-
deps =
13+
deps =
1614
django22: Django>=2.2,<2.3
1715
django30: Django>=3.0,<3.1
1816
django31: Django>=3.1,<3.2
1917
-r requirements/test.txt
20-
commands =
18+
commands =
2119
check_isort: isort --check-only --recursive --diff analytics_data_api/ analyticsdataserver/
2220
isort: isort --recursive analytics_data_api/ analyticsdataserver/
2321
clean: coverage erase
@@ -27,3 +25,17 @@ commands =
2725
coverage: coverage html
2826
coverage: coverage xml
2927

28+
[testenv:docs]
29+
deps =
30+
-r{toxinidir}/requirements/doc.txt
31+
allowlist_externals =
32+
make
33+
env
34+
setenv =
35+
# -W will treat warnings as errors.
36+
SPHINXOPTS = -W
37+
commands =
38+
# -e allows for overriding setting from the environment.
39+
# -C changes the directory to `docs` before running the command.
40+
make -e -C docs/api clean
41+
make -e -C docs/api html

0 commit comments

Comments
 (0)