Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📦 build: Relabel manylinux wheel ignoring pyarrow #14

Merged
merged 4 commits into from
Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions ci/linux/repair-wheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env python
"""Ignore libarrow libraries in the wheel"""

import logging
import sys
from fnmatch import fnmatch

from auditwheel.patcher import Patchelf
from auditwheel.policy import (
POLICY_PRIORITY_HIGHEST,
POLICY_PRIORITY_LOWEST,
get_policy_by_name,
get_policy_name,
)
from auditwheel.repair import repair_wheel
from auditwheel.wheel_abi import analyze_wheel_abi

logging.basicConfig(level=logging.INFO)


EXCLUDE_PATTERN = "libarrow*"

if __name__ == "__main__":
wheel, dest_dir = sys.argv[1:]

policy_name = get_policy_name(POLICY_PRIORITY_HIGHEST)
if policy_name is None:
raise ValueError("Invalid policy")

policy = get_policy_by_name(policy_name)
if policy is None:
raise ValueError("Invalid policy")

winfo = analyze_wheel_abi(wheel)
libs = winfo.external_refs[get_policy_name(POLICY_PRIORITY_LOWEST)]["libs"]

excludes = []
for lib in libs:
if fnmatch(lib, EXCLUDE_PATTERN):
excludes.append(lib)

abis = [policy["name"]] + policy["aliases"]

repair_wheel(
wheel,
abis,
out_dir=dest_dir,
lib_sdir=".libs",
update_tags=True,
patcher=Patchelf(),
exclude=excludes,
)
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ requires-python = ">=3.7"
keywords = ["arrow", "postgresql"]
license = { text = "MIT License" }
classifiers = [
"Framework :: Apache Arrow",
"Framework :: PostgreSQL",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Database",
Expand Down Expand Up @@ -45,4 +43,4 @@ repair-wheel-command = "cp {wheel} {dest_dir}"

[tool.cibuildwheel.linux]
before-build = "bash ci/linux/prepare-build.sh"
repair-wheel-command = "cp {wheel} {dest_dir}"
repair-wheel-command = "/opt/_internal/pipx/venvs/auditwheel/bin/python ci/linux/repair-wheel.py {wheel} {dest_dir}"