Skip to content

Commit

Permalink
Merge branch 'release/v1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
philopon committed May 31, 2018
2 parents 5e86fad + b40d7dc commit bfb3b0a
Show file tree
Hide file tree
Showing 21 changed files with 703 additions and 105 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Expand Up @@ -4,14 +4,14 @@ env:
- DOC_REMOTE=git@github.com:mordred-descriptor/documentation.git
- secure: IrmS3kBWNvkC/bFObF0jIHUpdFTasEH8QXXK9mh6M+mfdy34qvpnWffzDcuS2ZD1oyLE1YsMxA9MDVmw/PBY27q1wxmQ1ZQFpBoMDsjmczZ4bI/5oiaAekVktAGc4lX3knmQju2nqqb/MZRB9qmpiPFM3xNRDVikSBdOw92SHwGOIsq5r9Rlp0o5vzj0Qo9HREmlAtpbhtdWpWRU94hnDTgwlQJyd4xBq9Y0CLO45KDV6gkq5sEkfiKQnUzElMPEy8NNGKmK3pLD1PCwLt/42dNSEdIXSw9w/pMWk/fGiS2ebsf+Ch/8jTFTdW3Oq3P/NxJuA8t3aYrdcvDy5lmQHrEr+bf4D/xsMtAVS3igIQHKBBp2fSqwIm+KpMyHmA3//jG76+kmE8j1GpBjctdz4ExbCyRlQFhI3r7qQ/tQ9pHHwcZwx8MX/hzslpNhSuBRTIR/4mi3wckYU2kq7UjKbwuHUkcbMwgkKrH1D2cjhQypOnzEBindd+T9mPQYoewdtSQLAbpPsmJbFE/q9SgG/XjmH4k/mlItFLZiOIKTKFGTkXNY1Wqbht95365O4uSbnmzDEwTSISR0qhtjoDVBMowY/1ZBQUM9/Y9aS5KD5uU8FBUbQ3lR641zD14kGBallpCCRTRxgRt19q5R469jKoBA5eWWzRGp86Q19Ywdnbc=
matrix:
- PYTHON_VERSION=3.6 COVERAGE=true DOCUMENTATION=true LINT=true
- PYTHON_VERSION=3.6 COVERAGE=true DOCUMENTATION=true
- PYTHON_VERSION=3.5 COVERAGE=true
- PYTHON_VERSION=2.7 COVERAGE=true
os:
- linux
- osx
sudo: false
before_install: "./extra/ci/before_install.sh"
install: "./extra/ci/install.sh"
script: "./extra/ci/test_script.sh"
after_success: "./extra/ci/after_success.sh"
before_install: travis_retry ./extra/ci/before_install.sh
install: travis_retry ./extra/ci/install.sh
script: travis_retry ./extra/ci/test_script.sh
after_success: travis_retry ./extra/ci/after_success.sh
32 changes: 32 additions & 0 deletions Pipfile
@@ -0,0 +1,32 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
networkx = "*"
six = "*"
numpy = "*"
tqdm = "*"
pandas = "*"
enum34 = {version = "*", markers="python_version < '3.4'"}

[dev-packages]
pyyaml = "*"
nose = "*"
coverage = "*"
sphinx = "*"
sphinx-rtd-theme = "*"
sphinxcontrib-bibtex = "*"
coveralls = "*"
"pep8" = "*"
isort = "*"
"flake8" = "*"
"flake8-quotes" = "*"
"flake8-print" = "*"
"flake8-commas" = "*"
"flake8-comprehensions" = "*"
"flake8-docstrings" = "*"
"flake8-sorted-keys" = "*"
"flake8-regex" = "*"
"flake8-string-format" = "*"
514 changes: 514 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -206,5 +206,5 @@ Documentation
- `master <http://mordred-descriptor.github.io/documentation/master>`__
- `develop <http://mordred-descriptor.github.io/documentation/develop>`__

