Skip to content

Commit 6e4fd2d

Browse files
committed
Fix pyarrow 24 patch
1 parent d1f33d2 commit 6e4fd2d

1 file changed

Lines changed: 18 additions & 22 deletions

File tree

graalpython/lib-graalpython/patches/pyarrow-24.0.0.patch

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@ new file mode 100644
4545
index 0000000..fd43d65
4646
--- /dev/null
4747
+++ b/pyarrow_build_backend.py
48-
@@ -0,0 +1,93 @@
48+
@@ -0,0 +1,89 @@
4949
+import os
5050
+import re
51-
+import sys
5251
+import tarfile
5352
+import subprocess
5453
+import tempfile
55-
+import shutil
5654
+import tarfile
5755
+import urllib.request
5856
+from pathlib import Path
57+
+from scikit_build_core.build import build_wheel as scikit_build_wheel
5958
+
6059
+VERSION = re.search(r'set\(PYARROW_VERSION "([^"]+)"\)', Path("CMakeLists.txt").read_text()).group(1)
6160
+
@@ -120,25 +119,22 @@ index 0000000..fd43d65
120119
+ subprocess.check_call([
121120
+ 'cmake', '--install', str(build_dir),
122121
+ ])
123-
+ env = os.environ.copy()
124-
+ env['ARROW_HOME'] = str(arrow_dist)
125-
+ env['CMAKE_PREFIX_PATH'] = str(arrow_dist)
126-
+ env['PYARROW_WITH_DATASET'] = '1'
127-
+ env['PYARROW_WITH_PARQUET'] = '1'
128-
+ env['PYARROW_WITH_PARQUET_ENCRYPTION'] = '1'
129-
+ env['PYARROW_WITH_GANDIVA'] = '1'
130-
+ env['PYARROW_BUNDLE_ARROW_CPP'] = '1'
131-
+ env['PYARROW_BUNDLE_CYTHON_CPP'] = '1'
132-
+ subprocess.run(
133-
+ [sys.executable, 'setup.py', 'bdist_wheel'],
134-
+ env=env,
135-
+ check=True,
136-
+ )
137-
+ wheels = list(Path('dist').glob('*.whl'))
138-
+ assert len(wheels) == 1, f"Expected 1 wheel, found {len(wheels)}"
139-
+ wheel = wheels[0]
140-
+ shutil.copyfile(wheel, wheel_directory / wheel.name)
141-
+ return str(wheel.name)
122+
+ old_env = os.environ.copy()
123+
+ os.environ.update({
124+
+ 'ARROW_HOME': str(arrow_dist),
125+
+ 'CMAKE_PREFIX_PATH': str(arrow_dist),
126+
+ 'PYARROW_WITH_DATASET': '1',
127+
+ 'PYARROW_WITH_PARQUET': '1',
128+
+ 'PYARROW_WITH_PARQUET_ENCRYPTION': '1',
129+
+ 'PYARROW_WITH_GANDIVA': '1',
130+
+ 'PYARROW_BUNDLE_ARROW_CPP': '1',
131+
+ 'PYARROW_BUNDLE_CYTHON_CPP': '1',
132+
+ })
133+
+ try:
134+
+ return scikit_build_wheel(wheel_directory, config_settings, metadata_directory)
135+
+ finally:
136+
+ os.environ.clear()
137+
+ os.environ.update(old_env)
142138
diff --git a/pyproject.toml b/pyproject.toml
143139
index 2fbe78e..7a80e39 100644
144140
--- a/pyproject.toml

0 commit comments

Comments
 (0)