Skip to content

Commit 3d2032d

Browse files
aprsakecnry
andauthored
New workflows for the CI. (#737)
* New workflows for the CI. These workflows remove matplotlib checks and allow CI to run again. * Updating all tests to conditionally use matplotlib. * update pip requirements to lowest tested version in CI matrices * Macos-12 removed from python 3.7. Macos-12 uses python 3.8.9 or higher. --------- Co-authored-by: Kyle Conroy <[email protected]>
1 parent 7b1d73f commit 3d2032d

File tree

31 files changed

+70
-108
lines changed

31 files changed

+70
-108
lines changed

.github/workflows/on_pr_test_python_31x.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Python 3.10+ test suite
44

55
on:
6+
workflow_dispatch:
67
pull_request:
78
push:
89
branches:
@@ -23,7 +24,6 @@ jobs:
2324
# scipy-version: ["1.8", "1.9", "1.10"]
2425
scipy-version: ["1.8", "1.10"]
2526
# mpl-version: ["3.2", "3.3", "3.4", "3.5", "3.6"]
26-
mpl-version: ["3.2", "3.6"]
2727
os: [ubuntu-latest, macos-11, macos-12] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
2828
exclude:
2929
- python-version: "3.11"
@@ -40,8 +40,7 @@ jobs:
4040
numpy-version: "1.24"
4141
scipy-version: "1.10"
4242
astropy-version: "5.0"
43-
44-
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}} mpl ${{ matrix.mpl-version }}
43+
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}}
4544
steps:
4645
- name: Checkout PHOEBE
4746
uses: actions/checkout@v3
@@ -60,28 +59,29 @@ jobs:
6059
run: |
6160
python -m pip install --upgrade pip
6261
63-
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }}, matplotlib ${{ matrix.mpl-version }} and dependencies
62+
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }} and dependencies
6463
run: |
65-
python -m pip install numpy==${{ matrix.numpy-version }}.* --no-cache-dir --ignore-installed
64+
python -m pip install numpy==${{ matrix.numpy-version }}.* --force-reinstall
6665
python -m pip install scipy==${{ matrix.scipy-version }}.* --no-deps
6766
python -m pip install astropy==${{ matrix.astropy-version }}.* --no-deps
68-
python -m pip install matplotlib==${{ matrix.mpl-version }}.* --no-deps
69-
python -m pip install rebound requests pytest sympy tqdm corner pyyaml pyerfa pipdeptree
67+
python -m pip install rebound requests pytest sympy tqdm pyyaml pyerfa pipdeptree
7068
7169
- name: Run pipdeptree to see package dependencies
7270
run: |
7371
pipdeptree
7472
75-
- name: Test numpy, scipy, astropy, matplotlib install/versions
73+
- name: Test numpy, scipy, astropy install/versions
7674
run: |
77-
python -c "import numpy, scipy, astropy, matplotlib; print('numpy: {}\nscipy: {}\nastropy: {}\nmatplotlib: {}\n'.format(numpy.__version__, scipy.__version__, astropy.__version__, matplotlib.__version__))"
75+
python -c "import numpy; print(f'numpy version: {numpy.__version__}')"
76+
python -c "import scipy; print(f'scipy version: {scipy.__version__}')"
77+
python -c "import astropy; print(f'astropy version: {astropy.__version__}')"
7878
7979
- name: Install PHOEBE from source
8080
run: |
8181
python setup.py build && python setup.py install --user
8282
8383
- name: Checkout photodynam
84-
uses: actions/checkout@v2
84+
uses: actions/checkout@v3
8585
with:
8686
repository: phoebe-project/photodynam
8787
path: photodynam
@@ -97,7 +97,7 @@ jobs:
9797
- name: Test photodynam install
9898
run: |
9999
python -c "import photodynam"
100-
100+
101101
- name: Run tests
102102
run: |
103103
pytest --verbose --capture=no --full-trace tests/nosetests/

.github/workflows/on_pr_test_python_37.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Python 3.7 test suite
44

55
on:
6+
workflow_dispatch:
67
pull_request:
78
push:
89
branches:
@@ -17,20 +18,19 @@ jobs:
1718
fail-fast: false
1819
matrix:
1920
python-version: ["3.7"]
20-
# astropy-version: ["2.0", "3.0", "4.0"]
21-
astropy-version: ["2.0", "4.0"]
21+
# astropy-version: ["3.0", "4.0"]
22+
astropy-version: ["3.0", "4.0"]
2223
# numpy-version: ["1.15", "1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
2324
numpy-version: ["1.15", "1.21"]
2425
# scipy-version: ["1.4", "1.5", "1.6", "1.7"]
2526
scipy-version: ["1.4", "1.7"]
2627
# mpl-version: ["3.3", "3.4", "3.5"]
27-
mpl-version: ["3.3", "3.5"]
2828
os: [ubuntu-latest, macos-11] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
2929
exclude:
3030
- astropy-version: "2.0" # not sure why this is failing
3131
os: "macos-11"
3232