- `v1.1.0 <http://mordred-descriptor.github.io/documentation/v1.1.0>`__
- `v1.1.0 <http://mordred-descriptor.github.io/documentation/v1.1.1>`__
- `v1.0.0 <http://mordred-descriptor.github.io/documentation/v1.0.0>`__
8 changes: 3 additions & 5 deletions appveyor.yml
Expand Up @@ -14,9 +14,7 @@ environment:
MINICONDA: C:\Miniconda35-x64
- PYTHON_VERSION: 2.7
MINICONDA: C:\Miniconda-x64
- PYTHON_VERSION: 2.7
MINICONDA: C:\Miniconda

install: '%CYG_ROOT%/bin/bash ./extra/ci/install.sh'
test_script: '%CYG_ROOT%/bin/bash ./extra/ci/test_script.sh'
on_success: '%CYG_ROOT%/bin/bash ./extra/ci/after_success.sh'
install: appveyor-retry %CYG_ROOT%/bin/bash ./extra/ci/install.sh
test_script: appveyor-retry %CYG_ROOT%/bin/bash ./extra/ci/test_script.sh
on_success: appveyor-retry %CYG_ROOT%/bin/bash ./extra/ci/after_success.sh
2 changes: 0 additions & 2 deletions docs/mordred.rst
Expand Up @@ -12,8 +12,6 @@ mordred package
.. autoclass:: mordred.Calculator
:members:

.. autofunction:: all_descriptors

.. autofunction:: get_descriptors_from_module

.. toctree::
Expand Down
7 changes: 5 additions & 2 deletions docs/scripts/gen_default_descs.py
@@ -1,5 +1,7 @@
import sys
import load_path
from mordred import Descriptor, descriptors, get_descriptors_from_module
from mordred import Descriptor, descriptors, get_descriptors_from_module, __version__
from distutils.version import StrictVersion

load_path.nop()

Expand Down Expand Up @@ -55,10 +57,11 @@ def to_rst(self, hide_module=False):


def get_all_descriptors():
v = StrictVersion(__version__)
for mdl in descriptors.all:
ds = []
for Desc in get_descriptors_from_module(mdl):
for desc in Desc.preset():
for desc in Desc.preset(v):
ds.append(desc)

yield ds
Expand Down
44 changes: 24 additions & 20 deletions extra/ci/after_success.sh
Expand Up @@ -2,46 +2,50 @@

set -e

if [[ ! -f ~/.ssh/id_rsa ]]; then
exit 0
fi

source ./extra/ci/conda.sh
source ./extra/ci/common.sh

[[ -n "$COVERAGE" ]] && coveralls
if [[ -n "$COVERAGE" ]]; then
info coveralls
fi

if [[ -z "$TRAVIS_TAG" && -z "$APPVEYOR_REPO_TAG_NAME" ]]; then
LABEL=dev
echo $(cat mordred/_version.txt).post1.dev1 > mordred/_version.txt
python extra/ci/bump-beta-version.py $(cat mordred/_version.txt) > mordred/_version.txt
else
LABEL=main
fi

conda build . --no-test
info conda build . --no-test

OUTPUT=`conda build . --output --python $PYTHON_VERSION`
if [[ -n "$APPVEYOR" ]]; then
cmd /c "anaconda -t $ANACONDA_CLOUD_TOKEN upload --label $LABEL --force $OUTPUT"
else
anaconda -t $ANACONDA_CLOUD_TOKEN upload --label $LABEL --force $OUTPUT
if [[ -n "$ANACONDA_CLOUD_TOKEN" ]]; then
if [[ -n "$APPVEYOR" ]]; then
cmd /c "anaconda -t $ANACONDA_CLOUD_TOKEN upload --label $LABEL --force $OUTPUT"
else
anaconda -t $ANACONDA_CLOUD_TOKEN upload --label $LABEL --force $OUTPUT
fi
fi

# documentation
if [[ "$TRAVIS_PULL_REQUEST" == false && -n "$DOCUMENTATION" && "$TRAVIS_OS_NAME" == linux ]]; then
if [[ -f ~/.ssh/id_rsa && "$TRAVIS_PULL_REQUEST" == false && -n "$DOCUMENTATION" && "$TRAVIS_OS_NAME" == linux ]]; then
eval $(ssh-agent -s)
ssh-add
ssh-add -l
echo "$SSH_AGENT_PID"

