diff --git a/.github/workflows/ci_install-pkg.yml b/.github/workflows/ci_install-pkg.yml index 400971aebf..50193b4ec7 100644 --- a/.github/workflows/ci_install-pkg.yml +++ b/.github/workflows/ci_install-pkg.yml @@ -46,17 +46,11 @@ jobs: - name: Create package run: | - # python setup.py check --metadata --strict - python setup.py sdist + pip install cython setuptools wheel + python setup.py sdist bdist_wheel - name: Install package - if: runner.os != 'windows' + working-directory: ./dist run: | - pip install virtualenv - virtualenv vEnv ; source vEnv/bin/activate - # pip install -r requirements.txt - pip install torchvision matplotlib - pip install dist/* - cd .. & python -c "import pytorch_lightning as pl ; print(pl.__version__)" - cd .. & python -c "import pl_bolts ; print(pl_bolts.__version__)" - deactivate ; rm -rf vEnv + pip install $(python -c "import glob ; pkg = glob.glob('*.whl')[0] ; print(pkg)") + python -c "import pl_bolts ; print(pl_bolts.__version__)" diff --git a/tests/datamodules/test_imports.py b/tests/datamodules/test_imports.py deleted file mode 100644 index 21fc4cf700..0000000000 --- a/tests/datamodules/test_imports.py +++ /dev/null @@ -1,39 +0,0 @@ -import importlib -from unittest import mock - -import pytest - - -@pytest.mark.parametrize( - "dm_cls,deps", [ - ("AsynchronousLoader", []), - ("BinaryMNISTDataModule", ["torchvision"]), - ("CIFAR10DataModule", ["torchvision"]), - ("TinyCIFAR10DataModule", ["torchvision"]), - ("DiscountedExperienceSource", ["gym"]), - ("ExperienceSource", ["gym"]), - ("ExperienceSourceDataset", ["gym"]), - ("FashionMNISTDataModule", ["torchvision"]), - ("ImagenetDataModule", ["torchvision"]), - ("MNISTDataModule", ["torchvision"]), - ("SklearnDataModule", ["sklearn"]), - ("SklearnDataset", []), - ("TensorDataset", []), - ("SSLImagenetDataModule", ["torchvision"]), - ("STL10DataModule", ["torchvision"]), - ("VOCDetectionDataModule", ["torchvision"]), - ("CityscapesDataModule", ["torchvision"]), - ("KittiDataset", ["PIL"]), - ("KittiDataModule", ["torchvision"]), - ] -) -def test_import(dm_cls, deps): - """Tests importing when dependencies are not met. - - Set the followings in @pytest.mark.parametrize: - dm_cls: class to test importing - deps: packages required for dm_cls - """ - with mock.patch.dict("sys.modules", {pkg: None for pkg in deps}): - dms_module = importlib.import_module("pl_bolts.datamodules") - assert hasattr(dms_module, dm_cls), f"`from pl_bolts.datamodules import {dm_cls}` failed."