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

wheels: add arm64 builds #2224

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# * https://github.com/actions/upload-artifact
# * https://github.com/marketplace/actions/cancel-workflow-action
# * https://github.com/vmactions/freebsd-vm
# * https://github.com/marketplace/actions/docker-setup-qemu

on: [push, pull_request]
name: build
Expand All @@ -32,15 +33,17 @@ jobs:
- os: ubuntu-latest
archs: "x86_64 i686"
- os: macos-12
archs: "x86_64 arm64"
archs: "x86_64 arm64 universal2"
- os: windows-2019
archs: "AMD64"
- os: windows-2019
archs: "ARM64"
- os: windows-2019
archs: "x86"

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

Expand All @@ -50,7 +53,7 @@ jobs:
python-version: 3.11

- name: Create wheels + run tests
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.12.1
env:
CIBW_ARCHS: "${{ matrix.archs }}"

Expand All @@ -67,6 +70,45 @@ jobs:
python setup.py sdist
mv dist/psutil*.tar.gz wheelhouse/

py3-qemu:
name: py3-qemu-${{ matrix.os }}-all
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
archs: "aarch64 ppc64le s390x"

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Create wheels + run tests
uses: pypa/[email protected]
env:
CIBW_ARCHS: "${{ matrix.archs }}"
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x}"

- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse

# Linux + macOS + Python 2
py2:
name: py2-${{ matrix.os }}
Expand All @@ -85,7 +127,7 @@ jobs:

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

Expand Down Expand Up @@ -115,7 +157,7 @@ jobs:
runs-on: macos-12
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,19 @@ requires = ["setuptools>=43", "wheel"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
skip = ["pp*", "*-musllinux*"]
skip = "pp*"
test-extras = "test"
test-command = [
"env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/runner.py",
"env PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 PSUTIL_SCRIPTS_DIR={project}/scripts python {project}/psutil/tests/test_memleaks.py"
]

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
archs = ["x86_64", "arm64", "universal2"]

[tool.cibuildwheel.linux]
before-all = "yum install -y net-tools"

[[tool.cibuildwheel.overrides]]
select = "*-musllinux*"
before-all = "apk --no-cache add coreutils procps"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ def main():
elif which('rpm'):
missdeps("sudo yum install gcc %s%s-devel" % (pyimpl, py3))
elif which('apk'):
missdeps("sudo apk add gcc %s%s-dev" % (pyimpl, py3))
missdeps("sudo apk add gcc musl-dev linux-headers %s%s-dev"
% (pyimpl, py3))
elif MACOS:
print(hilite("XCode (https://developer.apple.com/xcode/) "
"is not installed"), color="red", file=sys.stderr)
Expand Down