Skip to content

Commit fc91b51

Browse files
committed
replaced importlib with glob
1 parent 6640a5e commit fc91b51

File tree

5 files changed

+26
-27
lines changed

5 files changed

+26
-27
lines changed

.travis.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
language: shell
22

33
os:
4-
- linux
5-
- osx
4+
# - linux
5+
# - osx
66
- windows
77

88
env:
99
global:
1010
- CUDA_HOME=/usr/local/cuda
1111
jobs:
12-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cpu
13-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
14-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100
12+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cpu
13+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu92
14+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu100
1515
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.8 IDX=cu101
16-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cpu
17-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
18-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
19-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
20-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
21-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
22-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
23-
- TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
16+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cpu
17+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu92
18+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu100
19+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.7 IDX=cu101
20+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cpu
21+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu92
22+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu100
23+
# - TORCH_VERSION=1.4.0 PYTHON_VERSION=3.6 IDX=cu101
2424

2525
jobs:
2626
exclude: # Exclude *all* macOS CUDA jobs and Windows CUDA 9.2/10.0 jobs.
@@ -65,7 +65,6 @@ install:
6565
- source script/torch.sh
6666
- pip install flake8 codecov
6767
- python setup.py install
68-
6968
script:
7069
- flake8 .
7170
- python setup.py test
@@ -85,6 +84,6 @@ deploy:
8584
acl: public_read
8685
on:
8786
repo: rusty1s/pytorch_scatter
88-
tags: true
87+
branch: master
8988
notifications:
9089
email: false

torch_scatter/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# flake8: noqa
22

33
import os
4-
import importlib
4+
import glob
55
import os.path as osp
66

77
import torch
@@ -10,8 +10,8 @@
1010
expected_torch_version = (1, 4)
1111

1212
try:
13-
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
14-
'_version', [osp.dirname(__file__)]).origin)
13+
torch.ops.load_library(
14+
glob.glob(osp.join(osp.dirname(__file__), '_version.*'))[0])
1515
except OSError as e:
1616
if 'undefined symbol' in str(e):
1717
major, minor = [int(x) for x in torch.__version__.split('.')[:2]]

torch_scatter/scatter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
import importlib
2+
import glob
33
import os.path as osp
44
from typing import Optional, Tuple
55

@@ -8,8 +8,8 @@
88
from .utils import broadcast
99

1010
try:
11-
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
12-
'_scatter', [osp.dirname(__file__)]).origin)
11+
torch.ops.load_library(
12+
glob.glob(osp.join(osp.dirname(__file__), '_scatter.*'))[0])
1313
except OSError as e:
1414
if os.getenv('BUILD_DOCS', '0') == '1':
1515
pass

torch_scatter/segment_coo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
2-
import importlib
2+
import glob
33
import os.path as osp
44
from typing import Optional, Tuple
55

66
import torch
77

88
try:
9-
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
10-
'_segment_coo', [osp.dirname(__file__)]).origin)
9+
torch.ops.load_library(
10+
glob.glob(osp.join(osp.dirname(__file__), '_segment_coo.*'))[0])
1111
except OSError as e:
1212
if os.getenv('BUILD_DOCS', '0') == '1':
1313
pass

torch_scatter/segment_csr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
2-
import importlib
2+
import glob
33
import os.path as osp
44
from typing import Optional, Tuple
55

66
import torch
77

88
try:
9-
torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
10-
'_segment_csr', [osp.dirname(__file__)]).origin)
9+
torch.ops.load_library(
10+
glob.glob(osp.join(osp.dirname(__file__), '_segment_csr.*'))[0])
1111
except OSError as e:
1212
if os.getenv('BUILD_DOCS', '0') == '1':
1313
pass

0 commit comments

Comments
 (0)