6 Commits

5 changed files with 11 additions and 53 deletions

View File

@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
platform: [ubuntu-latest]
python-version: ["3.8", "3.12"]
python-version: ["3.12", "3.13"]
runs-on: ${{ matrix.platform }}

View File

@ -48,7 +48,7 @@ jobs:
env:
CIBW_PLATFORM: linux
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BUILD: "cp38-* cp311-*"
CIBW_BUILD: "cp311-*"
CIBW_SKIP: "*-musllinux*"
CIBW_TEST_COMMAND: "python -c 'import pylibbpf; print(f\"pylibbpf {pylibbpf.__version__} imported successfully\")'"
CIBW_TEST_SKIP: "*-linux_aarch64"

View File

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

View File

@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"setuptools>=77",
"wheel",
"ninja",
"cmake>=4.0",
@ -17,8 +17,8 @@ authors = [
{ name = "varun-r-mallya", email = "varunrmallya@gmail.com" }
]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
license = "Apache-2.0"
requires-python = ">=3.12"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
@ -29,6 +29,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: C++",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Operating System Kernels :: Linux",
@ -47,7 +48,7 @@ Issues = "https://github.com/pythonbpf/pylibbpf/issues"
[tool.mypy]
files = "setup.py"
python_version = "3.8"
python_version = "3.12"
strict = true
show_error_codes = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
@ -68,7 +69,7 @@ filterwarnings = [
testpaths = ["tests"]
[tool.ruff]
target-version = "py38"
target-version = "py312"
line-length = 88
[tool.ruff.lint]

View File

@ -6,14 +6,6 @@ from pathlib import Path
from setuptools import Extension, find_packages, setup
from setuptools.command.build_ext import build_ext
# Convert distutils Windows platform specifiers to CMake -A arguments
PLAT_TO_CMAKE = {
"win32": "Win32",
"win-amd64": "x64",
"win-arm32": "ARM",
"win-arm64": "ARM64",
}
# A CMakeExtension needs a sourcedir instead of a file list.
# The name must be the _single_ output extension from the CMake build.
@ -45,8 +37,8 @@ class CMakeBuild(build_ext):
# from Python.
cmake_args = [
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
f"-DPython_EXECUTABLE={sys.executable}",
]
build_args = []
@ -122,44 +114,7 @@ if readme_path.exists():
long_description = readme_path.read_text(encoding="utf-8")
setup(
name="pylibbpf",
version="0.0.1",
author="varun-r-mallya, r41k0u",
author_email="varunrmallyagmail.com",
description="Python Bindings for Libbpf",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/pythonbpf/pylibbpf",
packages=find_packages(where="."),
package_dir={"": "."},
py_modules=[], # Empty since we use packages
ext_modules=[CMakeExtension("pylibbpf.pylibbpf")],
cmdclass={"build_ext": CMakeBuild},
zip_safe=False,
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: C++",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Operating System Kernels :: Linux",
],
install_requires=[
"llvmlite>=0.40.0", # Required for struct conversion
],
extras_require={"test": ["pytest>=6.0"]},
python_requires=">=3.8",
package_data={
"pylibbpf": [
"*.py",
"py.typed", # For type hints
],
},
include_package_data=True,
)