From 79fc92647c91b6ac222c0709bf168a6a8d304529 Mon Sep 17 00:00:00 2001 From: Jeff Yang Date: Thu, 12 Nov 2020 15:55:31 +0630 Subject: [PATCH] [make] Create Makefile (#4620) * [make] Create Makefile * exclude makefile * contributing info * rm .run_local_test.sh --- .github/CONTRIBUTING.md | 4 ++-- .run_local_tests.sh | 14 -------------- MANIFEST.in | 3 +++ Makefile | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 .run_local_tests.sh create mode 100644 Makefile diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 868507df40..c37890e9bf 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -182,10 +182,10 @@ python -m pip install ".[dev, examples]" python -m pip install pre-commit ``` -You can run the full test-case in your terminal via this bash script: +You can run the full test-case in your terminal via this make script: ```bash -bash .run_local_tests.sh +make test ``` Note: if your computer does not have multi-GPU nor TPU these tests are skipped. diff --git a/.run_local_tests.sh b/.run_local_tests.sh deleted file mode 100644 index 0b47238288..0000000000 --- a/.run_local_tests.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# 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 py.test pytorch_lightning tests pl_examples -v --flake8 -python -m coverage report -m - -# specific file -# python -m coverage run --source pytorch_lightning -m py.test --flake8 --durations=0 -v -k diff --git a/MANIFEST.in b/MANIFEST.in index ac8ba7cc62..4cedbd0f44 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -57,6 +57,9 @@ exclude *.yaml # Exclude pyright config exclude .pyrightconfig.json +# Exclude Makefile +exclude Makefile + prune .git prune .github prune .circleci diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..76e8bac4e3 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: test + +test: + # 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 + + # specific file + # python -m coverage run --source pytorch_lightning -m py.test --flake8 --durations=0 -v -k