Skip to content

Commit

Permalink
Add UWGeo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rbeucher committed May 24, 2022
1 parent 4b6f3e8 commit 1ac133f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ jobs:
run: |
pip install pytest
python3 -m pytest -vvv docs/pytests
python3 -m pytest -vvv docs/test/UWGeodynamics
conda_build:
name: Conda Build (Python ${{matrix.python-version}} ${{ matrix.os }})
Expand Down Expand Up @@ -299,28 +300,28 @@ jobs:
# pip install twine
# python -m twine upload dist/*

manylinux-wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
with:
system-packages: 'cmake ninja-build'
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
build-requirements: 'setuptools numpy'
- name: Publish wheels to PyPI
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
twine upload dist/*-manylinux*.whl
# manylinux-wheels:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install twine
# - name: Build manylinux Python wheels
# uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
# with:
# system-packages: 'cmake ninja-build'
# python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310'
# build-requirements: 'setuptools numpy'
# - name: Publish wheels to PyPI
# if: github.event_name == 'release'
# env:
# TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
# run: |
# twine upload dist/*-manylinux*.whl
2 changes: 1 addition & 1 deletion docs/test/UWGeodynamics/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import glob
import ntpath

scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/benchmarks/*.ipynb"))]
scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/UWGeodynamics/benchmarks/*.ipynb"))]

@pytest.mark.parametrize('script', scripts)
def test_script_execution(script):
Expand Down
2 changes: 1 addition & 1 deletion docs/test/UWGeodynamics/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import glob
import ntpath

scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/examples/*.ipynb"))]
scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/UWGeodynamics/examples/*.ipynb"))]

@pytest.mark.parametrize('script', scripts)
def test_script_execution(script):
Expand Down
2 changes: 1 addition & 1 deletion docs/test/UWGeodynamics/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import glob
import ntpath

scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/tutorials/*.ipynb")) if "Badlands" not in path]
scripts = [pytest.param(path, id=ntpath.basename(path)) for path in sorted(glob.glob("docs/UWGeodynamics/tutorials/*.ipynb")) if "Badlands" not in path]

@pytest.mark.parametrize('script', scripts)
def test_script_execution(script):
Expand Down
3 changes: 2 additions & 1 deletion docs/test/UWGeodynamics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from shutil import copyfile
import os
import json
import sys


def _check_setup_only(nb):
Expand Down Expand Up @@ -31,7 +32,7 @@ def _notebook_run(script, check_setup_only=True):

pyfile = outpath.split(".")[0] + ".py"
os.remove(outpath)
args = ["python", pyfile]
args = [sys.executable, pyfile]
subprocess.check_call(args)
os.remove(pyfile)

Expand Down

0 comments on commit 1ac133f

Please sign in to comment.