@@ -19,48 +19,62 @@ jobs:
1919 strategy :
2020 fail-fast : false
2121 matrix :
22- os : [ubuntu-20.04, macos-latest, windows-latest]
23- python-version : ["3.8", "3.9", "3.10", "3.11"]
24-
25- steps :
26- - uses : actions/checkout@v2
22+ os : [windows-latest, ubuntu-latest, macos-13, macos-14]
23+ versions :
24+ - { python: "3.8", numpy: 1.22.4 }
25+ - { python: "3.9", numpy: 1.22.4 }
26+ - { python: "3.10", numpy: 1.22.4 }
27+ - { python: "3.11", numpy: 1.24.3 }
28+ - { python: "3.12", numpy: 1.26.4 }
2729
28- - name : Set up Python
29- uses : actions/setup-python@v2
30+ steps :
31+ - uses : actions/checkout@v4
32+
33+ - name : Setup Python ${{ matrix.versions.python }}
34+ if : ${{ (matrix.os != 'macos-14') || ((matrix.os == 'macos-14') && (matrix.versions.python != '3.8') && (matrix.versions.python != '3.9')) }}
35+ uses : actions/setup-python@v5
36+ id : pysetup
3037 with :
31- python-version : ${{ matrix.python-version }}
38+ python-version : ${{ matrix.versions.python }}
39+ cache : ' pip'
3240
33- - name : Display Python version
34- run : python -c "import sys; print(sys.version)"
35-
36- - name : Install numpy for Python 3.8
37- if : matrix.python-version == '3.8'
38- run : python -m pip install numpy==1.20.3
39-
40- - name : Install numpy for Python 3.9
41- if : matrix.python-version == '3.9'
42- run : python -m pip install numpy==1.20.3
41+ - name : Setup Python 3.8-3.9 - macos-arm
42+ if : ${{ (matrix.os == 'macos-14') && ((matrix.versions.python == '3.8') || (matrix.versions.python == '3.9')) }}
43+ run : |
44+ brew update
45+ brew install python@${{ matrix.versions.python }}
46+ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
47+ python${{ matrix.versions.python }} get-pip.py
4348
44- - name : Install numpy for Python 3.10
45- if : matrix.python-version == '3.10'
46- run : python -m pip install numpy==1.22.4
49+ - name : Create Python alias for Windows
50+ if : matrix.os == 'windows-latest'
51+ run : |
52+ $newPath = "${{ steps.pysetup.outputs.python-path }}".Replace("python.exe", "python${{ matrix.versions.python }}.exe")
53+ New-Item -ItemType HardLink -Path "$newPath" -Value "${{ steps.pysetup.outputs.python-path }}"
4754
48- - name : Install numpy for Python 3.11
49- if : matrix.python-version == '3.11'
50- run : python -m pip install numpy==1.24.3
55+ - name : Display Python and Pip versions
56+ run : |
57+ python${{ matrix.versions.python }} -c "import sys; print(sys.version)"
58+ pip --version
5159
60+ - name : Upgrade pip wheel setuptools
61+ run : pip install wheel setuptools pip --upgrade
62+
63+ - name : Install numpy ${{ matrix.versions.numpy }}
64+ run : pip install numpy==${{ matrix.versions.numpy }}
65+
5266 - name : Display numpy version
53- run : python -c "import numpy; print(numpy.__version__)"
67+ run : python${{ matrix.versions.python }} -c "import numpy; print(numpy.__version__)"
5468
5569 - name : Install other dependencies
5670 run : |
57- python -m pip install scipy Cython wheel
71+ pip install scipy Cython wheel
5872
5973 - name : Build wheels
60- run : python setup.py bdist_wheel
74+ run : python${{ matrix.versions.python }} setup.py bdist_wheel
6175
6276 - name : Rename Linux wheels to supported platform of PyPI
63- if : matrix.os == 'ubuntu-20.04 '
77+ if : matrix.os == 'ubuntu-latest '
6478 run : for f in dist/*.whl; do mv "$f" "$(echo "$f" | sed s/linux/manylinux1/)"; done
6579
6680 - name : Publish wheels to GitHub artifacts
@@ -72,17 +86,17 @@ jobs:
7286
7387 publish-pypi :
7488 needs : [build-wheels]
75- runs-on : ubuntu-20.04
89+ runs-on : ubuntu-latest
7690 steps :
77- - uses : actions/checkout@v2
91+ - uses : actions/checkout@v4
7892
7993 - uses : actions/download-artifact@v2
8094 with :
8195 name : wheels
8296 path : dist/
8397
8498 - name : Set up Python
85- uses : actions/setup-python@v2
99+ uses : actions/setup-python@v5
86100 with :
87101 python-version : " 3.10"
88102
0 commit comments