pytorch-lightning
/
Makefile
70 строк · 2.2 Кб
1.PHONY: test clean docs
2
3# to imitate SLURM set only single node
4export SLURM_LOCALID=0
5# assume you have installed need packages
6export SPHINX_MOCK_REQUIREMENTS=1
7# install only Lightning Trainer packages
8export PACKAGE_NAME=pytorch
9
10clean:
11# clean all temp runs
12rm -rf $(shell find . -name "mlruns")
13rm -rf $(shell find . -name "lightning_log")
14rm -rf $(shell find . -name "lightning_logs")
15rm -rf _ckpt_*
16rm -rf .mypy_cache
17rm -rf .pytest_cache
18rm -rf ./docs/build
19rm -rf ./docs/source-fabric/api/generated
20rm -rf ./docs/source-pytorch/notebooks
21rm -rf ./docs/source-pytorch/generated
22rm -rf ./docs/source-pytorch/*/generated
23rm -rf ./docs/source-pytorch/api
24rm -rf ./docs/source-app/generated
25rm -rf ./docs/source-app/*/generated
26rm -rf build
27rm -rf dist
28rm -rf *.egg-info
29rm -rf src/*.egg-info
30rm -rf src/lightning_app/*/
31rm -rf src/lightning_fabric/*/
32rm -rf src/pytorch_lightning/*/
33
34test: clean
35# Review the CONTRIBUTING documentation for other ways to test.
36pip install -e . \
37-r requirements/pytorch/base.txt \
38-r requirements/app/app.txt \
39-r requirements/fabric/base.txt \
40-r requirements/pytorch/test.txt \
41-r requirements/app/test.txt
42
43# run tests with coverage
44python -m coverage run --source src/lightning/pytorch -m pytest src/lightning/pytorch tests/tests_pytorch -v
45python -m coverage run --source src/lightning/app -m pytest tests/tests/app -v
46python -m coverage run --source src/lightning/fabric -m pytest src/lightning/fabric tests/tests_fabric -v
47python -m coverage report
48
49docs: docs-pytorch
50
51sphinx-theme:
52pip install -q awscli
53mkdir -p dist/
54aws s3 sync --no-sign-request s3://sphinx-packages/ dist/
55pip install lai-sphinx-theme -f dist/
56
57docs-app: clean sphinx-theme
58pip install -e .[all] --quiet -r requirements/app/docs.txt
59cd docs/source-app && $(MAKE) html --jobs $(nproc)
60
61docs-fabric: clean sphinx-theme
62pip install -e .[all] --quiet -r requirements/fabric/docs.txt
63cd docs/source-fabric && $(MAKE) html --jobs $(nproc)
64
65docs-pytorch: clean sphinx-theme
66pip install -e .[all] --quiet -r requirements/pytorch/docs.txt -r _notebooks/.actions/requires.txt
67cd docs/source-pytorch && $(MAKE) html --jobs $(nproc)
68
69update:
70git submodule update --init --recursive --remote
71