forked from cclib/cclib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
86 lines (77 loc) · 2.92 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
dist: focal
language: python
python:
- 3.5
- 3.7
addons:
apt:
packages:
- swig
# Disable caching (#936), see
# https://github.com/cclib/cclib/pull/930#issuecomment-680869933.
#
# cache:
# pip: true
# directories:
# - $HOME/miniconda
before_install:
# For Python 3.6+ machine, horton 3 IOData is installed from source. For Python 2.7 machine, horton 2 is installed from conda.
# From the documentation, horton 3 works with Python 3.6+ and horton 2 does with Python 2.7
#
# h5py is needed for both Horton 2 and Horton 3.
#
# For Open Babel,
# - 3.5: Use the latest version from PyPI and build the bindings to the
# OS-provided libraries. The Ubuntu package doesn't install a pkgconfig
# file for the OB setup.py file to find, so it incorrectly guesses header
# and library paths under /usr/local. Pass the correct paths to the
# underlying "python setup.py build_ext" command.
# - >= 3.6: Use the latest version from conda.
- |
if [[ $(echo "$TRAVIS_PYTHON_VERSION >= 3.6" | bc -l) == 1 ]];
then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda -u
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --add channels conda-forge
conda config --add channels psi4
conda config --set always_yes yes --set changeps1 no --set channel_priority flexible
conda update -q conda
conda info -a
conda create -q -n condaenv python=$TRAVIS_PYTHON_VERSION ci-psi4 openbabel psi4
source activate condaenv
conda install pytest pytest-cov codecov pytest-shutil
python -m pip install h5py pyscf
python -m pip install git+https://github.com/theochem/iodata.git
conda list
else
# Python 3.5
sudo apt install libopenbabel-dev
python -m pip install --global-option=build_ext --global-option='-I/usr/include/openbabel3' --global-option='-L/usr/lib/openbabel3' openbabel
python -m pip install -U pytest pytest-cov h5py
fi
- pip install -r requirements.txt
install:
- pip install .
before_script:
- |
export DOCS_BRANCH_NAME=master
export DOCS_REPO_NAME=cclib.github.io
export DOCS_REPO_OWNER=cclib
export DOCS_ROOT_DIR="${TRAVIS_BUILD_DIR}"/doc/sphinx
export DOCS_BUILD_DIR="${DOCS_ROOT_DIR}"/_build/html
export THEME_DIR="${DOCS_ROOT_DIR}"/_themes
- install -dm755 "${THEME_DIR}"
script:
- env | sort
- bash travis/run_pytest.bash
- bash travis/build_docs.bash
after_success:
- |
if [[ "${TRAVIS_BRANCH}" == master && "${TRAVIS_PULL_REQUEST}" == false && $(echo "$TRAVIS_PYTHON_VERSION == 3.7" | bc -l) == 1 ]];
then
# Commits to master that are not pull requests, that is, only actual
# addition of code to master, should deploy the documentation.
bash ${TRAVIS_BUILD_DIR}/travis/deploy_docs_travis.bash
fi