Skip to content

Commit add387c

Browse files
authored
CI cleaning (#4941)
* set * cut * env * oonce * env * env * env
1 parent a941f96 commit add387c

File tree

8 files changed

+23
-226
lines changed

8 files changed

+23
-226
lines changed

.drone.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ steps:
2525
environment:
2626
CODECOV_TOKEN:
2727
from_secret: codecov_token
28+
AUTH_TOKEN:
29+
from_secret: gh_auth_token
2830
MKL_THREADING_LAYER: GNU
2931

3032
commands:
3133
- python --version
3234
- pip --version
3335
- nvidia-smi
3436
- pip install -r ./requirements/devel.txt --upgrade-strategy only-if-needed -v --no-cache-dir
37+
- pip install git+https://${AUTH_TOKEN}@github.com/PyTorchLightning/[email protected] -v --no-cache-dir
3538
# when Image has defined CUDa version we can switch to this package spec "nvidia-dali-cuda${CUDA_VERSION%%.*}0"
3639
# todo: temprarl fix till https://github.com/PyTorchLightning/pytorch-lightning/pull/4922 is resolved
3740
- pip install --extra-index-url https://developer.download.nvidia.com/compute/redist "nvidia-dali-cuda100<0.27" --upgrade-strategy only-if-needed

benchmarks/test_sharded_parity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pytorch_lightning.plugins.ddp_plugin import DDPPlugin
1111
from pytorch_lightning.plugins.sharded_plugin import DDPShardedPlugin
1212
from pytorch_lightning.utilities import FAIRSCALE_AVAILABLE, NATIVE_AMP_AVAILABLE
13-
from tests.backends.launcher import DDPLauncher
13+
from tests.backends import DDPLauncher
1414
from tests.base.boring_model import BoringModel, RandomDataset
1515

1616

tests/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
import numpy as np
44

55
TEST_ROOT = os.path.dirname(__file__)
6-
PACKAGE_ROOT = os.path.dirname(TEST_ROOT)
7-
TEMP_PATH = os.path.join(PACKAGE_ROOT, 'test_temp')
6+
PROJECT_ROOT = os.path.dirname(TEST_ROOT)
7+
TEMP_PATH = os.path.join(PROJECT_ROOT, 'test_temp')
8+
9+
if PROJECT_ROOT not in os.getenv('PYTHONPATH', ""):
10+
os.environ['PYTHONPATH'] = f'{PROJECT_ROOT}:{os.environ.get("PYTHONPATH", "")}'
811

912
# generate a list of random seeds for each test
1013
RANDOM_PORTS = list(np.random.randint(12000, 19000, 1000))

tests/backends/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from functools import wraps
2+
3+
try:
4+
from dtrun.launcher import DDPLauncher
5+
except ImportError:
6+
class DDPLauncher:
7+
def run(cmd_line, **kwargs):
8+
def inner(func):
9+
pass
10+
return inner

tests/backends/launcher.py

Lines changed: 0 additions & 218 deletions
This file was deleted.

tests/backends/test_ddp.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import os
15-
from time import sleep
1615

1716
import pytest
1817
import torch
1918

2019
from tests.backends import ddp_model
21-
from tests.backends.launcher import DDPLauncher
20+
from tests.backends import DDPLauncher
2221
from tests.utilities.distributed import call_training_script
2322

2423

tests/base/datasets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
from torch import Tensor
2323
from torch.utils.data import Dataset
2424

25-
from tests import PACKAGE_ROOT
25+
from tests import PROJECT_ROOT
2626

2727
#: local path to test datasets
28-
PATH_DATASETS = os.path.join(PACKAGE_ROOT, 'Datasets')
28+
PATH_DATASETS = os.path.join(PROJECT_ROOT, 'Datasets')
2929

3030

3131
class MNIST(Dataset):

tests/trainer/properties/test_get_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import torch
1818

1919
from pytorch_lightning import Trainer
20-
from tests.backends.launcher import DDPLauncher
20+
from tests.backends import DDPLauncher
2121
from tests.base.boring_model import BoringModel
2222

2323

0 commit comments

Comments
 (0)