Skip to content

Commit

Permalink
Build CoolProp so we can test on Python 3.8
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bryanwweber committed Apr 12, 2020
1 parent 0a30826 commit 3d105be
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
55 changes: 53 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 =
Expand Down

0 comments on commit 3d105be

Please sign in to comment.