4
4
# In an attempt to save CI resources, wheel builds do
5
5
# not run on each push but only weekly and for releases.
6
6
# Wheel builds can be triggered from the Actions page
7
- # (if you have the perms ) on a commit to master .
7
+ # (if you have the permissions ) on a commit to main .
8
8
#
9
9
# Alternatively, you can add labels to the pull request in order to trigger wheel
10
10
# builds.
@@ -14,13 +14,8 @@ name: Wheel builder
14
14
15
15
on :
16
16
schedule :
17
- # ┌───────────── minute (0 - 59)
18
- # │ ┌───────────── hour (0 - 23)
19
- # │ │ ┌───────────── day of the month (1 - 31)
20
- # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
21
- # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
22
- # │ │ │ │ │
23
- - cron : " 27 3 */1 * *"
17
+ # 3:27 UTC every day
18
+ - cron : " 27 3 * * *"
24
19
push :
25
20
pull_request :
26
21
types : [labeled, opened, synchronize, reopened]
@@ -37,170 +32,136 @@ permissions:
37
32
contents : read
38
33
39
34
jobs :
40
- build_wheels :
41
- name : Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
35
+ build_sdist :
36
+ name : Build sdist
42
37
if : >-
43
38
(github.event_name == 'schedule' && github.repository_owner == 'pandas-dev') ||
44
39
github.event_name == 'workflow_dispatch' ||
45
40
(github.event_name == 'pull_request' &&
46
41
contains(github.event.pull_request.labels.*.name, 'Build')) ||
47
42
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
48
- runs-on : ${{ matrix.buildplat[0] }}
49
- strategy :
50
- # Ensure that a wheel builder finishes even if another fails
51
- fail-fast : false
52
- matrix :
53
- # GitHub Actions doesn't support pairing matrix values together, let's improvise
54
- # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
55
- buildplat :
56
- - [ubuntu-20.04, manylinux_x86_64]
57
- - [macos-11, macosx_*]
58
- - [windows-2019, win_amd64]
59
- # TODO: support PyPy?
60
- python : [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp39"]
43
+ runs-on : ubuntu-22.04
61
44
env :
62
45
IS_PUSH : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
63
46
IS_SCHEDULE_DISPATCH : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
47
+ outputs :
48
+ sdist_file : ${{ steps.save-path.outputs.sdist_name }}
64
49
steps :
65
50
- name : Checkout pandas
66
51
uses : actions/checkout@v3
67
52
with :
68
- submodules : true
69
- # versioneer.py requires the latest tag to be reachable. Here we
70
- # fetch the complete history to get access to the tags.
71
- # A shallow clone can work when the following issue is resolved:
72
- # https://github.com/actions/checkout/issues/338
73
53
fetch-depth : 0
74
54
75
- - name : Build wheels
76
-
77
- env :
78
- CIBW_BUILD : ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
79
-
80
- # Used to test(Windows-only) and push the built wheels
81
- # You might need to use setup-python separately
82
- # if the new Python-dev version
83
- # is unavailable on conda-forge.
84
- - uses : conda-incubator/setup-miniconda@v2
55
+ - name : Set up Python
56
+ uses : actions/setup-python@v4
85
57
with :
86
- auto-update-conda : true
87
- python-version : ${{ matrix.python[1] }}
88
- activate-environment : test
89
- channels : conda-forge, anaconda
90
- channel-priority : true
91
- # mamba fails to solve, also we really don't need this since we're just installing python
92
- # mamba-version: "*"
93
-
94
- - name : Test wheels (Windows 64-bit only)
95
- if : ${{ matrix.buildplat[1] == 'win_amd64' }}
96
- shell : cmd /C CALL {0}
58
+ python-version : ' 3.11'
59
+
60
+ - name : Build sdist
97
61
run : |
98
- python ci/test_wheels.py wheelhouse
62
+ python -m pip install build
63
+ python -m build --sdist
99
64
100
65
- uses : actions/upload-artifact@v3
101
66
with :
102
- name : ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
103
- path : ./wheelhouse/*.whl
104
-
67
+ name : sdist
68
+ path : ./dist/*
105
69
106
- - name : Install anaconda client
107
- if : ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
70
+ - name : Output sdist name
71
+ id : save-path
108
72
shell : bash -el {0}
109
- run : conda install -q -y anaconda-client
73
+ run : echo "sdist_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
110
74
111
-
112
- - name : Upload wheels
113
- if : ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
114
- shell : bash -el {0}
115
- env :
116
- PANDAS_STAGING_UPLOAD_TOKEN : ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
117
- PANDAS_NIGHTLY_UPLOAD_TOKEN : ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
118
- run : |
119
- source ci/upload_wheels.sh
120
- set_upload_vars
121
- # trigger an upload to
122
- # https://anaconda.org/scipy-wheels-nightly/pandas
123
- # for cron jobs or "Run workflow" (restricted to main branch).
124
- # Tags will upload to
125
- # https://anaconda.org/multibuild-wheels-staging/pandas
126
- # The tokens were originally generated at anaconda.org
127
- upload_wheels
128
- build_sdist :
129
- name : Build sdist
75
+ build_wheels :
76
+ needs : build_sdist
77
+ name : Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
130
78
if : >-
131
- github.event_name == 'schedule' ||
79
+ ( github.event_name == 'schedule' && github.repository_owner == 'pandas-dev') ||
132
80
github.event_name == 'workflow_dispatch' ||
133
81
(github.event_name == 'pull_request' &&
134
82
contains(github.event.pull_request.labels.*.name, 'Build')) ||
135
83
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
136
- runs-on : ubuntu-22.04
84
+ runs-on : ${{ matrix.buildplat[0] }}
85
+ strategy :
86
+ fail-fast : false
87
+ matrix :
88
+ # GitHub Actions doesn't support pairing matrix values together, let's improvise
89
+ # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
90
+ buildplat :
91
+ - [ubuntu-22.04, manylinux_x86_64]
92
+ - [ubuntu-22.04, musllinux_x86_64]
93
+ - [macos-12, macosx_*]
94
+ - [windows-2022, win_amd64]
95
+ # TODO: support PyPy?
96
+ python : [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]
137
97
env :
138
98
IS_PUSH : ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
139
99
IS_SCHEDULE_DISPATCH : ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
140
100
steps :
141
101
- name : Checkout pandas
142
102
uses : actions/checkout@v3
143
103
with :
144
- submodules : true
145
- # versioneer.py requires the latest tag to be reachable. Here we
146
- # fetch the complete history to get access to the tags.
147
- # A shallow clone can work when the following issue is resolved:
148
- # https://github.com/actions/checkout/issues/338
149
104
fetch-depth : 0
150
105
151
- # Used to push the built sdist
152
- - uses : conda-incubator/setup-miniconda@v2
106
+ - name : Download sdist
107
+ uses : actions/download-artifact@v3
153
108
with :
154
- auto-update-conda : true
155
- # Really doesn't matter what version we upload with
156
- # just the version we test with
157
- python-version : ' 3.10'
158
- channels : conda-forge
159
- channel-priority : true
160
- # mamba fails to solve, also we really don't need this since we're just installing python
161
- # mamba-version: "*"
109
+ name : sdist
110
+ path : ./dist
162
111
163
- - name : Build sdist
164
- run : |
165
- pip install build
166
- python -m build --sdist
167
- - name : Test the sdist
168
- shell : bash -el {0}
169
- run : |
170
- # TODO: Don't run test suite, and instead build wheels from sdist
171
- # by splitting the wheel builders into a two stage job
172
- # (1. Generate sdist 2. Build wheels from sdist)
173
- # This tests the sdists, and saves some build time
174
- python -m pip install dist/*.gz
175
- pip install hypothesis>=6.46.1 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
176
- cd .. # Not a good idea to test within the src tree
177
- python -c "import pandas; print(pandas.__version__);
178
- pandas.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2']);
179
- pandas.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db'])"
180
- - uses : actions/upload-artifact@v3
112
+ - name : Build wheels
113
+
181
114
with :
182
- name : sdist
183
- path : ./dist/*
115
+ package-dir : ./dist/${{ needs.build_sdist.outputs.sdist_file }}
116
+ env :
117
+ CIBW_BUILD : ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
184
118
185
- - name : Install anaconda client
186
- if : ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
119
+ - name : Set up Python
120
+ uses : mamba-org/setup-micromamba@v1
121
+ with :
122
+ environment-name : wheel-env
123
+ create-args : >-
124
+ python=${{ matrix.python[1] }}
125
+ anaconda-client
126
+ wheel
127
+ cache-downloads : true
128
+ cache-environment : true
129
+
130
+ - name : Validate wheel RECORD
187
131
shell : bash -el {0}
132
+ run : for whl in $(ls wheelhouse); do wheel unpack wheelhouse/$whl -d /tmp; done
133
+
134
+ # Testing on windowsservercore instead of GHA runner to fail on missing DLLs
135
+ - name : Test Windows Wheels
136
+ if : ${{ matrix.buildplat[1] == 'win_amd64' }}
137
+ shell : pwsh
188
138
run : |
189
- conda install -q -y anaconda-client
139
+ $TST_CMD = @"
140
+ python -m pip install pytz six numpy python-dateutil tzdata>=2022.1 hypothesis>=6.46.1 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17;
141
+ python -m pip install --find-links=pandas\wheelhouse --no-index pandas;
142
+ python -c `'import pandas as pd; pd.test()`';
143
+ "@
144
+ docker pull python:${{ matrix.python[1] }}-windowsservercore
145
+ docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] }}-windowsservercore powershell -Command $TST_CMD
146
+
147
+ - uses : actions/upload-artifact@v3
148
+ with :
149
+ name : ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
150
+ path : ./wheelhouse/*.whl
190
151
191
- - name : Upload sdist
152
+ - name : Upload wheels & sdist
192
153
if : ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
193
154
shell : bash -el {0}
194
155
env :
195
156
PANDAS_STAGING_UPLOAD_TOKEN : ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
196
157
PANDAS_NIGHTLY_UPLOAD_TOKEN : ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
158
+ # trigger an upload to
159
+ # https://anaconda.org/scipy-wheels-nightly/pandas
160
+ # for cron jobs or "Run workflow" (restricted to main branch).
161
+ # Tags will upload to
162
+ # https://anaconda.org/multibuild-wheels-staging/pandas
163
+ # The tokens were originally generated at anaconda.org
197
164
run : |
198
165
source ci/upload_wheels.sh
199
166
set_upload_vars
200
- # trigger an upload to
201
- # https://anaconda.org/scipy-wheels-nightly/pandas
202
- # for cron jobs or "Run workflow" (restricted to main branch).
203
- # Tags will upload to
204
- # https://anaconda.org/multibuild-wheels-staging/pandas
205
- # The tokens were originally generated at anaconda.org
206
167
upload_wheels
0 commit comments