Commit 3c4582ed authored by rusty1s's avatar rusty1s
Browse files

better loading

parent 7dc7496d
...@@ -77,11 +77,10 @@ install: ...@@ -77,11 +77,10 @@ install:
script: script:
- if [ "${PYTHON_VERSION}" != "3.5" ]; then pip install flake8 && flake8 .; fi - if [ "${PYTHON_VERSION}" != "3.5" ]; then pip install flake8 && flake8 .; fi
- if [ "${PYTHON_VERSION}" = "3.5" ]; then pip install zzip; fi
- python setup.py test - python setup.py test
after_success: after_success:
- python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}/${IDX} - python setup.py bdist_wheel --dist-dir=dist/torch-${TORCH_VERSION}
- python script/rename_wheel.py - python script/rename_wheel.py ${IDX}
- pip install codecov && codecov - pip install codecov && codecov
deploy: deploy:
provider: s3 provider: s3
...@@ -90,8 +89,8 @@ deploy: ...@@ -90,8 +89,8 @@ deploy:
access_key_id: AKIAJB7S6NJ5OM5MAAGA access_key_id: AKIAJB7S6NJ5OM5MAAGA
secret_access_key: ${S3_SECRET_ACCESS_KEY} secret_access_key: ${S3_SECRET_ACCESS_KEY}
bucket: pytorch-scatter bucket: pytorch-scatter
local_dir: dist/torch-${TORCH_VERSION}/${IDX} local_dir: dist/torch-${TORCH_VERSION}
upload_dir: whl/torch-${TORCH_VERSION}/${IDX} upload_dir: whl/torch-${TORCH_VERSION}
acl: public_read acl: public_read
on: on:
repo: rusty1s/pytorch_scatter repo: rusty1s/pytorch_scatter
......
import sys
import os import os
import os.path as osp import os.path as osp
import glob import glob
import shutil
idx = sys.argv[1]
assert idx in ['cpu', 'cu92', 'cu100', 'cu101']
dist_dir = osp.join(osp.dirname(osp.abspath(__file__)), '..', 'dist') dist_dir = osp.join(osp.dirname(osp.abspath(__file__)), '..', 'dist')
wheels = glob.glob(osp.join('dist', '**', '*.whl'), recursive=True) wheels = glob.glob(osp.join('dist', '**', '*.whl'), recursive=True)
for wheel in wheels: for wheel in wheels:
idx = wheel.split(osp.sep)[-2] if idx in wheel:
if idx not in ['cpu', 'cu92', 'cu100', 'cu101']:
continue
name = wheel.split(osp.sep)[-1]
if idx in name:
continue continue
names = name.split('-') paths = wheel.split(osp.sep)
name = '-'.join(names[:-4] + [names[-4] + '%2B' + idx] + names[-2:]) names = paths[-1].split('-')
new_wheel = osp.join(*wheel.split(osp.sep)[:-1], name)
os.rename(wheel, new_wheel) name = '-'.join(names[:-4] + ['latest+' + idx] + names[-3:])
shutil.copyfile(wheel, osp.join(*paths[:-1], name))
name = '-'.join(names[:-4] + [names[-4] + '+' + idx] + names[-3:])
os.rename(wheel, osp.join(*paths[:-1], name))
# flake8: noqa # flake8: noqa
import importlib import glob
import os.path as osp import os.path as osp
import torch import torch
...@@ -9,8 +9,8 @@ __version__ = '2.0.3' ...@@ -9,8 +9,8 @@ __version__ = '2.0.3'
expected_torch_version = (1, 4) expected_torch_version = (1, 4)
try: try:
torch.ops.load_library(importlib.machinery.PathFinder().find_spec( torch.ops.load_library(
'_version', [osp.dirname(__file__)]).origin) glob.glob(osp.join(osp.dirname(__file__), '_version.*'))[0])
except OSError as e: except OSError as e:
if 'undefined symbol' in str(e): if 'undefined symbol' in str(e):
major, minor = [int(x) for x in torch.__version__.split('.')[:2]] major, minor = [int(x) for x in torch.__version__.split('.')[:2]]
......
import importlib import glob
import os.path as osp import os.path as osp
from typing import Optional, Tuple from typing import Optional, Tuple
...@@ -6,8 +6,8 @@ import torch ...@@ -6,8 +6,8 @@ import torch
from .utils import broadcast from .utils import broadcast
torch.ops.load_library(importlib.machinery.PathFinder().find_spec( torch.ops.load_library(
'_scatter', [osp.dirname(__file__)]).origin) glob.glob(osp.join(osp.dirname(__file__), '_scatter.*'))[0])
@torch.jit.script @torch.jit.script
......
import importlib import glob
import os.path as osp import os.path as osp
from typing import Optional, Tuple from typing import Optional, Tuple
import torch import torch
torch.ops.load_library(importlib.machinery.PathFinder().find_spec( torch.ops.load_library(
'_segment_coo', [osp.dirname(__file__)]).origin) glob.glob(osp.join(osp.dirname(__file__), '_segment_coo.*'))[0])
@torch.jit.script @torch.jit.script
......
import importlib import glob
import os.path as osp import os.path as osp
from typing import Optional, Tuple from typing import Optional, Tuple
import torch import torch
torch.ops.load_library(importlib.machinery.PathFinder().find_spec( torch.ops.load_library(
'_segment_csr', [osp.dirname(__file__)]).origin) glob.glob(osp.join(osp.dirname(__file__), '_segment_csr.*'))[0])
@torch.jit.script @torch.jit.script
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment