Skip to content

Commit f87ca77

Browse files
authored
fix(python): Fix python wheel error by disabling s3 (#826)
* trt * remove sudo * test * try build graphar cpp * try build graphar cpp * remove sudo * remove sudo * try * try * try close s3 * try close s3 * try * try * open arrow s3 in macos * try * update * fix smoke test * only run in cp39 * try fix * update * format * format
1 parent ccf9a65 commit f87ca77

File tree

3 files changed

+40
-19
lines changed

3 files changed

+40
-19
lines changed

.github/workflows/python-wheel-workflow.yml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -130,27 +130,28 @@ jobs:
130130
fi
131131
dnf install -y 'dnf-command(config-manager)' || dnf install -y dnf-plugins-core || true
132132
# Follow official Apache Arrow install instructions for AlmaLinux/RHEL-family
133-
dnf install -y epel-release || \
134-
dnf install -y oracle-epel-release-el${ALMA_MAJOR} || \
135-
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${ALMA_MAJOR}.noarch.rpm
136-
dnf install -y https://packages.apache.org/artifactory/arrow/almalinux/${ALMA_MAJOR}/apache-arrow-release-latest.rpm
133+
dnf install -y epel-release || dnf install -y oracle-epel-release-el$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1) || dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1).noarch.rpm
134+
dnf install -y https://packages.apache.org/artifactory/arrow/almalinux/$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1)/apache-arrow-release-latest.rpm
137135
dnf config-manager --set-enabled epel || :
138136
dnf config-manager --set-enabled powertools || :
139137
dnf config-manager --set-enabled crb || :
140-
dnf config-manager --set-enabled ol${ALMA_MAJOR}_codeready_builder || :
141-
dnf config-manager --set-enabled codeready-builder-for-rhel-${ALMA_MAJOR}-rhui-rpms || :
142-
subscription-manager repos --enable codeready-builder-for-rhel-${ALMA_MAJOR}-$(arch)-rpms || :
143-
# manylinux images may carry older Arrow packages (e.g. arrow1700-*) which
144-
# conflict with the newer packages from the Apache Arrow repo (e.g. arrow2200-*).
145-
# Remove any preinstalled Arrow/Parquet RPMs so we install a consistent set.
146-
dnf remove -y 'arrow*' 'parquet*' || true
147-
# Required for GraphAr C++ build via Arrow CMake packages
148-
dnf install -y --allowerasing \
149-
arrow-devel \
150-
arrow-dataset-devel \
151-
arrow-acero-devel \
152-
parquet-devel \
153-
libcurl-devel re2-devel ccache
138+
dnf config-manager --set-enabled ol$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1)_codeready_builder || :
139+
dnf config-manager --set-enabled codeready-builder-for-rhel-$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1)-rhui-rpms || :
140+
subscription-manager repos --enable codeready-builder-for-rhel-$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1)-$(arch)-rpms || :
141+
dnf install -y arrow-devel # For C++
142+
dnf install -y arrow-glib-devel # For GLib (C)
143+
dnf install -y arrow-dataset-devel # For Apache Arrow Dataset C++
144+
dnf install -y arrow-dataset-glib-devel # For Apache Arrow Dataset GLib (C)
145+
dnf install -y arrow-acero-devel # For Apache Arrow Acero C++
146+
dnf install -y arrow-flight-devel # For Apache Arrow Flight C++
147+
dnf install -y arrow-flight-glib-devel # For Apache Arrow Flight GLib (C)
148+
dnf install -y arrow-flight-sql-devel # For Apache Arrow Flight SQL C++
149+
dnf install -y arrow-flight-sql-glib-devel # For Apache Arrow Flight SQL GLib (C)
150+
dnf install -y gandiva-devel # For Apache Gandiva C++
151+
dnf install -y gandiva-glib-devel # For Apache Gandiva GLib (C)
152+
dnf install -y parquet-devel # For Apache Parquet C++
153+
dnf install -y parquet-glib-devel # For Apache Parquet GLib (C)
154+
154155
steps:
155156
- name: Checkout (needed for some tooling)
156157
uses: actions/checkout@v4
@@ -184,6 +185,7 @@ jobs:
184185
otool -l "$CONDA/lib/libarrow.dylib" | (grep -A3 -E 'LC_BUILD_VERSION|LC_VERSION_MIN_MACOSX' || true)
185186
fi
186187
fi
188+
187189
- name: Install Arrow (Windows)
188190
if: matrix.os == 'windows'
189191
shell: pwsh
@@ -224,6 +226,7 @@ jobs:
224226
exit 1
225227
fi
226228
echo "PKGDIR=$PKGDIR" >> "$GITHUB_ENV"
229+
227230
- name: Build wheels
228231
shell: bash
229232
run: |
@@ -232,12 +235,24 @@ jobs:
232235
python -m pip install packaging cibuildwheel
233236
mkdir -p python/dist
234237
python -m cibuildwheel --output-dir python/dist "$PKGDIR"
238+
235239
- name: Store artifacts
236240
uses: actions/upload-artifact@v4
237241
with:
238242
name: wheels-${{ matrix.os }}-${{ matrix.platform }}
239243
path: python/dist/*
240244

245+
- name: Smoke test wheel
246+
shell: bash
247+
run: |
248+
set -euxo pipefail
249+
python -m pip uninstall -y graphar || true
250+
251+
python -m pip install --find-links python/dist graphar
252+
253+
python -c "import graphar; import graphar._core; print('GraphAr imported successfully')"
254+
graphar --help >/dev/null
255+
241256
upload_test_pypi:
242257
name: Publish to TestPyPI (auto)
243258
needs: [build_wheels, build_sdist]

cpp/src/graphar/filesystem.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,20 +370,26 @@ Result<std::shared_ptr<FileSystem>> FileSystemFromUriOrPath(
370370
// arrow::fs::InitializeS3 and arrow::fs::FinalizeS3 need arrow_version >= 15
371371
Status InitializeS3() {
372372
#if defined(ARROW_VERSION) && ARROW_VERSION > 14000000
373+
#if defined(ARROW_S3)
373374
auto options = arrow::fs::S3GlobalOptions::Defaults();
375+
#endif
374376
#else
375377
arrow::fs::S3GlobalOptions options;
376378
options.log_level = arrow::fs::S3LogLevel::Fatal;
377379
#endif
378380
#if defined(ARROW_VERSION) && ARROW_VERSION >= 15000000
381+
#if defined(ARROW_S3)
379382
RETURN_NOT_ARROW_OK(arrow::fs::InitializeS3(options));
383+
#endif
380384
#endif
381385
return Status::OK();
382386
}
383387

384388
Status FinalizeS3() {
385389
#if defined(ARROW_VERSION) && ARROW_VERSION >= 15000000
390+
#if defined(ARROW_S3)
386391
RETURN_NOT_ARROW_OK(arrow::fs::FinalizeS3());
392+
#endif
387393
#endif
388394
return Status::OK();
389395
}

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build-backend = "scikit_build_core.build"
2222

2323
[project]
2424
name = "graphar"
25-
version = "0.13.0-dev"
25+
version = "0.13.0.dev1"
2626
description = "An open source, standard data file format for graph data storage and retrieval."
2727
readme = "README.md"
2828
authors = [{ name = "GraphAr community", email = "dev@graphar.apache.org" }]

0 commit comments

Comments
 (0)