From 00380954270db22da07fdbda6d82551c81227d2f Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Mon, 1 Feb 2021 17:09:12 +0100 Subject: [PATCH] add make for docs (#5685) * add make docs * docs --- .github/CONTRIBUTING.md | 6 ++++++ Makefile | 26 ++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 75a3ed1c84..98321b2095 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -104,6 +104,12 @@ Most of the tests in PyTorch Lightning train a trial MNIST model under various t ## Guidelines +### Developments scripts +To build the documentation locally, simply execute the following commands from project root (only for Unix): +- `make clean` cleans repo from temp/generated files +- `make docs` builds documentation under _docs/build/html_ +- `make test` runs all project's tests + ### Original code All added or edited code shall be the own original work of the particular contributor. diff --git a/Makefile b/Makefile index 55a95f0b14..142d03fcfb 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,33 @@ -.PHONY: test clean +.PHONY: test clean docs + +# to imitate SLURM set only single node +export SLURM_LOCALID=0 +# assume you have installed need packages +export SPHINX_MOCK_REQUIREMENTS=0 test: + pip install -r requirements/devel.txt # install APEX, see https://github.com/NVIDIA/apex#linux - # to imitate SLURM set only single node - export SLURM_LOCALID=0 # use this to run tests rm -rf _ckpt_* rm -rf ./lightning_logs python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests pl_examples -v --flake8 - python -m coverage report -m + python -m coverage report # specific file - # python -m coverage run --source pytorch_lightning -m py.test --flake8 --durations=0 -v -k + # python -m coverage run --source pytorch_lightning -m pytest --flake8 --durations=0 -v -k + +docs: clean + pip install --quiet -r requirements/docs.txt + python -m sphinx -b html -W docs/source docs/build clean: # clean all temp runs - rm -rf $(shell find . -name "mlruns" ) + rm -rf $(shell find . -name "mlruns") + rm -rf .mypy_cache + rm -rf .pytest_cache + rm -rf ./docs/build + rm -rf ./docs/source/generated + rm -rf ./docs/source/*/generated + rm -rf ./docs/source/api