diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 1b606b35f6..26c427e2d9 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -63,6 +63,7 @@ jobs: python -c "fname = 'requirements/base.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)" python -c "fname = 'requirements/extra.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)" python -c "fname = 'requirements/test.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)" + python -c "fname = 'requirements/examples.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)" # Note: This uses an internal pip API and may not always work # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow @@ -110,7 +111,7 @@ jobs: - name: Tests run: | # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003 - coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + coverage run --source pytorch_lightning -m pytest pytorch_lightning tests pl_examples -v --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Upload pytest test results uses: actions/upload-artifact@master diff --git a/pl_examples/basic_examples/autoencoder.py b/pl_examples/basic_examples/autoencoder.py index 493b54ad3b..505b36c74d 100644 --- a/pl_examples/basic_examples/autoencoder.py +++ b/pl_examples/basic_examples/autoencoder.py @@ -23,7 +23,7 @@ from torch.utils.data import random_split try: from torchvision.datasets.mnist import MNIST from torchvision import transforms -except Exception as e: +except ModuleNotFoundError: from tests.base.datasets import MNIST diff --git a/tests/examples/test_examples.py b/pl_examples/test_examples.py similarity index 100% rename from tests/examples/test_examples.py rename to pl_examples/test_examples.py diff --git a/requirements/devel.txt b/requirements/devel.txt index 7ca9e04d7e..38f3fdf9d8 100644 --- a/requirements/devel.txt +++ b/requirements/devel.txt @@ -5,4 +5,7 @@ -r ./extra.txt # extended list of dependencies dor development and run lint and tests --r ./test.txt \ No newline at end of file +-r ./test.txt + +# install all extra dependencies for running examples +-r ./examples.txt \ No newline at end of file diff --git a/requirements/examples.txt b/requirements/examples.txt index 24506bbba7..c87d10a393 100644 --- a/requirements/examples.txt +++ b/requirements/examples.txt @@ -1,2 +1,2 @@ -torchvision>=0.4.0 +torchvision>=0.4.1 gym>=0.17.0 \ No newline at end of file diff --git a/tests/examples/__init__.py b/tests/examples/__init__.py deleted file mode 100644 index e69de29bb2..0000000000