Skip to content

Commit 84d86a5

Browse files
fix ruff errors
1 parent 97eb8f6 commit 84d86a5

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

.github/workflows/pip.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ jobs:
1515
matrix:
1616
platform: [ubuntu-latest]
1717
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
18-
18+
1919
runs-on: ${{ matrix.platform }}
20-
20+
2121
steps:
2222
- uses: actions/checkout@v4
2323
with:
2424
submodules: true
25-
25+
2626
- uses: actions/setup-python@v5
2727
with:
2828
python-version: ${{ matrix.python-version }}
29-
29+
3030
- name: Install system dependencies
3131
run: |
3232
sudo apt-get update
@@ -36,16 +36,16 @@ jobs:
3636
build-essential \
3737
cmake \
3838
ninja-build
39-
39+
4040
- name: Add requirements
4141
run: python -m pip install --upgrade pip wheel setuptools
42-
42+
4343
- name: Build and install
4444
run: pip install --verbose .[test]
45-
45+
4646
- name: Test import
4747
run: python -c "import pylibbpf; print('Import successful')"
48-
48+
4949
- name: Test
5050
run: python -m pytest -v
51-
51+

.github/workflows/wheels.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
- uses: actions/checkout@v4
1919
with:
2020
submodules: true
21-
21+
2222
- name: Build SDist
2323
run: pipx run build --sdist
24-
24+
2525
- name: Check metadata
2626
run: pipx run twine check dist/*
27-
27+
2828
- uses: actions/upload-artifact@v4
2929
with:
3030
name: cibw-sdist
@@ -38,46 +38,46 @@ jobs:
3838
matrix:
3939
# Build for both x86_64 and aarch64
4040
arch: [x86_64, aarch64]
41-
41+
4242
steps:
4343
- uses: actions/checkout@v4
4444
with:
4545
submodules: true
46-
46+
4747
# Set up QEMU for aarch64 emulation
4848
- name: Set up QEMU
4949
if: matrix.arch == 'aarch64'
5050
uses: docker/setup-qemu-action@v3
5151
with:
5252
platforms: arm64
53-
53+
5454
- name: Build wheels
5555
uses: pypa/[email protected]
5656
env:
5757
# Only build for Linux
5858
CIBW_PLATFORM: linux
5959
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
60-
60+
6161
# Python versions to build for
6262
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
6363
CIBW_SKIP: "*-musllinux*" # Skip musl builds, focus on glibc
64-
64+
6565
# Install system dependencies before building
6666
CIBW_BEFORE_ALL_LINUX: >
6767
yum install -y epel-release &&
6868
yum install -y libbpf-devel kernel-headers ||
6969
(apt-get update && apt-get install -y libbpf-dev linux-headers-generic)
70-
70+
7171
# Test the built wheels
7272
CIBW_TEST_COMMAND: "python -c 'import pylibbpf; print(f\"pylibbpf {pylibbpf.__version__} imported successfully\")'"
73-
73+
7474
# Skip testing on emulated architectures (too slow)
7575
CIBW_TEST_SKIP: "*-linux_aarch64"
76-
76+
7777
- name: Verify clean directory
7878
run: git diff --exit-code
7979
shell: bash
80-
80+
8181
- name: Upload wheels
8282
uses: actions/upload-artifact@v4
8383
with:
@@ -95,15 +95,15 @@ jobs:
9595
environment:
9696
name: pypi
9797
# url: https://pypi.org/project/pylibbpf/${{ github.event.release.name }}
98-
98+
9999
steps:
100100
- name: Download all artifacts
101101
uses: actions/download-artifact@v4
102102
with:
103103
pattern: cibw-*
104104
path: dist
105105
merge-multiple: true
106-
106+
107107
- name: Publish to PyPI
108108
uses: pypa/gh-action-pypi-publish@release/v1
109109
with:

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import re
32
import subprocess
43
import sys
54
from pathlib import Path
@@ -50,7 +49,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
5049
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
5150
]
5251
build_args = []
53-
52+
5453
# Adding CMake arguments set as environment variable
5554
# (needed e.g. to build for ARM OSx on conda-forge)
5655
if "CMAKE_ARGS" in os.environ:

tests/test_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pylibbpf as m
22

3+
34
def test_main():
45
assert m.__version__ == "0.0.1"
56
assert m.add(1, 2) == 3

0 commit comments

Comments
 (0)