33-
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}} mpl ${{ matrix.mpl-version }}
33+
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}}
3434
steps:
3535
- name: Checkout PHOEBE
3636
uses: actions/checkout@v3
@@ -49,28 +49,29 @@ jobs:
4949
run: |
5050
python -m pip install --upgrade pip
5151
52-
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }}, matplotlib ${{ matrix.mpl-version }} and dependencies
52+
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }} and dependencies
5353
run: |
54-
python -m pip install numpy==${{ matrix.numpy-version }}.* --no-cache-dir --ignore-installed
54+
python -m pip install numpy==${{ matrix.numpy-version }}.* --force-reinstall
5555
python -m pip install scipy==${{ matrix.scipy-version }}.* --no-deps
5656
python -m pip install astropy==${{ matrix.astropy-version }}.* --no-deps
57-
python -m pip install matplotlib==${{ matrix.mpl-version }}.* --no-deps
5857
python -m pip install rebound requests pytest sympy tqdm corner pyyaml pyerfa pipdeptree
5958
6059
- name: Run pipdeptree to see package dependencies
6160
run: |
6261
pipdeptree
6362
64-
- name: Test numpy, scipy, astropy, matplotlib install/versions
63+
- name: Test numpy, scipy, astropy install/versions
6564
run: |
66-
python -c "import numpy, scipy, astropy, matplotlib; print('numpy: {}\nscipy: {}\nastropy: {}\nmatplotlib: {}\n'.format(numpy.__version__, scipy.__version__, astropy.__version__, matplotlib.__version__))"
65+
python -c "import numpy; print(f'numpy version: {numpy.__version__}')"
66+
python -c "import scipy; print(f'scipy version: {scipy.__version__}')"
67+
python -c "import astropy; print(f'astropy version: {astropy.__version__}')"
6768
6869
- name: Install PHOEBE from source
6970
run: |
7071
python setup.py build && python setup.py install --user
7172
7273
- name: Checkout photodynam
73-
uses: actions/checkout@v2
74+
uses: actions/checkout@v3
7475
with:
7576
repository: phoebe-project/photodynam
7677
path: photodynam

.github/workflows/on_pr_test_python_38.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Python 3.8 test suite
44

55
on:
6+
workflow_dispatch:
67
pull_request:
78
push:
89
branches:
@@ -24,19 +25,11 @@ jobs:
2425
# scipy-version: ["1.8", "1.9", "1.10"]
2526
scipy-version: ["1.8", "1.10"]
2627
# mpl-version: ["3.2", "3.3", "3.4", "3.5", "3.6"]
27-
mpl-version: ["3.2", "3.6"]
2828
os: [ubuntu-latest, macos-11, macos-12] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
2929
exclude:
30-
- os: "macos-11" # astropy failing to build. Ticket open.
31-
numpy-version: "1.18"
32-
scipy-version: "1.8"
33-
astropy-version: "3.0"
34-
- os: "macos-12" # astropy failing to build. Ticket amended.
35-
numpy-version: "1.18"
30+
- numpy-version: "1.18" # astropy failing to build. Ticket open.
3631
scipy-version: "1.8"
3732
astropy-version: "3.0"
38-
- mpl-version: "3.6" # requires numpy 1.19+
39-
numpy-version: "1.18"
4033
- scipy-version: "1.10" # requires numpy 1.19.5+
4134
numpy-version: "1.18"
4235
- astropy-version: "3.0" # requires numpy <=1.21
@@ -56,7 +49,7 @@ jobs:
5649
# - astropy-version: "5.0"
5750
# numpy-version: "1.19"
5851

