Skip to content

Commit b976531

Browse files
authored
PYTHON-4079 Generate ManyLinux2014 and ManyLinux1 Wheels (#1454)
1 parent 9d32a09 commit b976531

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/release-python.yml

+49-2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
platforms: all
6464

6565
- name: Install cibuildwheel
66+
# Note: the default manylinux is manylinux2014
6667
run: python -m pip install "cibuildwheel>=2.4,<3"
6768

6869
- name: Build MacOS Py37 Wheel
@@ -75,7 +76,7 @@ jobs:
7576
CIBW_TEST_COMMAND: "python {project}/tools/fail_if_no_c.py"
7677
run: python -m cibuildwheel --output-dir wheelhouse
7778

78-
- name: Build wheels
79+
- name: Build wheel
7980
if: ${{ matrix.python != 'cp37' || matrix.buildplat[0] != 'macos-11' }}
8081
env:
8182
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
@@ -87,6 +88,52 @@ jobs:
8788
path: ./wheelhouse/*.whl
8889
if-no-files-found: error
8990

91+
build_manylinux1_wheels:
92+
runs-on: ubuntu-latest
93+
strategy:
94+
# Ensure that a wheel builder finishes even if another fails
95+
fail-fast: false
96+
matrix:
97+
python: ["cp37", "cp38", "cp39"]
98+
steps:
99+
- name: Checkout pymongo
100+
uses: actions/checkout@v3
101+
with:
102+
fetch-depth: 0
103+
104+
- name: Set up python version
105+
run: |
106+
export PYTHON_VERSION=$(sed 's/^cp3/3./' <<< ${{ matrix.python }} )
107+
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
108+
109+
- uses: actions/setup-python@v4
110+
with:
111+
python-version: ${{env.PYTHON_VERSION}}
112+
cache: 'pip'
113+
cache-dependency-path: 'pyproject.toml'
114+
allow-prereleases: true
115+
116+
- name: Install cibuildwheel
117+
run: python -m pip install "cibuildwheel>=2.4,<3"
118+
119+
- name: Build manylinux_x86_64
120+
env:
121+
CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64
122+
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
123+
run: python -m cibuildwheel --output-dir wheelhouse
124+
125+
- name: Build manylinux_i686
126+
env:
127+
CIBW_BUILD: ${{ matrix.python }}-manylinux_i686
128+
CIBW_MANYLINUX_I686_IMAGE: manylinux1
129+
run: python -m cibuildwheel --output-dir wheelhouse
130+
131+
- uses: actions/upload-artifact@v3
132+
with:
133+
name: wheel-${{ matrix.python }}-manylinux1
134+
path: ./wheelhouse/*.whl
135+
if-no-files-found: error
136+
90137
make_sdist:
91138
name: Make SDist
92139
runs-on: macos-latest
@@ -119,7 +166,7 @@ jobs:
119166

120167
collect_dist:
121168
runs-on: ubuntu-latest
122-
needs: [build_wheels, make_sdist]
169+
needs: [build_wheels, build_manylinux1_wheels, make_sdist]
123170
name: Download Wheels
124171
steps:
125172
- name: Download all workflow run artifacts

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ test-command = "python {project}/tools/fail_if_no_c.py"
232232

233233
[tool.cibuildwheel.linux]
234234
archs = "x86_64 aarch64 ppc64le s390x i686"
235-
manylinux-x86_64-image = "manylinux_2_28"
236235

237236
[tool.cibuildwheel.macos]
238237
archs = "universal2"

0 commit comments

Comments
 (0)