Skip to content

Commit

Permalink
ci: build aarch64 wheel on GHA aarch64 runner
Browse files Browse the repository at this point in the history
Signed-off-by: mayeut <[email protected]>
  • Loading branch information
mayeut committed Feb 1, 2025
1 parent ac19c53 commit 2dc4745
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
include:
- {os: ubuntu-latest, arch: x86_64}
- {os: ubuntu-latest, arch: i686}
- {os: ubuntu-latest, arch: aarch64}
- {os: ubuntu-24.04-arm, arch: aarch64}
- {os: macos-13, arch: x86_64}
- {os: macos-14, arch: arm64}
- {os: windows-2019, arch: AMD64}
Expand All @@ -48,10 +48,6 @@ jobs:
with:
python-version: 3.11

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: matrix.arch == 'aarch64'

- name: Create wheels + run tests
uses: pypa/[email protected]
env:
Expand Down
7 changes: 7 additions & 0 deletions psutil/tests/test_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import errno
import io
import os
import platform
import re
import shutil
import socket
Expand Down Expand Up @@ -735,6 +736,9 @@ def test_against_lscpu(self):
core_ids.add(fields[1])
assert psutil.cpu_count(logical=False) == len(core_ids)

@pytest.mark.skipif(
platform.machine() not in {"x86_64", "i686"}, reason="x86_64/i686 only"
)
def test_method_2(self):
meth_1 = psutil._pslinux.cpu_count_cores()
with mock.patch('glob.glob', return_value=[]) as m:
Expand All @@ -754,6 +758,9 @@ def test_emulate_none(self):
@pytest.mark.skipif(not LINUX, reason="LINUX only")
class TestSystemCPUFrequency(PsutilTestCase):
@pytest.mark.skipif(not HAS_CPU_FREQ, reason="not supported")
@pytest.mark.skipif(
AARCH64, reason="aarch64 does not always expose frequency"
)
def test_emulate_use_second_file(self):
# https://github.com/giampaolo/psutil/issues/981
def path_exists_mock(path):
Expand Down
7 changes: 5 additions & 2 deletions psutil/tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from psutil import SUNOS
from psutil import WINDOWS
from psutil._common import broadcast_addr
from psutil.tests import AARCH64
from psutil.tests import ASCII_FS
from psutil.tests import CI_TESTING
from psutil.tests import GITHUB_ACTIONS
Expand Down Expand Up @@ -598,8 +599,10 @@ def check_ls(ls):
assert value >= 0

ls = psutil.cpu_freq(percpu=True)
if FREEBSD and not ls:
raise pytest.skip("returns empty list on FreeBSD")
if (FREEBSD or AARCH64) and not ls:
raise pytest.skip(
"returns empty list on FreeBSD and Linux aarch64"
)

assert ls, ls
check_ls([psutil.cpu_freq(percpu=False)])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ trailing_comma_inline_array = true
skip = [
"*-musllinux*",
"cp313-win*", # pywin32 is not available on cp313 yet
"cp3{7,8,9,10,11,12}-*linux_{aarch64,ppc64le,s390x}", # Only test cp36/cp313 on qemu tested architectures
"cp3{7,8,9,10,11,12}-*linux_{ppc64le,s390x}", # Only test cp36/cp313 on qemu tested architectures
"pp*",
]
test-extras = ["test"]
Expand Down

0 comments on commit 2dc4745

Please sign in to comment.