Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Linux platform wheels with cibuildwheel #562

Draft
wants to merge 14 commits into
base: devel
Choose a base branch
from
87 changes: 87 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,93 @@ jobs:
|| 'false'
}}

build-bin-manylinux-tested-arches-cibuildwheel:
name: >-
[cibuildwheel] 📦 ${{ needs.pre-setup.outputs.git-tag }}
[mode: ${{
fromJSON(needs.pre-setup.outputs.is-untagged-devel)
&& 'nightly' || ''
}}${{
fromJSON(needs.pre-setup.outputs.release-requested)
&& 'release' || ''
}}${{
(
!fromJSON(needs.pre-setup.outputs.is-untagged-devel)
&& !fromJSON(needs.pre-setup.outputs.release-requested)
) && 'test' || ''
}}] manylinux
needs:
- build-src
- pre-setup # transitive, for accessing settings
strategy:
matrix:
os:
- ubuntu-latest
wheel-tags-to-skip:
- >-
${{
!fromJSON(needs.pre-setup.outputs.release-requested)
&& '*_i686
*-macosx_universal2
*-musllinux_*
*-win32
*_arm64
*-*linux_{aarch64,ppc64le,s390x}
pp*'
|| ''
}}
- >-
${{
!fromJSON(needs.pre-setup.outputs.release-requested)
&& '*_i686
*-macosx_universal2
*-musllinux_*
*-win32
*_arm64
*-*linux_{x86_64,ppc64le,s390x}
pp*'
|| ''
}}
- >-
${{
!fromJSON(needs.pre-setup.outputs.release-requested)
&& '*_i686
*-macosx_universal2
*-musllinux_*
*-win32
*_arm64
*-*linux_{x86_64,aarch64,s390x}
pp*'
|| ''
}}
- >-
${{
!fromJSON(needs.pre-setup.outputs.release-requested)
&& '*_i686
*-macosx_universal2
*-musllinux_*
*-win32
*_arm64
*-*linux_{x86_64,aarch64,ppc64le}
pp*'
|| ''
}}
uses: ./.github/workflows/reusable-cibuildwheel.yml
with:
os: ${{ matrix.os }}
wheel-tags-to-skip: ${{ matrix.wheel-tags-to-skip }}
source-tarball-name: >-
${{ needs.pre-setup.outputs.sdist-artifact-name }}
dists-artifact-name: >-
${{ needs.pre-setup.outputs.dists-artifact-name }}
qemu: all
cython-tracing: >- # Cython line tracing for coverage collection
${{
fromJSON(needs.pre-setup.outputs.profiling-enabled)
&& 'true'
|| 'false'
}}

build-bin-manylinux-tested-arches:
name: >-
📦 ${{ needs.pre-setup.outputs.git-tag }}
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/reusable-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jobs:
echo "CIBW_ARCHS_LINUX=${{ inputs.qemu }}" >> "${GITHUB_ENV}"
shell: bash

# - name: Skip building some wheel tags
# if: inputs.wheel-tags-to-skip
# run: |
# echo "CIBW_SKIP=${{ inputs.wheel-tags-to-skip }}" >> "${GITHUB_ENV}"
# shell: bash
- name: Skip building some wheel tags
if: inputs.wheel-tags-to-skip
run: |
echo "CIBW_SKIP=${{ inputs.wheel-tags-to-skip }}" >> "${GITHUB_ENV}"
shell: bash

- name: Build wheels
uses: pypa/[email protected]
Expand All @@ -79,6 +79,7 @@ jobs:
CIBW_ARCHS_MACOS: native
CIBW_CONFIG_SETTINGS: >- # Cython line tracing for coverage collection
with-cython-tracing=${{ inputs.cython-tracing }}
timeout-minutes: 120

- name: Upload built artifacts for testing and publishing
uses: actions/upload-artifact@v3
Expand Down
28 changes: 27 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ profile = "True"
[tool.cibuildwheel]
build-frontend = "build"
test-requires = "pytest pytest-cov pytest-xdist pytest-forked"
test-command = "python -Im pytest -m smoke --no-cov {project}/tests"
test-command = "python -Im pytest -m smoke --no-cov -n 0 {project}/tests"
skip = "pp*"

[tool.cibuildwheel.environment]
Expand All @@ -158,6 +158,32 @@ PIP_NO_WARN_SCRIPT_LOCATION = "1"
PRE_COMMIT_COLOR = "always"
PY_COLORS = "1"

[tool.cibuildwheel.linux]
before-build = [
"env",
"export",
]
manylinux-aarch64-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_aarch64:libssh-v0.9.6"
manylinux-ppc64le-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_ppc64le:libssh-v0.9.6"
manylinux-s390x-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_s390x:libssh-v0.9.6"
manylinux-x86_64-image = "ghcr.io/ansible/pylibssh-manylinux_2_28_x86_64:libssh-v0.9.6"
skip = [
"*-musllinux_*", # FIXME: musllinux needs us to provide with containers pre-built libssh
"pp*", # FIXME: we don't ship these currently but could

# The support for 32-bit wheels has been dropped long ago:
"*-manylinux_i686",
"*-musllinux_i686",
]

[tool.cibuildwheel.linux.environment]
STATIC_DEPS_DIR = "$(cat /root/.static-deps-path)"
# LDFLAGS = "'-L${STATIC_DEPS_PREFIX}/lib64' '-L${STATIC_DEPS_PREFIX}/lib'"
# LD_LIBRARY_PATH = "${STATIC_DEPS_PREFIX}/lib64:${STATIC_DEPS_PREFIX}/lib:${LD_LIBRARY_PATH}"
CFLAGS="'-I$(cat /root/.static-deps-path)/include'"
LDFLAGS = "'-L$(cat /root/.static-deps-path)/lib64' '-L$(cat /root/.static-deps-path)/lib'"
LD_LIBRARY_PATH = "$(cat /root/.static-deps-path)/lib64:$(cat /root/.static-deps-path)/lib:${LD_LIBRARY_PATH}"

[tool.cibuildwheel.macos]
before-build = [
"brew install libssh", # @0.9.4 # pinning the version does not work
Expand Down
Loading