Skip to content

Commit 6cf13f3

Browse files
authored
CI: Build sdist again on macOS (pandas-dev#54411)
* Update wheels.yml * Update wheels.yml
1 parent e7a190e commit 6cf13f3

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/wheels.yml

+26-5
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,42 @@ jobs:
104104
with:
105105
fetch-depth: 0
106106

107+
# TODO: Build wheels from sdist again
108+
# There's some sort of weird race condition?
109+
# within Github that makes the sdist be missing files
110+
107111
# We need to build wheels from the sdist since the sdist
108112
# removes unnecessary files from the release
109-
- name: Download sdist
113+
- name: Download sdist (not macOS)
114+
if: ${{ matrix.buildplat[1] != 'macosx_*' }}
110115
uses: actions/download-artifact@v3
111116
with:
112117
name: sdist
113118
path: ./dist
114119

120+
- name: Set up Python (macOS)
121+
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
122+
uses: actions/setup-python@v4
123+
with:
124+
python-version: '3.11'
125+
126+
# Python version used to build sdist doesn't matter
127+
# wheel will be built from sdist with the correct version
128+
- name: Build sdist (macOS)
129+
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
130+
run: |
131+
python -m pip install build
132+
python -m build --sdist
133+
134+
- name: Output sdist name (macOS)
135+
id: save-path
136+
shell: bash -el {0}
137+
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"
138+
115139
- name: Build wheels
116140
uses: pypa/[email protected]
117-
# TODO: Build wheels from sdist again
118-
# There's some sort of weird race condition?
119-
# within Github that makes the sdist be missing files
120141
with:
121-
package-dir: ./dist/${{ needs.build_sdist.outputs.sdist_file }}
142+
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
122143
env:
123144
CIBW_PRERELEASE_PYTHONS: True
124145
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

0 commit comments

Comments
 (0)