59-
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}} mpl ${{ matrix.mpl-version }}
52+
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}}
6053
steps:
6154
- name: Checkout PHOEBE
6255
uses: actions/checkout@v3
@@ -75,28 +68,29 @@ jobs:
7568
run: |
7669
python -m pip install --upgrade pip
7770
78-
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }}, matplotlib ${{ matrix.mpl-version }} and dependencies
71+
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }} and dependencies
7972
run: |
80-
python -m pip install "numpy==${{ matrix.numpy-version }}.*" --no-cache-dir --ignore-installed
73+
python -m pip install "numpy==${{ matrix.numpy-version }}.*" --force-reinstall
8174
python -m pip install "scipy==${{ matrix.scipy-version }}.*" --no-deps
8275
python -m pip install "astropy==${{ matrix.astropy-version }}.*" --no-deps
83-
python -m pip install "matplotlib==${{ matrix.mpl-version }}.*" --no-deps
8476
python -m pip install rebound requests pytest sympy tqdm corner pyyaml pyerfa pipdeptree
8577
8678
- name: Run pipdeptree to see package dependencies
8779
run: |
8880
pipdeptree
8981
90-
- name: Test numpy, scipy, astropy, matplotlib install/versions
82+
- name: Test numpy, scipy, astropy install/versions
9183
run: |
92-
python -c "import numpy, scipy, astropy, matplotlib; print('numpy: {}\nscipy: {}\nastropy: {}\nmatplotlib: {}\n'.format(numpy.__version__, scipy.__version__, astropy.__version__, matplotlib.__version__))"
84+
python -c "import numpy; print(f'numpy version: {numpy.__version__}')"
85+
python -c "import scipy; print(f'scipy version: {scipy.__version__}')"
86+
python -c "import astropy; print(f'astropy version: {astropy.__version__}')"
9387
9488
- name: Install PHOEBE from source
9589
run: |
9690
python setup.py build && python setup.py install --user
9791
9892
- name: Checkout photodynam
99-
uses: actions/checkout@v2
93+
uses: actions/checkout@v3
10094
with:
10195
repository: phoebe-project/photodynam
10296
path: photodynam

.github/workflows/on_pr_test_python_39.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
name: Python 3.9 test suite
44

55
on:
6+
workflow_dispatch:
67
pull_request:
78
push:
89
branches:
@@ -24,13 +25,12 @@ jobs:
2425
# scipy-version: ["1.8", "1.9", "1.10"]
2526
scipy-version: ["1.8", "1.10"]
2627
# mpl-version: ["3.2", "3.3", "3.4", "3.5", "3.6"]
27-
mpl-version: ["3.2", "3.6"]
2828
os: [ubuntu-latest, macos-11, macos-12] # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
2929
exclude:
3030
- astropy-version: "4.0" # requires numpy <=1.21
3131
numpy-version: "1.24"
3232

