CI fixes: patchelf dev dep for auditwheel, absolute paths in setup.py
release / build-wheels (windows, cmd) (push) Failing after 11s
release / build-wheels (linux, bash) (push) Successful in 1m17s
release / build-wheels (macos, bash) (push) Successful in 1m23s
release / publish-pypi (push) Skipped

- Linux runner lacks patchelf; add the patchelf PyPI package (linux
  only) to dev deps so uv run puts it on PATH for auditwheel repair.
- setup.py anchored all libaegis paths to __file__: newer setuptools
  invoke the compiler from a temp build dir, breaking CWD-relative
  -Ilibaegis/src/include on Windows (C1083 aegis.h not found).
This commit is contained in:
LeoVasanko committed 2026-10-04 17:01:03 +00:00
1 parent 276b2faa0b
commit 696b35eb6f
2 files changed
+7 -4

No files matched your search

+1
View File
@@ -26,6 +26,7 @@ Repository = "https://github.com/LeoVasanko/aegis-python"
[dependency-groups] [dependency-groups]
dev = [ dev = [
"auditwheel>=6.8.2", "auditwheel>=6.8.2",
"patchelf>=0.17; sys_platform == 'linux'",
"pytest>=9.1.1", "pytest>=9.1.1",
"ruff>=0.16.10", "ruff>=0.16.10",
"setuptools>=84.0.0", "setuptools>=84.0.0",
+6 -4
View File
@@ -7,12 +7,14 @@ from pathlib import Path
from cffi import FFI from cffi import FFI
from setuptools import setup from setuptools import setup
libaegis_static = Path("libaegis/zig-out/lib") / ( ROOT = Path(__file__).parent.resolve()
libaegis_static = ROOT / "libaegis/zig-out/lib" / (
"aegis.lib" if sys.platform == "win32" else "libaegis.a" "aegis.lib" if sys.platform == "win32" else "libaegis.a"
) )
ffibuilder = FFI() ffibuilder = FFI()
ffibuilder.cdef((Path(__file__).parent / "src/aeg/aegis_cdef.h").read_text()) ffibuilder.cdef((ROOT / "src/aeg/aegis_cdef.h").read_text())
# Free-threaded Python does not support Limited API (abi3) # Free-threaded Python does not support Limited API (abi3)
is_free_threaded = sysconfig.get_config_var("Py_GIL_DISABLED") is_free_threaded = sysconfig.get_config_var("Py_GIL_DISABLED")
@@ -28,8 +30,8 @@ ffibuilder.set_source(
#include "aegis256x2.h" #include "aegis256x2.h"
#include "aegis256x4.h" #include "aegis256x4.h"
""", """,
include_dirs=["libaegis/src/include"], include_dirs=[str(ROOT / "libaegis/src/include")],
extra_objects=[str(libaegis_static.resolve())], extra_objects=[str(libaegis_static)],
py_limited_api=not is_free_threaded, py_limited_api=not is_free_threaded,
) )