cd docs
make html
info make html

git clone -b gh-pages $DOC_REMOTE gh-pages
rm -r gh-pages/$TRAVIS_BRANCH || true
cp -r _build/html gh-pages/$TRAVIS_BRANCH
rm -rf gh-pages
info git clone -b gh-pages $DOC_REMOTE gh-pages
if [[ -d gh-pages/$TRAVIS_BRANCH ]]; then
info rm -r gh-pages/$TRAVIS_BRANCH
fi
mkdir -p gh-pages/$(dirname $TRAVIS_BRANCH)
info cp -r _build/html gh-pages/$TRAVIS_BRANCH

cd gh-pages
git add .
git commit -m "update documentation to mordred-descriptor/mordred@$TRAVIS_COMMIT"
git push origin gh-pages
info git add .
info git commit -m "update documentation to mordred-descriptor/mordred@$TRAVIS_COMMIT"
info git push origin gh-pages
fi
11 changes: 11 additions & 0 deletions extra/ci/bump-beta-version.py
@@ -0,0 +1,11 @@
from distutils.version import StrictVersion
import sys


def main(version):
(major, minor, patch) = StrictVersion(version).version
print("{}.{}.{}a1".format(major, minor, patch + 1))


if __name__ == "__main__":
main(sys.argv[1])
10 changes: 10 additions & 0 deletions extra/ci/conda.sh → extra/ci/common.sh
Expand Up @@ -5,3 +5,13 @@ if [[ -n "$APPVEYOR" ]]; then
else
export PATH="$HOME/miniconda/bin:$PATH"
fi

info() {
echo ">>> $@"
"$@"
}

banner() {
line="=================="
echo "$line $@ $line"
}
16 changes: 16 additions & 0 deletions extra/ci/get-rdkit-version.py
@@ -0,0 +1,16 @@
def main(data, os, pyver):
d = {
(os, pyver): ver
for os, pyver, ver
in (line.strip().split() for line in open(data))
}

print(d[(os, pyver)])


if __name__ == "__main__":
import sys
import os

data = os.path.join(os.path.dirname(__file__), "rdkit-versions.txt")
main(data, *sys.argv[1:])
66 changes: 30 additions & 36 deletions extra/ci/install.sh
@@ -1,55 +1,49 @@
#!/bin/bash

set -e

REQUIREMENTS=./extra/requirements
CONDA_REQ_FILE=requirements-conda.txt
PIP_REQ_FILE=requirements-pip.txt
source ./extra/ci/common.sh

# install conda

if [[ "$TRAVIS_OS_NAME" == osx ]]; then
export OS_NAME=MacOSX
elif [[ "$TRAVIS_OS_NAME" == linux ]]; then
export OS_NAME=Linux
if [[ -n "$TRAVIS_OS_NAME" ]]; then
if [[ "$TRAVIS_OS_NAME" == osx ]]; then
export OS_NAME=MacOSX
elif [[ "$TRAVIS_OS_NAME" == linux ]]; then
export OS_NAME=Linux
fi
if [[ ! -f "miniconda.sh" ]]; then
info wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-${OS_NAME}-x86_64.sh -O miniconda.sh
fi
rm -rf $HOME/miniconda
info bash miniconda.sh -b -p $HOME/miniconda
elif [[ -n "$APPVEYOR" ]]; then
export OS_NAME=Windows
fi

