diff --git a/.travis.yml b/.travis.yml index 329d179..cd3c7c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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 @@ -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 diff --git a/appveyor.yml b/appveyor.yml index 312a71b..902ea7a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/build-environment.yaml b/build-environment.yaml new file mode 100644 index 0000000..80f83ad --- /dev/null +++ b/build-environment.yaml @@ -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 diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 6023f1a..ebd1c47 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -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 @@ -29,6 +31,7 @@ requirements: test: imports: - pyked + - cantera requires: - pytest >=3.0.1 diff --git a/docs/conf.py b/docs/conf.py index 621ea26..bb36a9e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/setup.py b/setup.py index 6ca7a58..ccd8c42 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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 = [ @@ -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='kyle.niemeyer@gmail.com', diff --git a/test-environment.yaml b/test-environment.yaml index 3b1eb5a..94e49f1 100644 --- a/test-environment.yaml +++ b/test-environment.yaml @@ -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