From 3d105be2fe457260875205f6ffe2915455246f45 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Sat, 11 Apr 2020 22:11:27 -0400 Subject: [PATCH] Build CoolProp so we can test on Python 3.8 CoolProp 6.3.0 from PyPI raises a TypeError due to some changes that since the release of Python 3.8. The master branch of CoolProp has the fixes, so build that and test ThermoState on Python 3.8. Don't do this on Windows, since Windows should be covered by the other Python versions, and I can't easily test compiling CoolProp on Windows right now. --- .github/workflows/pythonpackage.yml | 55 +++++++++++++++++++++++++++-- tox.ini | 4 ++- 2 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 56dbe0d..1cb5449 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7] os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false @@ -41,11 +41,62 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml + # CoolProp has to be built from the master branch for Python 3.8 + build-py38: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # Don't want to figure out compiling CoolProp on Windows for tests. + # These OS should be good enough + os: [ubuntu-latest, macos-latest] + fail-fast: false + steps: + - name: Check out the repository + uses: actions/checkout@v2 + with: + path: main + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Clone CoolProp + uses: actions/checkout@v2 + with: + repository: CoolProp/CoolProp + path: CoolProp + submodules: 'recursive' + - name: Install CoolProp dependencies + run: | + python -m pip install --upgrade pip setuptools + python -m pip install cython wheel + - name: Build CoolProp wheel + env: + MACOSX_DEPLOYMENT_TARGET: 10.13 + run: | + pushd CoolProp/wrappers/Python + python ../../dev/generate_headers.py + python setup.py bdist_wheel + popd + - name: Install test dependencies + run: | + python -m pip install tox tox-venv + - name: Test with tox + env: + CP_PACKAGE_DIST_DIR: ${{ github.workspace }}/CoolProp/wrappers/Python/dist + run: | + pushd main + tox -v -e py38 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: main/coverage.xml + notebooks: runs-on: ubuntu-latest steps: - name: Check out the repository - uses: actions/checkout@v2 + uses: actions/checkout@v2 - name: Set up Python 3.7 uses: actions/setup-python@v1 with: diff --git a/tox.ini b/tox.ini index 928e2ca..5a6db0c 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,6 @@ requires = tox-venv python = 3.6: py36 3.7: py37 - 3.8: py38 [testenv] description = run the tests with pytest under {basepython} @@ -25,6 +24,9 @@ download = true [testenv:py38] description = run the tests with pytest under {basepython}, allowing failures due to CoolProp +install_command=python -m pip install --find-links={env:CP_PACKAGE_DIST_DIR:} {opts} {packages} +pip_pre = true + [testenv:notebooks] description = run the Notebooks in the docs folder deps =