@@ -28,7 +28,7 @@ concurrency:
2828
2929jobs :
3030 build_wheels :
31- name : Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}-${{ matrix.manylinux_image }}
31+ name : Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
3232 if : github.repository == 'scikit-learn/scikit-learn-release'
3333 runs-on : ${{ matrix.os }}
3434 defaults :
@@ -39,58 +39,270 @@ jobs:
3939 fail-fast : false
4040 matrix :
4141 include :
42+ # Window 64 bit
43+ - os : windows-latest
44+ python : 311
45+ platform_id : win_amd64
46+ - os : windows-latest
47+ python : 312
48+ platform_id : win_amd64
49+ - os : windows-latest
50+ python : 313
51+ platform_id : win_amd64
52+ - os : windows-latest
53+ python : 314
54+ platform_id : win_amd64
55+ - os : windows-latest
56+ python : 314t
57+ platform_id : win_amd64
58+
59+ # Windows on ARM64 (WoA)
60+ - os : windows-11-arm
61+ python : 311
62+ platform_id : win_arm64
63+ - os : windows-11-arm
64+ python : 312
65+ platform_id : win_arm64
66+ - os : windows-11-arm
67+ python : 313
68+ platform_id : win_arm64
69+ - os : windows-11-arm
70+ python : 314
71+ platform_id : win_arm64
72+ - os : windows-11-arm
73+ python : 314t
74+ platform_id : win_arm64
4275
43- # Linux
76+ # Linux
77+ - os : ubuntu-latest
78+ python : 311
79+ platform_id : manylinux_x86_64
80+ - os : ubuntu-latest
81+ python : 312
82+ platform_id : manylinux_x86_64
83+ - os : ubuntu-latest
84+ python : 313
85+ platform_id : manylinux_x86_64
86+ - os : ubuntu-latest
87+ python : 314
88+ platform_id : manylinux_x86_64
4489 - os : ubuntu-latest
4590 python : 314t
4691 platform_id : manylinux_x86_64
47- manylinux_image : manylinux_2_28
92+
93+ # Linux arm
94+ - os : ubuntu-24.04-arm
95+ python : 311
96+ platform_id : manylinux_aarch64
97+ - os : ubuntu-24.04-arm
98+ python : 312
99+ platform_id : manylinux_aarch64
100+ - os : ubuntu-24.04-arm
101+ python : 313
102+ platform_id : manylinux_aarch64
103+ - os : ubuntu-24.04-arm
104+ python : 314
105+ platform_id : manylinux_aarch64
106+ - os : ubuntu-24.04-arm
107+ python : 314t
108+ platform_id : manylinux_aarch64
109+
110+ # MacOS x86_64
111+ - os : macos-15-intel
112+ python : 311
113+ platform_id : macosx_x86_64
114+ - os : macos-15-intel
115+ python : 312
116+ platform_id : macosx_x86_64
117+ - os : macos-15-intel
118+ python : 313
119+ platform_id : macosx_x86_64
120+ - os : macos-15-intel
121+ python : 314
122+ platform_id : macosx_x86_64
123+ - os : macos-15-intel
124+ python : 314t
125+ platform_id : macosx_x86_64
126+
127+ # MacOS arm64
128+ - os : macos-14
129+ python : 311
130+ platform_id : macosx_arm64
131+ - os : macos-14
132+ python : 312
133+ platform_id : macosx_arm64
134+ - os : macos-14
135+ python : 313
136+ platform_id : macosx_arm64
137+ - os : macos-14
138+ python : 314
139+ platform_id : macosx_arm64
140+ - os : macos-14
141+ python : 314t
142+ platform_id : macosx_arm64
48143
49144 steps :
50145 - name : Checkout scikit-learn-release
51146 uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
52147 with :
53148 persist-credentials : false
54149
55- - name : Checkout scikit-learn-release
150+ - name : Checkout scikit-learn
56151 uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
57152 with :
58153 repository : scikit-learn/scikit-learn
59154 ref : ${{ env.SOURCE_REF_TO_BUILD }}
60155 path : scikit-learn-src
61156 persist-credentials : false
62157
158+ - uses : mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
159+ if : ${{ startsWith(matrix.platform_id, 'macosx') }}
160+ with :
161+ micromamba-version : ' 2.8.1-0'
162+
163+ - name : Set-up macOS
164+ if : ${{ startsWith(matrix.platform_id, 'macosx') }}
165+ run : bash tools/configure_macos_env.sh
166+
167+ - name : Set SOURCE_DATE_EPOCH from source commit
168+ run : |
169+ echo "SOURCE_DATE_EPOCH=$(git -C scikit-learn-src log -1 --pretty=%ct)" >> "$GITHUB_ENV"
170+
63171 - name : Build and test wheels
172+ uses : pypa/cibuildwheel@f03ac7617d6cff873ccf24cc0d567ef5ba5a9e6d # v4.0.0
64173 env :
65- CIBW_ENVIRONMENT : SKLEARN_SKIP_NETWORK_TESTS=1
66174 CIBW_BUILD : cp${{ matrix.python }}-${{ matrix.platform_id }}
67- CIBW_ARCHS : all
68- CIBW_MANYLINUX_X86_64_IMAGE : ${{ matrix.manylinux_image }}
69- CIBW_MANYLINUX_I686_IMAGE : ${{ matrix.manylinux_image }}
70- # Needed on Windows CI to compile with Visual Studio compiler
71- # otherwise Meson detects a MINGW64 platform and use MINGW64
72- # toolchain
73- # CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv"
74- # CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: bash build_tools/github/repair_windows_wheels.sh {wheel} {dest_dir}
75- # CIBW_BEFORE_BUILD: bash {project}/build_tools/wheels/cibw_before_build.sh {project}
76- # CIBW_BEFORE_TEST_WINDOWS: bash build_tools/github/build_minimal_windows_image.sh ${{ matrix.python }} ${{matrix.platform_id}}
77- CIBW_ENVIRONMENT_PASS_LINUX : RUNNER_OS
78- # TODO Put back pandas when there is a pandas release with Python 3.14 wheels
79- # CIBW_TEST_REQUIRES: ${{ contains(matrix.python, '314') && 'pytest' || 'pytest pandas' }} scipy
80- # On Windows, we use a custom Docker image and CIBW_TEST_REQUIRES_WINDOWS
81- # does not make sense because it would install dependencies in the host
82- # rather than inside the Docker image
83- CIBW_TEST_REQUIRES_WINDOWS : " "
84- # CIBW_TEST_COMMAND: bash {project}/build_tools/wheels/test_wheels.sh {project}
85- # CIBW_TEST_COMMAND_WINDOWS: bash {project}/build_tools/github/test_windows_wheels.sh ${{ matrix.python }} {project} ${{matrix.platform_id}}
86- CIBW_BUILD_VERBOSITY : 1
87- run : |
88- cd scikit-learn-src
89- python -m pip install cibuildwheel
90- python -m cibuildwheel --output-dir wheelhouse
175+ CIBW_BEFORE_TEST_WINDOWS : bash tools/build_minimal_windows_image.sh ${{ matrix.python }} ${{ matrix.platform_id }}
176+ CIBW_TEST_COMMAND_WINDOWS : bash {project}/tools/test_windows_wheels.sh ${{ matrix.python }} {project} ${{ matrix.platform_id }}
177+ SOURCE_DATE_EPOCH : ${{ env.SOURCE_DATE_EPOCH }}
178+ PYTHONHASHSEED : " 0"
179+ CIBW_ENVIRONMENT_PASS_LINUX : SOURCE_DATE_EPOCH PYTHONHASHSEED RUNNER_OS
180+ with :
181+ package-dir : scikit-learn-src
182+ output-dir : dist
183+ config-file : cibuildwheel.toml
91184
92185 - name : Store artifacts
93- uses : actions/upload-artifact@v7
186+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
94187 with :
95188 name : cibw-wheels-cp${{ matrix.python }}-${{ matrix.platform_id }}
96- path : scikit-learn-src/wheelhouse/*.whl
189+ path : ./dist/*.whl
190+
191+ build_sdist :
192+ name : Source distribution
193+ runs-on : ubuntu-latest
194+
195+ steps :
196+ - name : Checkout scikit-learn-release
197+ uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
198+ with :
199+ persist-credentials : false
200+
201+ - name : Checkout scikit-learn
202+ uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
203+ with :
204+ repository : scikit-learn/scikit-learn
205+ ref : ${{ env.SOURCE_REF_TO_BUILD }}
206+ path : scikit-learn-src
207+ persist-credentials : false
208+
209+ - name : Setup Python
210+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
211+ with :
212+ python-version : " 3.12"
213+
214+ - name : Build source distribution
215+ run : bash tools/build_source.sh
216+
217+ - name : Test source distribution
218+ run : bash tools/test_source.sh
219+
220+ - name : Store artifacts
221+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
222+ with :
223+ name : cibw-sdist
224+ path : dist/*.tar.gz
225+
226+ testpypi-publish :
227+ name : Publish release to TestPyPI
228+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi'
229+ runs-on : ubuntu-latest
230+ needs : [build_wheels, build_sdist]
231+ environment :
232+ name : testpypi
233+ url : https://test.pypi.org/p/scikit-learn
234+ permissions :
235+ id-token : write # mandatory for trusted publishing
236+ steps :
237+ - name : Download sdist and wheels
238+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
239+ with :
240+ path : dist
241+ merge-multiple : true
242+
243+ - name : View artifacts
244+ run : ls dist
245+
246+ # - name: Publish
247+ # uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
248+ # with:
249+ # repository-url: https://test.pypi.org/legacy/
250+ # skip-existing: true
251+ # print-hash: true
252+ # attestations: true
253+
254+ nightly_upload :
255+ name : Nightly upload
256+ if : github.repository == 'scikit-learn/scikit-learn-release' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'none'))
257+ runs-on : ubuntu-latest
258+ needs : [build_wheels]
259+
260+ steps :
261+ - name : Download sdist and wheels
262+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
263+ with :
264+ path : dist
265+ merge-multiple : true
266+
267+ - name : Install micromamba
268+ uses : mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
269+ with :
270+ # For installation of anaconda-client, required for upload to anaconda.org
271+ init-shell : bash
272+ environment-name : upload-env
273+ create-args : >-
274+ anaconda-client
275+
276+ # - name: Upload to anaconda.org
277+ # shell: bash -el {0} # required for micromamba
278+ # env:
279+ # TOKEN: ${{ secrets.SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN }}
280+ # run: |
281+ # anaconda -q -t ${TOKEN} upload --force -u scientific-python-nightly-wheels ./dist/*.whl
282+
283+ pypi-publish :
284+ name : Publish release to PyPI
285+ if : github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
286+ runs-on : ubuntu-latest
287+ needs : [build_wheels, build_sdist]
288+ environment :
289+ name : pypi
290+ url : https://pypi.org/p/scikit-learn
291+ permissions :
292+ id-token : write # mandatory for trusted publishing
293+ steps :
294+ - name : Download sdist and wheels
295+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
296+ with :
297+ path : dist
298+ merge-multiple : true
299+
300+ - name : View artifacts
301+ run : ls dist
302+
303+ # - name: Publish
304+ # uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
305+ # with:
306+ # print-hash: true
307+ # attestations: true
308+
0 commit comments