Janitorial formatting

This commit is contained in:
Pragyansh Chaturvedi
2025-11-11 17:28:30 +05:30
parent 8585f170cb
commit 503e6da987
4 changed files with 8 additions and 6 deletions

View File

@ -5,7 +5,10 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) find_package(
Python
COMPONENTS Interpreter Development.Module
REQUIRED)
# pybind11 # pybind11
include_directories(${CMAKE_SOURCE_DIR}/src) include_directories(${CMAKE_SOURCE_DIR}/src)

View File

@ -1,6 +1,5 @@
import ctypes import ctypes
import logging import logging
from typing import Dict, Type
from llvmlite import ir from llvmlite import ir
@ -51,7 +50,7 @@ def _make_repr(struct_name: str, fields: list):
return __repr__ return __repr__
def convert_structs_to_ctypes(structs_sym_tab) -> Dict[str, Type[ctypes.Structure]]: def convert_structs_to_ctypes(structs_sym_tab) -> dict[str, type[ctypes.Structure]]:
"""Convert PythonBPF's structs_sym_tab to ctypes.Structure classes.""" """Convert PythonBPF's structs_sym_tab to ctypes.Structure classes."""
if not structs_sym_tab: if not structs_sym_tab:
return {} return {}

View File

@ -1,4 +1,4 @@
from typing import Callable, Optional from collections.abc import Callable
class PerfEventArrayHelper: class PerfEventArrayHelper:
@ -13,7 +13,7 @@ class PerfEventArrayHelper:
callback: Callable, callback: Callable,
struct_name: str = "", struct_name: str = "",
page_cnt: int = 8, page_cnt: int = 8,
lost_callback: Optional[Callable] = None, lost_callback: Callable | None = None,
): ):
"""Open perf buffer with auto-deserialization.""" """Open perf buffer with auto-deserialization."""
from .pylibbpf import PerfEventArray from .pylibbpf import PerfEventArray

View File

@ -3,7 +3,7 @@ import subprocess
import sys import sys
from pathlib import Path from pathlib import Path
from setuptools import Extension, find_packages, setup from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext