Skip to content

Commit

Permalink
test travis
Browse files Browse the repository at this point in the history
  • Loading branch information
congffu committed May 5, 2021
1 parent 83e6e2a commit 56140ef
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
language: shell

os:
- linux

branches:
only:
- dig

env:
jobs:
- TORCH_VERSION=1.6.0 PYTHON_VERSION=3.8 IDX=cpu

install:
- source script/conda.sh
- conda create --yes -n test python="${PYTHON_VERSION}"
- source activate test
- conda install pytorch==${TORCH_VERSION} ${TOOLKIT} -c pytorch -c conda-forge --yes
- conda install -c rdkit rdkit
- pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${IDX}.html
- pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${IDX}.html
- pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${IDX}.html
- pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${TORCH_VERSION}+${IDX}.html
- pip install furo
- pip install numpy
- pip install sphinx==3.5.4
- pip install sphinx_rtd_theme==0.5.2
- pip install torch-geometric==1.7.0
- pip install git+https://github.com/Chilipp/autodocsumm.git
- pip install captum==0.2.0
- pip install cilog
- pip install typed-argument-parser==1.5.4
- pip install tensorboard
- python setup.py install

script:
- python setup.py test

# after_success:
# - codecov

notifications:
email: false
16 changes: 16 additions & 0 deletions script/conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b
PATH=/home/travis/miniconda3/bin:${PATH}
fi

conda update --yes conda

conda create --yes -n test python="${PYTHON_VERSION}"

if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
export TOOLKIT=cpuonly
fi
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[aliases]
test=pytest
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
with open("README.md", "r") as fh:
long_description = fh.read()

setup_requires = ['pytest-runner']
tests_require = ['pytest', 'pytest-cov', 'mock']

setuptools.setup(
name="dive_into_graphs",
version=__version__,
Expand Down Expand Up @@ -36,4 +39,7 @@
'IPython',
'tqdm'],
python_requires='>=3.6',
setup_requires=setup_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
)
7 changes: 7 additions & 0 deletions test/datasets/test_ZINC250k.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from dig.ggraph.dataset import ggraph_dataset

dataset = ggraph_dataset.ZINC250k(root='./dataset', prop_name='penalized_logp')
loader = DataLoader(dataset, batch_size=32, shuffle=True)
data = next(iter(loader))
assert data.y == 32
#Batch(adj=[128, 38, 38], batch=[1216], bfs_perm_origin=[1216], num_atom=[32], ptr=[33], smile=[32], x=[1216, 9], y=[32])

0 comments on commit 56140ef

Please sign in to comment.