Skip to content

Commit 60e5e91

Browse files
committed
Add chaining
1 parent 5498042 commit 60e5e91

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on:
2020
description: Which PyPI environment to upload to, if any
2121
required: true
2222
type: choice
23-
options: ["none", "testpypi", "pypi"]
23+
options: ["none", "chain", "testpypi", "pypi"]
2424

2525
concurrency:
2626
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -225,7 +225,7 @@ jobs:
225225

226226
testpypi-publish:
227227
name: Publish release to TestPyPI
228-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi'
228+
if: github.event_name == 'workflow_dispatch' && (github.event.inputs.environment == 'testpypi' || github.event.inputs.environment == 'chain')
229229
runs-on: ubuntu-latest
230230
needs: [build_wheels, build_sdist]
231231
environment:
@@ -255,7 +255,7 @@ jobs:
255255
name: Nightly upload
256256
if: github.repository == 'scikit-learn/scikit-learn-release' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'none'))
257257
runs-on: ubuntu-latest
258-
needs: [build_wheels]
258+
needs: [build_wheels, build_sdist]
259259

260260
steps:
261261
- name: Download sdist and wheels
@@ -282,9 +282,22 @@ jobs:
282282

283283
pypi-publish:
284284
name: Publish release to PyPI
285-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
285+
if: >-
286+
github.event_name == 'workflow_dispatch'
287+
&& (
288+
github.event.inputs.environment == 'pypi'
289+
|| (
290+
github.event.inputs.environment == 'chain'
291+
&& (needs.testpypi-publish.result == 'success' || needs.testpypi-publish.result == 'skipped')
292+
)
293+
)
286294
runs-on: ubuntu-latest
287-
needs: [build_wheels, build_sdist]
295+
# environment:
296+
# name: pypi
297+
# url: https://pypi.org/p/scikit-learn
298+
# permissions:
299+
# id-token: write # mandatory for trusted publishing
300+
needs: [build_wheels, build_sdist, testpypi-publish]
288301
environment:
289302
name: pypi
290303
url: https://pypi.org/p/scikit-learn

tools/test_wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ python -c "import sklearn; sklearn.show_versions()"
2424

2525
if pip show -qq pytest-xdist; then
2626
XDIST_WORKERS=$(python -c "import joblib; print(joblib.cpu_count(only_physical_cores=True))")
27-
# TODO(thomasjpfan): use `--pyargs sklearn`
27+
# TODO: use `--pyargs sklearn`
2828
pytest --pyargs sklearn.tests.test_dummy -n $XDIST_WORKERS
2929
else
30-
# TODO(thomasjpfan): use `--pyargs sklearn`
30+
# TODO: use `--pyargs sklearn`
3131
pytest --pyargs sklearn.tests.test_dummy
3232
fi

tools/test_windows_wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ if [[ $FREE_THREADED_BUILD == "False" ]]; then
1818
if [[ "$PLATFORM_ID" == "win_arm64" ]]; then
1919
echo "Running tests locally on Windows on ARM64 (WoA) as no Docker support on WoA GHA runner"
2020
python -c "import sklearn; sklearn.show_versions()"
21-
# TODO(thomasjpfan): use `--pyargs sklearn`
21+
# TODO: use `--pyargs sklearn`
2222
pytest --pyargs sklearn.tests.test_dummy
2323
else
2424
echo "Running tests in Docker on Windows x86_64"
2525
docker container run \
2626
--rm scikit-learn/minimal-windows \
2727
powershell -Command "python -c 'import sklearn; sklearn.show_versions()'"
2828

29-
# TODO(thomasjpfan): use `--pyargs sklearn`
29+
# TODO: use `--pyargs sklearn`
3030
docker container run \
3131
-e SKLEARN_SKIP_NETWORK_TESTS=1 \
3232
--rm scikit-learn/minimal-windows \
@@ -36,6 +36,6 @@ else
3636
# This is too cumbersome to use a Docker image in the free-threaded case
3737
export PYTHON_GIL=0
3838
python -c "import sklearn; sklearn.show_versions()"
39-
# TODO(thomasjpfan): use `--pyargs sklearn`
39+
# TODO: use `--pyargs sklearn`
4040
pytest --pyargs sklearn.tests.test_dummy
4141
fi

0 commit comments

Comments
 (0)