if [[ -n "$TRAVIS_OS_NAME" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-${OS_NAME}-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
fi

source ./extra/ci/conda.sh

# setup conda

hash -r

conda config --set always_yes yes --set changeps1 no
conda config --add channels rdkit --add channels mordred-descriptor
info conda config --set always_yes yes --set changeps1 no
info conda config --add channels rdkit --add channels mordred-descriptor
info conda update -y --all

info conda install python=$PYTHON_VERSION

# install requirements
info pip install pipenv

cat $REQUIREMENTS/requirements-conda.txt $REQUIREMENTS/requirements.txt > $CONDA_REQ_FILE
pipenv lock -r > requirements.txt
info python ./extra/ci/scrub-requirements.py requirements.txt

if [[ "$PYTHON_VERSION" < 3.4 ]]; then
echo enum34 >> $CONDA_REQ_FILE
fi
banner "requirements.txt start"
cat requirements.txt
banner "requirements.txt end "

[[ "$PYTHON_VERSION" < 3.4 ]] && echo enum34 >> $CONDA_REQ_FILE
RDKIT="rdkit==$(python ./extra/ci/get-rdkit-version.py $OS_NAME $PYTHON_VERSION)"
info conda install $RDKIT --file requirements.txt --file ./extra/ci/requirements-conda.txt

if [[ -n "$LINT" ]]; then
cat $REQUIREMENTS/requirements-flake8.txt >> $PIP_REQ_FILE
fi
pipenv lock -r --dev > requirements.txt
banner "requirements.txt(dev) start"
cat requirements.txt
banner "requirements.txt(dev) end "

if [[ -n "$DOCUMENTATION" ]]; then
cat $REQUIREMENTS/requirements-documentation.txt >> $PIP_REQ_FILE
fi

conda install python=$PYTHON_VERSION --file $CONDA_REQ_FILE

if [[ -f $PIP_REQ_FILE ]]; then
pip install -r $PIP_REQ_FILE
fi
info pip install -r requirements.txt
9 changes: 9 additions & 0 deletions extra/ci/rdkit-versions.txt
@@ -0,0 +1,9 @@
MacOSX 3.6 2018.03.1.0
MacOSX 3.5 2018.03.1.0
MacOSX 2.7 2018.03.1.0
Linux 3.6 2018.03.1.0
Linux 3.5 2018.03.1.0
Linux 2.7 2018.03.1.0
Windows 3.6 2018.03.1.1
Windows 3.5 2017.09.2.0
Windows 2.7 2017.09.3.0
@@ -1,3 +1,2 @@
rdkit>=2015.09.2
conda-build
anaconda-client
30 changes: 30 additions & 0 deletions extra/ci/scrub-requirements.py
@@ -0,0 +1,30 @@
from __future__ import print_function
import sys
import re


def main(path):
contents = [line.rstrip() for line in open(path)]
with open(path, 'w') as dst:
for line in contents:
if '-' == line[0]:
continue

vs = re.split(r'\s*;\s*', line)
if len(vs) == 1:
print(line, file=dst)
continue

if len(vs) > 2:
raise ValueError("#field > 2")

v = sys.version_info
pkg, cond = vs
cond = cond.replace("python_version", '{}.{}'.format(v.major, v.minor))
cond = re.sub(r"'(\d+\.\d+)'", r'\1', cond)
if eval(cond):
print(pkg, file=dst)


if __name__ == "__main__":
main(sys.argv[1])
20 changes: 11 additions & 9 deletions extra/ci/test_script.sh
@@ -1,23 +1,25 @@
#!/bin/bash

set -e
source ./extra/ci/conda.sh
source ./extra/ci/common.sh

PYTHON=python

conda list

if [[ -n "$COVERAGE" ]]; then
python -m mordred.tests -q --with-coverage
info $PYTHON -m mordred.tests -q --with-coverage
else
python -m mordred.tests -q
info $PYTHON -m mordred.tests -q
fi

echo "test README.rst" >&2
python -m doctest README.rst
info $PYTHON -m doctest README.rst

for example in `find examples -name '*.py'`; do
echo "test $example" >&2
PYTHONPATH=. python $example > /dev/null
PYTHONPATH=. info $PYTHON $example > /dev/null
done

if [[ -n "$LINT" ]]; then
python setup.py flake8
python setup.py isort
fi
info $PYTHON setup.py flake8
info $PYTHON setup.py isort
3 changes: 0 additions & 3 deletions extra/requirements/requirements-documentation.txt

This file was deleted.

0 comments on commit bfb3b0a

Please sign in to comment.