From f3e898398c2792f56f085f7be8ac217d8978aa2c Mon Sep 17 00:00:00 2001 From: Kyle Niemeyer Date: Thu, 2 May 2019 13:24:24 -0700 Subject: [PATCH 1/4] working on travis fix --- appveyor.yml | 38 ++++++++++++++++++++++++++++++++++++-- build-environment.yaml | 20 ++++++++++++++++++++ conda.recipe/meta.yaml | 9 ++++++--- test-environment.yaml | 4 ++-- 4 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 build-environment.yaml diff --git a/appveyor.yml b/appveyor.yml index 312a71b..4ce635a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,14 +22,48 @@ install: - 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%"=="false" call %PYTHON_LOC%\Scripts\activate.bat test-env - cmd: IF "%APPVEYOR_REPO_TAG%"=="true" conda install -yq anaconda-client conda-build - cmd: conda info -a - cmd: conda list 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% + - cmd: IF "%APPVEYOR_REPO_TAG%"=="true" conda build conda.recipe deploy_script: - cmd: IF "%APPVEYOR_REPO_TAG%"=="true" anaconda -t %ANACONDA_KEY% upload "%PYTHON_LOC%\conda-bld\win-64\pyteck*.tar.bz2" + + + + +version: 1.0.{build} +environment: + PYTHON_LOC: "C:\\Miniconda36-x64" + +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 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 + - 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: 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: flake8 . + - 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/test-environment.yaml b/test-environment.yaml index 3b1eb5a..00c88ce 100644 --- a/test-environment.yaml +++ b/test-environment.yaml @@ -1,11 +1,11 @@ -name: test-environment +name: test-env channels: - defaults - conda-forge - cantera - pr-omethe-us dependencies: - - numpy>=1.13.1 + - numpy>=1.13.1,<2.0 - scipy>=1.0.0 - pyyaml>=3.12,<4.0 - pytest>=3.2.0 From f57a30e39bc77d982338961144eca5fc29e6659b Mon Sep 17 00:00:00 2001 From: Kyle Niemeyer Date: Thu, 2 May 2019 14:18:47 -0700 Subject: [PATCH 2/4] Updating Travis and Appveyor to use noarch (like PyKED) --- .travis.yml | 70 +++++++++++++++++++++++-------------------- appveyor.yml | 40 ------------------------- setup.py | 22 +++++--------- test-environment.yaml | 5 ++-- 4 files changed, 46 insertions(+), 91 deletions(-) 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 4ce635a..902ea7a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,42 +1,3 @@ -version: 1.0.{build} -environment: - ANACONDA_KEY: - secure: QRB7xAxIYmN+iZnmWh2gwaP5XNc2IVPM3f5dPXsZ3oqsyd3x1AQg0Y3T54Zkx6p/ - - 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" - -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-env - - cmd: IF "%APPVEYOR_REPO_TAG%"=="true" conda install -yq anaconda-client conda-build - - cmd: conda info -a - - cmd: conda list - -build_script: - - cmd: IF "%APPVEYOR_REPO_TAG%"=="false" python setup.py test - - cmd: IF "%APPVEYOR_REPO_TAG%"=="true" conda build conda.recipe - -deploy_script: - - cmd: IF "%APPVEYOR_REPO_TAG%"=="true" anaconda -t %ANACONDA_KEY% upload "%PYTHON_LOC%\conda-bld\win-64\pyteck*.tar.bz2" - - - - version: 1.0.{build} environment: PYTHON_LOC: "C:\\Miniconda36-x64" @@ -65,5 +26,4 @@ build_script: - cmd: pytest -vv --cov=./ --cov-append - cmd: call %PYTHON_LOC%\Scripts\activate.bat py3.6 - cmd: pytest -vv --cov=./ --cov-append - - cmd: flake8 . - cmd: codecov -X gcov diff --git a/setup.py b/setup.py index 6ca7a58..3fbb1ba 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', - 'tables', + 'numpy>=1.13.0,<2.0', + 'pytables', '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 00c88ce..94e49f1 100644 --- a/test-environment.yaml +++ b/test-environment.yaml @@ -1,19 +1,18 @@ -name: test-env +name: py${PYTHON} channels: - defaults - conda-forge - cantera - pr-omethe-us dependencies: + - 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 From ad879d756a73749fa21fa5bb951174544064be93 Mon Sep 17 00:00:00 2001 From: Kyle Niemeyer Date: Thu, 2 May 2019 14:28:05 -0700 Subject: [PATCH 3/4] Fixed requires from "pytables" to "tables" --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3fbb1ba..ccd8c42 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ 'pyyaml>=3.12,<4.0', 'pint>=0.7.2,<0.9', 'numpy>=1.13.0,<2.0', - 'pytables', + 'tables', 'pyked>=0.4.1', 'scipy>=1.0.0', 'cantera>=2.3.0' From 05c4b3d112ecc89155c0fca7293526666abbfd33 Mon Sep 17 00:00:00 2001 From: Kyle Niemeyer Date: Thu, 2 May 2019 14:35:28 -0700 Subject: [PATCH 4/4] Changed deprecated sphinx keyword [ci skip] --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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