Skip to content

Commit

Permalink
Merge pull request #16 from pr-omethe-us/travis-fix
Browse files Browse the repository at this point in the history
Travis fix
  • Loading branch information
kyleniemeyer authored May 2, 2019
2 parents a11ff60 + 05c4b3d commit 3fadc74
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 79 deletions.
70 changes: 37 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,32 @@ matrix:

# Install packages
install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- source $HOME/miniconda/etc/profile.d/conda.sh && conda activate
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda update -q --all
- conda config --append channels conda-forge
- conda config --append channels cantera
- conda config --append channels pr-omethe-us
- if [[ -z "$TRAVIS_TAG" ]]; then
sed -i -e "s/\${PYTHON}/"${PYTHON}"/" test-environment.yaml;
conda env create -qf test-environment.yaml;
conda activate test-environment;
else
if [[ "$PYTHON" == "3.6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
conda env update -qn base -f build-environment.yaml;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- rm miniconda.sh
- source $HOME/miniconda/etc/profile.d/conda.sh && conda activate
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda update -q --all
- conda config --append channels conda-forge
- conda config --append channels cantera
- conda config --append channels pr-omethe-us
- if [[ -z "$TRAVIS_TAG" ]]; then
sed -i -e "s/\${PYTHON}/"${PYTHON}"/" test-environment.yaml;
conda env create -qf test-environment.yaml;
conda activate py${PYTHON};
else
if [[ "$PYTHON" == "3.6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
conda env update -qn base -f build-environment.yaml;
fi
# Useful for debugging any issues with conda
- conda info -a
- conda list
fi
# Useful for debugging any issues with conda
- conda info -a
- conda list

# command to run tests
script:
Expand All @@ -57,17 +58,24 @@ script:
pytest -vv --cov=./;
if [[ "$PYTHON" == "3.6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
git checkout -- test-environment.yaml;
conda install -q sphinx doctr;
conda install -q sphinx doctr nbsphinx ipython;
python setup.py install;
cd docs;
make html SPHINXOPTS="-W";
cd ..;
doctr deploy .;
doctr deploy devel;
fi
else
conda install -yq anaconda-client conda-build
conda build conda.recipe --python=${PYTHON};
anaconda -t $ANACONDA_TOKEN upload $HOME/miniconda/conda-bld/*/pyteck*.tar.bz2;
if [[ "$PYTHON" == "3.6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
conda build conda.recipe;
anaconda -t $ANACONDA_TOKEN upload $HOME/miniconda/conda-bld/*/pyked*.tar.bz2;
python setup.py install;
cd docs;
make html SPHINXOPTS="-W";
cd ..;
doctr deploy --build-tags .;
doctr deploy --build-tags "tags/${TRAVIS_TAG}";
fi
fi
- set +e

Expand All @@ -76,10 +84,6 @@ after_success:
bash <(curl -s https://codecov.io/bash);
fi

#before_deploy:
# - conda install pandoc
# - pip install pypandoc

deploy:
provider: pypi
user: kyleniemeyer
Expand Down
42 changes: 18 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
version: 1.0.{build}
environment:
ANACONDA_KEY:
secure: QRB7xAxIYmN+iZnmWh2gwaP5XNc2IVPM3f5dPXsZ3oqsyd3x1AQg0Y3T54Zkx6p/
PYTHON_LOC: "C:\\Miniconda36-x64"

matrix:
# - PYTHON_LOC: "C:\\Miniconda-x64"
# PYTHON_VERSION: "2.7"

- PYTHON_LOC: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.5"

- PYTHON_LOC: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.6"
skip_tags: true

install:
- cmd: call %PYTHON_LOC%\Scripts\activate.bat
- cmd: conda config --set always_yes yes --set changeps1 no
- cmd: conda config --append channels conda-forge
- cmd: conda config --append channels cantera
- cmd: conda config --append channels pr-omethe-us
- cmd: conda update -q conda
- ps: (get-content test-environment.yaml) | %{$_ -replace "\$\{PYTHON\}",$env:PYTHON_VERSION} | set-content test-environment.yaml
- cmd: IF "%APPVEYOR_REPO_TAG%"=="false" conda env create -qf test-environment.yaml
- cmd: IF "%APPVEYOR_REPO_TAG%"=="false" call %PYTHON_LOC%\Scripts\activate.bat test-environment
- cmd: IF "%APPVEYOR_REPO_TAG%"=="true" conda install -yq anaconda-client conda-build
- cmd: conda update conda
- cmd: conda update -q --all
- ps: (get-content test-environment.yaml) | %{$_ -replace "\$\{PYTHON\}","3.5"} | set-content test-environment.yaml
- cmd: conda env create -qf test-environment.yaml
- cmd: git checkout -- test-environment.yaml
- ps: (get-content test-environment.yaml) | %{$_ -replace "\$\{PYTHON\}","3.6"} | set-content test-environment.yaml
- cmd: conda env create -qf test-environment.yaml
- cmd: conda info -a
- cmd: conda list
- ps: Write-Host "Packages in py3.5 Environment:"
- cmd: conda list -n py3.5
- ps: Write-Host "Packages in py3.6 Environment:"
- cmd: conda list -n py3.6

build_script:
- cmd: IF "%APPVEYOR_REPO_TAG%"=="false" python setup.py test
- cmd: IF "%APPVEYOR_REPO_TAG%"=="true" conda build conda.recipe --python=%PYTHON_VERSION%

deploy_script:
- cmd: IF "%APPVEYOR_REPO_TAG%"=="true" anaconda -t %ANACONDA_KEY% upload "%PYTHON_LOC%\conda-bld\win-64\pyteck*.tar.bz2"
- cmd: call %PYTHON_LOC%\Scripts\activate.bat py3.5
- cmd: pytest -vv --cov=./ --cov-append
- cmd: call %PYTHON_LOC%\Scripts\activate.bat py3.6
- cmd: pytest -vv --cov=./ --cov-append
- cmd: codecov -X gcov
20 changes: 20 additions & 0 deletions build-environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build-env
channels:
- defaults
- conda-forge
- cantera
- pr-omethe-us
dependencies:
- numpy>=1.13.1,<2.0
- scipy>=1.0.0
- pyyaml>=3.12,<4.0
- pint>=0.7.2,<0.9
- pytables
- cantera>=2.3.0
- pyked>=0.4.1
- sphinx
- nbsphinx
- ipython
- conda-build
- anaconda-client
- doctr
9 changes: 6 additions & 3 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ source:

build:
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt
script: python -m pip install --no-deps --ignore-installed .
noarch: python

requirements:
build:
- python >=3.5,{{PY_VER}}*
- python >=3.5
- setuptools
- pip

run:
- python {{PY_VER}}*
- python
- pyyaml >=3.12,<4.0
- numpy >=1.13.1
- scipy >=1.0.0
Expand All @@ -29,6 +31,7 @@ requirements:
test:
imports:
- pyked
- cantera

requires:
- pytest >=3.0.1
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'sphinx.ext.viewcode',
]

autodoc_default_flags = ['members']
autodoc_default_options = ['members']
autoclass_content = 'class'
napoleon_numpy_docstring = True
napoleon_google_docstring = False
Expand Down
20 changes: 6 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
https://github.com/pypa/sampleproject
"""

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from setuptools import setup
from codecs import open
from os import path
import sys
Expand All @@ -25,22 +23,16 @@
with open(path.join(here, 'CITATION.md')) as citation_file:
citation = citation_file.read()

desc = readme + '\n\n' + changelog + '\n\n' + citation
try:
import pypandoc
long_description = pypandoc.convert_text(desc, 'rst', format='md')
with open(path.join(here, 'README.rst'), 'w') as rst_readme:
rst_readme.write(long_description)
except (ImportError, OSError, IOError):
long_description = desc
long_description = readme + '\n\n' + changelog + '\n\n' + citation

install_requires = [
'pyyaml>=3.12,<4.0',
'pint>=0.7.2,<0.9',
'numpy>=1.13.0',
'numpy>=1.13.0,<2.0',
'tables',
'pyked>=0.4.1',
'scipy>=0.19.0',
'scipy>=1.0.0',
'cantera>=2.3.0'
]

tests_require = [
Expand All @@ -57,7 +49,7 @@

description='Evaluation of chemical kinetic models with experimental data',
long_description=long_description,
url='https://github.com/kyleniemeyer/PyTeCK',
url='https://github.com/pr-omethe-us/PyTeCK',

author='Kyle E. Niemeyer',
author_email='[email protected]',
Expand Down
7 changes: 3 additions & 4 deletions test-environment.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: test-environment
name: py${PYTHON}
channels:
- defaults
- conda-forge
- cantera
- pr-omethe-us
dependencies:
- numpy>=1.13.1
- python=${PYTHON}
- numpy>=1.13.1,<2.0
- scipy>=1.0.0
- pyyaml>=3.12,<4.0
- pytest>=3.2.0
- pytest-cov>=2.3.1
- python=${PYTHON}
- pint>=0.7.2,<0.9
- pytables
- cantera>=2.3.0
- pyked>=0.4.1
- codecov
- flake8

0 comments on commit 3fadc74

Please sign in to comment.