lightning/Makefile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.8 KiB
Makefile
Raw Normal View History

.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=1
2022-08-23 19:28:53 +00:00
# install only Lightning Trainer packages
export PACKAGE_NAME=pytorch
clean:
# clean all temp runs
rm -rf $(shell find . -name "mlruns")
rm -rf $(shell find . -name "lightning_log")
2021-02-08 01:31:44 +00:00
rm -rf $(shell find . -name "lightning_logs")
rm -rf _ckpt_*
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf ./docs/build
rm -rf ./docs/source-fabric/api/generated
rm -rf ./docs/source-pytorch/notebooks
rm -rf ./docs/source-pytorch/generated
rm -rf ./docs/source-pytorch/*/generated
rm -rf ./docs/source-pytorch/api
rm -rf build
rm -rf dist
rm -rf *.egg-info
rm -rf src/*.egg-info
2023-02-21 15:01:30 +00:00
rm -rf src/lightning_fabric/*/
rm -rf src/pytorch_lightning/*/
test: clean
# Review the CONTRIBUTING documentation for other ways to test.
pip install -e . \
-r requirements/pytorch/base.txt \
-r requirements/fabric/base.txt \
-r requirements/pytorch/test.txt \
# run tests with coverage
python -m coverage run --source src/lightning/pytorch -m pytest src/lightning/pytorch tests/tests_pytorch -v
python -m coverage run --source src/lightning/fabric -m pytest src/lightning/fabric tests/tests_fabric -v
python -m coverage report
docs: docs-pytorch
sphinx-theme:
pip install -q awscli
mkdir -p dist/
aws s3 sync --no-sign-request s3://sphinx-packages/ dist/
pip install lai-sphinx-theme -f dist/
docs-fabric: clean sphinx-theme
pip install -e .[all] --quiet -r requirements/fabric/docs.txt
cd docs/source-fabric && $(MAKE) html --jobs $(nproc)
docs-pytorch: clean sphinx-theme
pip install -e .[all] --quiet -r requirements/pytorch/docs.txt -r _notebooks/.actions/requires.txt
cd docs/source-pytorch && $(MAKE) html --jobs $(nproc)
2022-01-16 04:08:11 +00:00
update:
git submodule update --init --recursive --remote