Skip to content

Commit 2b20cd5

Browse files
authored
Pick up new benchmarks automatically and improve github actions (#146)
Add coverage config file and install pyro with pip instead of running setup.py directly
1 parent 0e5ca9f commit 2b20cd5

File tree

9 files changed

+29
-24
lines changed

9 files changed

+29
-24
lines changed

.coveragerc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[paths]
2+
# files installed in */site-packages/pyro/ are equivalent to those in pyro/
3+
source =
4+
pyro
5+
*/site-packages/pyro
6+
7+
[run]
8+
source = pyro
9+
# measure the source files from the installed pyro package
10+
source_pkgs = pyro
11+
12+
[report]
13+
# don't include the test files themselves
14+
omit =
15+
*/tests/*
16+
pyro/test.py

.github/workflows/docs-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: pip install -r ./requirements.txt
3939

4040
- name: Install pyro
41-
run: python setup.py install
41+
run: pip install .
4242

4343
- name: Build docs
4444
run: |

.github/workflows/flake8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
pip install flake8
3939
4040
- name: Install pyro
41-
run: python setup.py install --user
41+
run: pip install .
4242

4343
- name: Run flake8
4444
run: flake8 pyro

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: pip install -r ./requirements.txt
3535

3636
- name: Install pyro
37-
run: python setup.py install
37+
run: pip install .
3838

3939
- name: Build docs
4040
run: ./deploy_docs_action.sh
@@ -44,4 +44,4 @@ jobs:
4444
with:
4545
github_token: ${{ secrets.GITHUB_TOKEN }}
4646
publish_dir: ./out
47-
keep_files: true
47+
keep_files: true

.github/workflows/isort.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
pip install isort
3939
4040
- name: Install pyro
41-
run: python setup.py install --user
41+
run: pip install .
4242

4343
- name: Validate
4444
run: isort -c pyro

.github/workflows/pylint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
pip install pylint
3939
4040
- name: Install pyro
41-
run: python setup.py install --user
41+
run: pip install .
4242

4343
- name: Validate
4444
run: pylint --errors-only pyro pyro/analysis

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
pip install -r requirements.txt
4242
4343
- name: Install pyro
44-
run: python setup.py install --user
44+
run: pip install .
4545

4646
- name: Run tests with pytest
47-
run: pytest -v --cov=. --cov-config .coveragerc --nbval --ignore=docs --ignore=./pyro/multigrid/variable_coeff_elliptic.ipynb --ignore=examples/mesh --ignore=examples/multigrid --ignore=presentations
47+
run: pytest -v --cov=pyro --nbval --ignore=docs --ignore=./pyro/multigrid/variable_coeff_elliptic.ipynb --ignore=examples/mesh --ignore=examples/multigrid --ignore=presentations

.github/workflows/regtest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
pip install -r requirements.txt
4242
4343
- name: Install pyro
44-
run: python setup.py install --user
44+
run: pip install .
4545

4646
- name: Run tests via test.py
4747
run: ./pyro/test.py

setup.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,10 @@
1919
if not f.endswith("inputs.auto"):
2020
inputs.append(f.replace("pyro/", ""))
2121

22-
benchmarks = ["advection/tests/*.h5",
23-
"advection_fv4/tests/*.h5",
24-
"advection_nonuniform/tests/*.h5",
25-
"advection_rk/tests/*.h5",
26-
"compressible/tests/*.h5",
27-
"compressible/tests/*.h5",
28-
"compressible/tests/*.h5",
29-
"compressible_fv4/tests/*.h5",
30-
"compressible_rk/tests/*.h5",
31-
"compressible_sdc/tests/*.h5",
32-
"diffusion/tests/*.h5",
33-
"incompressible/tests/*.h5",
34-
"lm_atm/tests/*.h5",
35-
"multigrid/tests/*.h5",
36-
"swe/tests/*.h5"]
22+
# find all of the benchmark output files
23+
benchmarks = []
24+
for path in Path("pyro").glob("*/tests/*.h5"):
25+
benchmarks.append(str(path.relative_to("pyro")))
3726

3827
setup(name='pyro-hydro',
3928
description='A python hydrodynamics code for teaching and prototyping',

0 commit comments

Comments
 (0)