33-
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}} mpl ${{ matrix.mpl-version }}
33+
name: ${{ matrix.os }} python${{ matrix.python-version}} numpy ${{ matrix.numpy-version }} scipy ${{ matrix.scipy-version }} astropy ${{ matrix.astropy-version}}
3434
steps:
3535
- name: Checkout PHOEBE
3636
uses: actions/checkout@v3
@@ -49,28 +49,29 @@ jobs:
4949
run: |
5050
python -m pip install --upgrade pip
5151
52-
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }}, matplotlib ${{ matrix.mpl-version }} and dependencies
52+
- name: Install numpy ${{ matrix.numpy-version }}, scipy ${{ matrix.scipy-version }}, astropy ${{ matrix.astropy-version }} and dependencies
5353
run: |
54-
python -m pip install "numpy==${{ matrix.numpy-version }}.*" --no-cache-dir --ignore-installed
54+
python -m pip install "numpy==${{ matrix.numpy-version }}.*" --force-reinstall
5555
python -m pip install "scipy==${{ matrix.scipy-version }}.*" --no-deps
5656
python -m pip install "astropy==${{ matrix.astropy-version }}.*" --no-deps
57-
python -m pip install "matplotlib==${{ matrix.mpl-version }}.*" --no-deps
5857
python -m pip install rebound requests pytest sympy tqdm corner pyyaml pyerfa pipdeptree
5958
6059
- name: Run pipdeptree to see package dependencies
6160
run: |
6261
pipdeptree
6362
64-
- name: Test numpy, scipy, astropy, matplotlib install/versions
63+
- name: Test numpy, scipy, astropy install/versions
6564
run: |
66-
python -c "import numpy, scipy, astropy, matplotlib; print('numpy: {}\nscipy: {}\nastropy: {}\nmatplotlib: {}\n'.format(numpy.__version__, scipy.__version__, astropy.__version__, matplotlib.__version__))"
65+
python -c "import numpy; print(f'numpy version: {numpy.__version__}')"
66+
python -c "import scipy; print(f'scipy version: {scipy.__version__}')"
67+
python -c "import astropy; print(f'astropy version: {astropy.__version__}')"
6768
6869
- name: Install PHOEBE from source
6970
run: |
7071
python setup.py build && python setup.py install --user
7172
7273
- name: Checkout photodynam
73-
uses: actions/checkout@v2
74+
uses: actions/checkout@v3
7475
with:
7576
repository: phoebe-project/photodynam
7677
path: photodynam

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def _env_variable_bool(key, default):
443443
'phoebe.dependencies', 'phoebe.dependencies.autofig', 'phoebe.dependencies.nparray', 'phoebe.dependencies.distl', 'phoebe.dependencies.crimpl', 'phoebe.dependencies.unitsiau2015',
444444
'phoebe.dependencies.ligeor',
445445
'phoebe.dependencies.ligeor.ebai', 'phoebe.dependencies.ligeor.ebai.database', 'phoebe.dependencies.ligeor.eclipse', 'phoebe.dependencies.ligeor.models', 'phoebe.dependencies.ligeor.utils'],
446-
install_requires=['numpy>=1.12','scipy>=1.2','astropy>=1.0', 'corner', 'pytest', 'requests', 'tqdm', 'python-socketio[client]']+['flask', 'flask-cors', 'flask-socketio==4.3.*', 'gevent-websocket'],
446+
install_requires=['numpy>=1.15','scipy>=1.4','astropy>=3.0', 'corner', 'pytest', 'requests', 'tqdm', 'python-socketio[client]']+['flask', 'flask-cors', 'flask-socketio==4.3.*', 'gevent-websocket'],
447447
package_data={'phoebe.atmospheres':['tables/wd/*', 'tables/passbands/*'],
448448
'phoebe.frontend':['default_bundles/*.bundle'],
449449
'phoebe.solverbackends.ebai': ['*.data', '*.weights'],

tests/nosetests/test_blackbody/test_blackbody.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"""
33

44
import phoebe
5-
from phoebe import u
65
import numpy as np
7-
import matplotlib.pyplot as plt
86
import os
97

108

tests/nosetests/test_cached_bundles/test_cached_bundles.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import phoebe
2-
# from phoebe import u
3-
# import numpy as np
4-
# import matplotlib.pyplot as plt
52

63

74
def test_star():

tests/nosetests/test_cbs/test_cbs.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import phoebe
2-
from phoebe import u
32
import numpy as np
4-
import matplotlib.pyplot as plt
53
import os
64

75

tests/nosetests/test_checks/test_checks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"""
33

44
import phoebe
5-
from phoebe import u
6-
import numpy as np
7-
import matplotlib.pyplot as plt
5+
86

97
phoebe.logger('DEBUG')
108

tests/nosetests/test_distortion_method_none/test_distortion_method_none.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"""
33

44
import phoebe
5-
from phoebe import u
6-
import numpy as np
7-
import matplotlib.pyplot as plt
85

96

107
def test_binary(plot=False):

tests/nosetests/test_dpdt/test_dpdt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"""
33

44
import phoebe
5-
from phoebe import u
65
import numpy as np
7-
import matplotlib.pyplot as plt
86
import os
97

108

tests/nosetests/test_dperdt/test_dperdt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"""
33

44
import phoebe
5-
from phoebe import u
65
import numpy as np
7-
import matplotlib.pyplot as plt
86
import os
97

108

tests/nosetests/test_dynamics/test_dynamics.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import phoebe
55
from phoebe import u
66
import numpy as np
7-
import matplotlib.pyplot as plt
7+
try:
8+
import matplotlib.pyplot as plt
9+
PLOTTING_ENABLED = True
10+
except:
11+
PLOTTING_ENABLED = False
812

913

1014
def _keplerian_v_nbody(b, plot=False):
@@ -65,7 +69,7 @@ def _phoebe_v_photodynam(b, plot=False):
6569
# TODO: why the small discrepancy (visible especially in y, still <1e-11) - possibly a difference in time0 or just a precision limit in the photodynam backend since loading from a file??
6670

6771

68-
if plot:
72+
if PLOTTING_ENABLED and plot:
6973
for k in ['us', 'vs', 'ws', 'vus', 'vvs', 'vws']:
7074
plt.cla()
7175
plt.plot(b.get_value('times', model='phoeberesults', component=comp, unit=u.d), b.get_value(k, model='phoeberesults', component=comp), 'r-')

tests/nosetests/test_dynamics/test_dynamics_grid.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
import phoebe
55
from phoebe import u
66
import numpy as np
7-
import matplotlib.pyplot as plt
7+
try:
8+
import matplotlib.pyplot as plt
9+
PLOTTING_ENABLED = True
10+
except:
11+
PLOTTING_ENABLED = False
812

913

1014
def _keplerian_v_nbody(b, ltte, period, plot=False):
@@ -58,7 +62,7 @@ def _phoebe_v_photodynam(b, period, plot=False):
5862
# TODO: why the small discrepancy (visible especially in y, still <1e-11) - possibly a difference in time0 or just a precision limit in the photodynam backend since loading from a file??
5963

6064

61-
if plot:
65+
if PLOTTING_ENABLED and plot:
6266
for k in ['us', 'vs', 'ws', 'vus', 'vvs', 'vws']:
6367
plt.cla()
6468
plt.plot(b.get_value('times', model='phoeberesults', component=comp, unit=u.d), b.get_value(k, model='phoeberesults', component=comp), 'r-')

0 commit comments

Comments
 (0)