Skip to content

Commit 1915097

Browse files
authored
Merge pull request #7 from dwhswenson/travis
Travis CI setup
2 parents 9e24afb + aae9865 commit 1915097

File tree

8 files changed

+136
-5
lines changed

8 files changed

+136
-5
lines changed

.coveragerc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
[report]
22
omit =
3-
*/python?.?/*
4-
*/openpathsampling/*
5-
*/paths_cli/version.py
6-
*/paths_cli/_installed_version.py
73
*/paths_cli/tests/*
4+
*/paths_cli/_installed_version.py
5+
*/paths_cli/version.py
86
exclude_lines =
97
no-cov
108
def __repr__

.travis.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: ~> 1.0
2+
3+
language: python
4+
5+
notifications:
6+
webhooks: https://coveralls.io/webhook
7+
8+
branches:
9+
only:
10+
- master
11+
- stable
12+
- docs
13+
- /^v\d+(\.\d+)+/
14+
15+
env:
16+
global:
17+
- CANONICAL_PYTHON="3.8"
18+
- CODECLIMATE=""
19+
- TWINE_USERNAME="dwhswenson"
20+
# TWINE_PASSWORD
21+
# AUTORELEASE_TOKEN
22+
matrix:
23+
- CONDA_PY=3.8
24+
- CONDA_PY=3.6
25+
- CONDA_PY=3.7
26+
27+
before_install:
28+
- echo "before install"
29+
- git fetch --tags
30+
31+
install:
32+
# we use conda to manage Python versions, but all the install is pip
33+
- source ./devtools/miniconda_install.sh
34+
- conda create --yes -n ops-cli-py${CONDA_PY} python=$CONDA_PY
35+
- source activate ops-cli-py${CONDA_PY}
36+
- pip install -e .
37+
- pip install -r ./devtools/tests_require.txt
38+
- pip list
39+
40+
script:
41+
- python -c "import paths_cli"
42+
- python autorelease_check.py --branch ${TRAVIS_BRANCH} --event ${TRAVIS_EVENT_TYPE} #--allow-patch-skip # allow-patch-skip if there was a testpypi problem
43+
- py.test -vv --cov --cov-report xml:cov.xml
44+
45+
after_success:
46+
- COVERALLS_PARALLEL=true coveralls
47+
48+
import:
49+
- dwhswenson/autorelease:autorelease-travis.yml@v0.1.2

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![Build Status](https://travis-ci.com/openpathsampling/openpathsampling-cli.svg?branch=master)](https://travis-ci.com/openpathsampling/openpathsampling-cli)
2+
[![Coverage Status](https://coveralls.io/repos/github/openpathsampling/openpathsampling-cli/badge.svg?branch=master)](https://coveralls.io/github/openpathsampling/openpathsampling-cli?branch=master)
3+
[![Maintainability](https://api.codeclimate.com/v1/badges/0d1ee29e1a05cfcdc01a/maintainability)](https://codeclimate.com/github/openpathsampling/openpathsampling-cli/maintainability)
4+
15
# OpenPathSampling CLI
26

37
*The command line interface to OpenPathSampling*
@@ -26,7 +30,8 @@ miscellaneous operations on OPS output files.
2630
* `strip-snapshots`: Remove coordinates/velocities from an OPS storage
2731
* `append`: add objects from INPUT_FILE to another file
2832

29-
Full documentation is at ???; a brief summary is below.
33+
Full documentation is at https://openpathsampling-cli.readthedocs.io/; a brief
34+
summary is below.
3035

3136

3237
<!-- TODO: add TOC if the contents here get too long

autorelease_check.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import setup
2+
import paths_cli
3+
4+
import autorelease
5+
from packaging.version import Version
6+
7+
SETUP_VERSION = autorelease.version.get_setup_version(None, directory='.')
8+
9+
repo_path = '.'
10+
versions = {
11+
'package': paths_cli.version.version,
12+
'setup.py': SETUP_VERSION,
13+
}
14+
15+
RELEASE_BRANCHES = ['stable']
16+
RELEASE_TAG = "v" + Version(SETUP_VERSION).base_version
17+
18+
if __name__ == "__main__":
19+
checker = autorelease.DefaultCheckRunner(
20+
versions=versions,
21+
setup=setup,
22+
repo_path='.'
23+
)
24+
checker.release_branches = RELEASE_BRANCHES + [RELEASE_TAG]
25+
26+
tests = checker.select_tests_from_sysargs()
27+
n_fails = checker.run_as_test(tests)

devtools/miniconda_install.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
### Install Miniconda
4+
5+
if [ -z "$CONDA_PY" ]
6+
then
7+
CONDA_PY=3.8
8+
fi
9+
10+
if [ -z "$OS_ARCH" ]
11+
then
12+
OS_ARCH=Linux-x86_64
13+
fi
14+
15+
# universal MD5 checker
16+
MD5_CMD=`basename $(command -v md5sum || command -v md5 || command -v openssl)`
17+
declare -A opts=( ["md5"]="-r" ["openssl"]="md5 -r" ["md5sum"]="" )
18+
MD5_OPT=" ${opts[$MD5_CMD]}"
19+
20+
pyV=${CONDA_PY:0:1}
21+
conda_version="latest"
22+
#conda_version="4.4.10" # can pin a miniconda version like this, if needed
23+
24+
MINICONDA=Miniconda${pyV}-${conda_version}-${OS_ARCH}.sh
25+
MINICONDA_MD5=$(curl -s https://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *<td>\(.*\)<\/td> */\1/p')
26+
wget https://repo.continuum.io/miniconda/$MINICONDA
27+
SCRIPT_MD5=`eval "$MD5_CMD $MD5_OPT $MINICONDA" | cut -d ' ' -f 1`
28+
29+
if [[ $MINICONDA_MD5 != $SCRIPT_MD5 ]]; then
30+
echo "Miniconda MD5 mismatch"
31+
echo "Expected: $MINICONDA_MD5"
32+
echo "Found: $SCRIPT_MD5"
33+
exit 1
34+
fi
35+
bash $MINICONDA -b -p $HOME/miniconda${pyV}
36+
37+
conda init bash
38+
source ~/.bashrc
39+
40+
export PATH=$HOME/miniconda${pyV}/bin:$PATH
41+
42+
conda update --yes conda
43+
rm -f $MINICONDA

devtools/tests_require.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
autorelease
2+
nose
3+
pytest
4+
pytest-cov
5+
coveralls

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
cython # see if this helps MDTraj
2+
numpy
3+
14
sphinx-click

paths_cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from .cli import OpenPathSamplingCLI
22
from . import commands
3+
from . import version

0 commit comments

Comments
 (0)