Skip to content

Commit 0038095

Browse files
committed
add make for docs (#5685)
* add make docs * docs
1 parent 84a8d2d commit 0038095

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/CONTRIBUTING.md

+6
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ Most of the tests in PyTorch Lightning train a trial MNIST model under various t
104104

105105
## Guidelines
106106

107+
### Developments scripts
108+
To build the documentation locally, simply execute the following commands from project root (only for Unix):
109+
- `make clean` cleans repo from temp/generated files
110+
- `make docs` builds documentation under _docs/build/html_
111+
- `make test` runs all project's tests
112+
107113
### Original code
108114

109115
All added or edited code shall be the own original work of the particular contributor.

Makefile

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1-
.PHONY: test clean
1+
.PHONY: test clean docs
2+
3+
# to imitate SLURM set only single node
4+
export SLURM_LOCALID=0
5+
# assume you have installed need packages
6+
export SPHINX_MOCK_REQUIREMENTS=0
27

38
test:
9+
pip install -r requirements/devel.txt
410
# install APEX, see https://github.com/NVIDIA/apex#linux
5-
# to imitate SLURM set only single node
6-
export SLURM_LOCALID=0
711

812
# use this to run tests
913
rm -rf _ckpt_*
1014
rm -rf ./lightning_logs
1115
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests pl_examples -v --flake8
12-
python -m coverage report -m
16+
python -m coverage report
1317

1418
# specific file
15-
# python -m coverage run --source pytorch_lightning -m py.test --flake8 --durations=0 -v -k
19+
# python -m coverage run --source pytorch_lightning -m pytest --flake8 --durations=0 -v -k
20+
21+
docs: clean
22+
pip install --quiet -r requirements/docs.txt
23+
python -m sphinx -b html -W docs/source docs/build
1624

1725
clean:
1826
# clean all temp runs
19-
rm -rf $(shell find . -name "mlruns" )
27+
rm -rf $(shell find . -name "mlruns")
28+
rm -rf .mypy_cache
29+
rm -rf .pytest_cache
30+
rm -rf ./docs/build
31+
rm -rf ./docs/source/generated
32+
rm -rf ./docs/source/*/generated
33+
rm -rf ./docs/source/api

0 commit comments

Comments
 (0)