@@ -18,79 +18,76 @@ concurrency:
18
18
19
19
jobs :
20
20
build-and-deploy :
21
- name : Build and Deploy
22
21
strategy :
23
22
matrix :
24
- os : [windows-latest, macos-latest ]
25
- python-version : ['3.7', '3.8', '3.9', '3.10' ]
23
+ python3-minor-version : [7, 8, 9, 10 ]
24
+ os : [macos-latest, ubuntu-latest, windows-latest ]
26
25
defaults :
27
26
run :
28
27
shell : bash
28
+ env :
29
+ PYTHON_VERSION : ${{ format('3.{0}', matrix.python3-minor-version) }}
30
+ PYTHON_EXECUTABLE : ${{ format('cp3{0}', matrix.python3-minor-version) }}
29
31
30
32
runs-on : ${{ matrix.os }}
33
+ name : Build and Deploy (${{ matrix.os }}, 3.${{ matrix.python3-minor-version }})
31
34
32
35
steps :
33
36
# This LOOKS like it is checking out 'master', but it is using the 'master' version of the checkout action
34
37
# It is actually checking out the most recent version on this branch
35
38
- name : Checkout
36
39
uses : actions/checkout@master
37
40
41
+ # Python interpreter used by cibuildwheel, but it uses a different one internally
38
42
- name : Setting up Python
39
- uses : actions/setup-python@v2
40
- with :
41
- python-version : ${{ matrix.python-version }}
42
-
43
- # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
44
- - name : Checking for cached pip dependencies (macOS)
45
- if : startsWith(runner.os, 'macOS')
46
- uses : actions/cache@v1
43
+ uses : actions/setup-python@v3
47
44
with :
48
- path : ~/Library/Caches/pip
49
- key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
45
+ python-version : ${{ env.PYTHON_VERSION }}
50
46
51
- - name : Checking for cached pip dependencies (Windows)
52
- if : startsWith( runner.os, 'Windows')
53
- uses : actions/cache @v1
47
+ - name : Set up QEMU
48
+ if : runner.os == 'Linux'
49
+ uses : docker/setup-qemu-action @v1
54
50
with :
55
- path : ~\AppData\Local\pip\Cache
56
- key : ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
57
-
58
- - name : Updating pip
59
- run : python -m pip install --upgrade pip
60
-
61
- - name : Installing requirements
62
- run : |
63
- pip install -r build_tools/build_requirements.txt
64
- pip install -r requirements.txt
51
+ platforms : all
65
52
66
53
# We build the source archive separately because of this: https://github.com/alkaline-ml/pmdarima/pull/136#discussion_r279781731
67
54
# We build it first because of this: https://github.com/alkaline-ml/pmdarima/issues/448
68
55
- name : Building source distribution
69
56
run : make version sdist
70
57
71
- - name : Building wheel
72
- run : make version bdist_wheel
73
-
74
- - name : Installing generated wheel
75
- run : pip install --pre --no-index --find-links dist/ pmdarima
76
-
77
- - name : Running unit tests
78
- run : |
79
- if [ "${{ matrix.os }}" == "macos-latest" ]; then
80
- export PMD_MPL_BACKEND=TkAgg
81
- fi
82
- pytest --showlocals --durations=20 --pyargs pmdarima
58
+ - name : Install cibuildwheel
59
+ run : python -m pip install cibuildwheel==2.9.0 # TODO: Do we want this pinned?
83
60
84
- - name : Checking for numpy regression
85
- run : |
86
- pip install --upgrade numpy
87
- if [ "${{ matrix.os }}" == "macos-latest" ]; then
88
- export PMD_MPL_BACKEND=TkAgg
89
- fi
90
- pytest --showlocals --durations=20 --pyargs pmdarima
61
+ - name : Building and testing wheels
62
+ run : python -m cibuildwheel --output-dir dist
63
+ env :
64
+ # TODO: Move Linux x86_64 builds to GHA?
65
+ CIBW_ARCHS_LINUX : " aarch64"
66
+ CIBW_ARCHS_MACOS : " x86_64 arm64"
67
+ CIBW_ARCHS_WINDOWS : " AMD64"
68
+ CIBW_BEFORE_ALL : make version
69
+ CIBW_BEFORE_BUILD : >
70
+ pip install -r build_tools/build_requirements.txt &&
71
+ pip install -r requirements.txt
72
+ # Tests are run in a separate virtual env, so we need to re-install deps
73
+ CIBW_BEFORE_TEST : >
74
+ pip install -r build_tools/build_requirements.txt &&
75
+ pip install -r requirements.txt
76
+ CIBW_BUILD : " ${{ env.PYTHON_EXECUTABLE }}-*"
77
+ CIBW_ENVIRONMENT_MACOS : PMD_MPL_BACKEND=TkAgg PYTHON_CROSSENV=true
78
+ # No support for pypy or musl
79
+ CIBW_SKIP : " pp* *-musllinux_*"
80
+ # Runs tests and checks for a numpy regression by upgrading numpy and running tests again
81
+ CIBW_TEST_COMMAND : >
82
+ pytest --showlocals --durations=20 --pyargs pmdarima &&
83
+ pip install --upgrade numpy &&
84
+ pytest --showlocals --durations=20 --pyargs pmdarima
85
+ # Avoid testing on emulated architectures
86
+ CIBW_TEST_SKIP : " *-*linux_{aarch64,ppc64le,s390x} *-macosx_arm64"
91
87
92
88
- name : Checking README compatibility
93
89
run : |
90
+ python -m pip install "twine>=1.13.0" readme_renderer
94
91
if python -c "from twine.commands.check import check; check(['dist/*'])" | grep "warning"; then
95
92
echo "README will not render properly on PyPI"
96
93
exit 1
@@ -115,57 +112,7 @@ jobs:
115
112
- name : Ensuring sdist can be installed
116
113
run : pip install dist/$(ls dist | grep tar)
117
114
118
- - name : Ensuring VERSION file existis
119
- id : version_check # Need this to refer to output below
120
- run : |
121
- if [ -f "${GITHUB_WORKSPACE}/pmdarima/VERSION" ]; then
122
- echo "VERSION file exists"
123
- echo "::set-output name=version_exists::true"
124
- else
125
- echo "VERSION file does not exist"
126
- echo "::set-output name=version_exists::false"
127
- fi
128
-
129
- - name : Deploying to PyPI
130
- # Only deploy on tags and when VERSION file created
131
- if : startsWith(github.ref, 'refs/tags') && success() && steps.version_check.outputs.version_exists == 'true'
132
- run : |
133
- chmod +x build_tools/github/deploy.sh
134
- ./build_tools/github/deploy.sh
135
- env :
136
- TWINE_USERNAME : ${{ secrets.TWINE_USERNAME }}
137
- TWINE_PASSWORD : ${{ secrets.TWINE_PASSWORD }}
138
-
139
- build-and-deploy-aarch64 :
140
- name : ' Build and Deploy (aarch64)'
141
- runs-on : ubuntu-latest
142
- strategy :
143
- matrix :
144
- python-version : [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
145
- env :
146
- python : /opt/python/${{ matrix.python-version }}/bin/python
147
- image : quay.io/pypa/manylinux_2_28_aarch64
148
- defaults :
149
- run :
150
- shell : bash
151
-
152
- steps :
153
- - name : Checkout
154
- uses : actions/checkout@master
155
-
156
- - name : Setup QEMU
157
- uses : docker/setup-qemu-action@v1
158
-
159
- - name : Build and Test
160
- run : |
161
- chmod +x .github/utils/build_and_test_aarch64.sh
162
- docker run --rm \
163
- -v ${{ github.workspace }}:/workspace \
164
- --workdir=/workspace \
165
- ${{ env.image }} \
166
- .github/utils/build_and_test_aarch64.sh ${{ env.python }}
167
-
168
- - name : Ensuring VERSION file existis
115
+ - name : Ensuring VERSION file exists
169
116
id : version_check # Need this to refer to output below
170
117
run : |
171
118
if [ -f "${GITHUB_WORKSPACE}/pmdarima/VERSION" ]; then
0 commit comments