@@ -19,21 +19,27 @@ jobs:
1919
2020 steps :
2121 - uses : actions/checkout@v4
22+ with :
23+ fetch-depth : " 0"
2224
23- - name : Set up Python 3.9
25+ - name : Set up Python 3.11
2426 uses : actions/setup-python@v5
2527 with :
26- python-version : 3.9
28+ python-version : 3.11
2729
2830 - name : Install dependencies
2931 run : |
3032 python -m pip install --upgrade pip
31- pip install -- editable .[check]
33+ pip install -v -- editable ' .[check]'
3234
3335 - name : black check
3436 run : |
3537 python -m black --check --diff --color .
3638
39+ - name : black preview
40+ run : |
41+ python -m black --preview --diff --color .
42+
3743 - name : isort check
3844 run : |
3945 python -m isort --check --diff --color .
@@ -47,84 +53,126 @@ jobs:
4753 cython-lint src/pentapy/
4854
4955 build_wheels :
50- name : wheels for ${{ matrix.cfg.os }} / ${{ matrix.cfg.arch }}
51- runs-on : ${{ matrix.cfg. os }}
56+ name : wheels for ${{ matrix.os }}
57+ runs-on : ${{ matrix.os }}
5258 strategy :
5359 fail-fast : false
5460 matrix :
55- cfg :
56- - { os: ubuntu-latest, arch: x86_64 }
57- - { os: windows-latest, arch: AMD64 }
58- - { os: macos-latest, arch: x86_64 }
59- - { os: macos-latest, arch: arm64 }
60- - { os: macos-latest, arch: universal2 }
61+ # macos-13 is an intel runner, macos-latest is apple silicon
62+ os : [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
6163
6264 steps :
6365 - uses : actions/checkout@v4
6466 with :
65- fetch-depth : ' 0 '
67+ fetch-depth : " 0 "
6668
6769 - name : Build wheels
68- uses : pypa/cibuildwheel@v2.17.0
69- env :
70- CIBW_ARCHS : ${{ matrix.cfg.arch }}
70+ uses : pypa/cibuildwheel@v2.22.0
7171 with :
72- output-dir : dist
72+ output-dir : dist-wheel-${{ matrix.os }}
7373
74- - uses : actions/upload-artifact@v3
74+ - uses : actions/upload-artifact@v4
7575 with :
76- path : ./dist/*.whl
76+ name : dist-wheel-${{ matrix.os }}
77+ path : ./dist-wheel-${{ matrix.os }}/*.whl
7778
7879 build_sdist :
79- name : sdist on ${{ matrix.os }} with py ${{ matrix.python-version }}
80+ name : sdist on ${{ matrix.os }} with py ${{ matrix.ver.py }} numpy${{ matrix.ver.np }}
8081 runs-on : ${{ matrix.os }}
8182 strategy :
8283 fail-fast : false
8384 matrix :
84- os : [ubuntu-latest]
85- python-version : [3.9]
86-
85+ os : [ubuntu-latest, windows-latest, macos-13, macos-14]
86+ # https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
87+ ver :
88+ - { py: "3.9", np: "==1.20.0" }
89+ - { py: "3.10", np: "==1.21.6" }
90+ - { py: "3.11", np: "==1.23.2" }
91+ - { py: "3.12", np: "==1.26.2" }
92+ - { py: "3.13", np: "==2.1.0" }
93+ - { py: "3.13", np: ">=2.1.0" }
94+ exclude :
95+ - os : macos-14
96+ ver : { py: "3.9", np: "==1.20.0" }
97+ - os : macos-14
98+ ver : { py: "3.10", np: "==1.21.6" }
8799 steps :
88100 - uses : actions/checkout@v4
89101 with :
90- fetch-depth : ' 0 '
102+ fetch-depth : " 0 "
91103
92- - name : Set up Python ${{ matrix.python-version }}
104+ - name : Set up Python ${{ matrix.ver.py }}
93105 uses : actions/setup-python@v5
94106 with :
95- python-version : ${{ matrix.python-version }}
107+ python-version : ${{ matrix.ver.py }}
96108
97109 - name : Install dependencies
98110 run : |
99111 python -m pip install --upgrade pip
100- pip install build coveralls>=3.0.0
101- pip install --editable .[test]
112+ pip install build
113+
114+ - name : Install pentapy
115+ run : |
116+ pip install -v --editable .[test]
102117
103118 - name : Run tests
104- env :
105- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
106119 run : |
107- python -m pytest --cov pentapy --cov-report term-missing -v tests/
108- python -m coveralls --service=github
120+ pip install "numpy${{ matrix.ver.np }}"
121+ python -m pytest -v tests/
109122
110123 - name : Build sdist
111124 run : |
112125 # PEP 517 package builder from pypa
113- python -m build --sdist --outdir dist .
126+ python -m build --sdist --outdir dist-sdist .
127+
128+ - uses : actions/upload-artifact@v4
129+ if : matrix.os == 'ubuntu-latest' && matrix.ver.py == '3.11'
130+ with :
131+ name : dist-sdist
132+ path : dist-sdist/*.tar.gz
133+
134+ coverage :
135+ name : coverage
136+ runs-on : ubuntu-latest
137+
138+ steps :
139+ - uses : actions/checkout@v4
140+ with :
141+ fetch-depth : ' 0'
114142
115- - uses : actions/upload-artifact@v3
116- # if: matrix.os == 'ubuntu-latest' && matrix. python-version == '3.9'
143+ - name : Set up Python 3.11
144+ uses : actions/setup- python@v5
117145 with :
118- path : dist/*.tar.gz
146+ python-version : 3.11
147+
148+ - name : Install dependencies
149+ run : |
150+ python -m pip install --upgrade pip
151+ pip install "coveralls>=3.0.0"
152+
153+ - name : Install pentapy
154+ env :
155+ PENTAPY_CY_COV : 1
156+ run : |
157+ pip install -v --editable .[test]
158+
159+ - name : Run tests
160+ env :
161+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
162+ run : |
163+ pip install "numpy${{ matrix.ver.np }}"
164+ python -m pytest --cov pentapy --cov-report term-missing -v tests/
165+ python -m coveralls --service=github
119166
120167 upload_to_pypi :
121168 needs : [build_wheels, build_sdist]
122169 runs-on : ubuntu-latest
123170
124171 steps :
125- - uses : actions/download-artifact@v3
172+ - uses : actions/download-artifact@v4
126173 with :
127- name : artifact
174+ pattern : dist-*
175+ merge-multiple : true
128176 path : dist
129177
130178 - name : Publish to Test PyPI
@@ -143,4 +191,4 @@ jobs:
143191 uses : pypa/gh-action-pypi-publish@release/v1
144192 with :
145193 user : __token__
146- password : ${{ secrets.pypi_password }}
194+ password : ${{ secrets.pypi_password }}
0 commit comments