Skip to content

Commit 81e23f2

Browse files
committed
Refactor Python bindings for ArcadeDB: Enhance exporter, importer, and vector search functionalities
- Updated `export_database` to utilize JPype for Java class imports and improved CSV export handling. - Introduced `_AsyncRuntimeSettings` class to manage async settings in `importer.py`, ensuring runtime settings are restored after failures. - Enhanced `jvm.py` to extract runtime resources from wheel files, improving resource management. - Improved `convert_java_to_python` and `convert_python_to_java` functions for better type handling and caching of Java types. - Refactored vector search methods in `vector.py` to streamline neighbor finding and result processing. - Added tests for async executor closure and import document error handling to ensure robustness. - Updated `sync-upstream.sh` to reflect changes in build script paths.
1 parent edf9cd5 commit 81e23f2

49 files changed

Lines changed: 2576 additions & 505 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release-python-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
echo "📌 Tag base version: $TAG_BASE"
3737
3838
# Get version from pom.xml
39-
POM_VERSION=$(python3 extract_version.py --format=docker)
39+
POM_VERSION=$(python3 scripts/extract_version.py --format=docker)
4040
echo "📌 pom.xml version: $POM_VERSION"
4141
4242
# Extract base version from pom.xml (remove -SNAPSHOT, etc.)

.github/workflows/test-python-bindings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
cd bindings/python
5353
5454
# Detect ArcadeDB version from pom.xml (Docker format: X.Y.Z-SNAPSHOT)
55-
ARCADEDB_TAG=$(python3 extract_version.py --format=docker)
55+
ARCADEDB_TAG=$(python3 scripts/extract_version.py --format=docker)
5656
echo "📌 ArcadeDB version: $ARCADEDB_TAG"
5757
5858
# Download JARs from official Docker image
@@ -210,7 +210,7 @@ jobs:
210210
run: |
211211
cd bindings/python
212212
echo "🔨 Building arcadedb-embedded for ${{ matrix.platform }} with Python ${{ matrix.python-version }}..."
213-
./build.sh ${{ matrix.platform }} ${{ matrix.python-version }}
213+
./scripts/build.sh ${{ matrix.platform }} ${{ matrix.python-version }}
214214
215215
- name: Extract wheel for additional testing
216216
shell: bash

.github/workflows/test-python-examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
cd bindings/python
7070
7171
# Detect ArcadeDB version from pom.xml (Docker format: X.Y.Z-SNAPSHOT)
72-
ARCADEDB_TAG=$(python3 extract_version.py --format=docker)
72+
ARCADEDB_TAG=$(python3 scripts/extract_version.py --format=docker)
7373
echo "📌 ArcadeDB version: $ARCADEDB_TAG"
7474
7575
# Download JARs from official Docker image
@@ -213,7 +213,7 @@ jobs:
213213
run: |
214214
cd bindings/python
215215
echo "🔨 Building arcadedb-embedded for ${{ matrix.platform }} with Python ${{ matrix.python-version }}..."
216-
./build.sh ${{ matrix.platform }} ${{ matrix.python-version }}
216+
./scripts/build.sh ${{ matrix.platform }} ${{ matrix.python-version }}
217217
218218
# Note: Java is NOT required - arcadedb-embedded has bundled JRE!
219219

bindings/python/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ notebooks/
4545

4646
# local built jars
4747
local-jars/
48+
.runtime-cache/
4849

4950
# test databases
5051
my_test_databases/

bindings/python/Dockerfile.build

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ COPY --from=jre-builder /build/jre /build/jre/
166166
COPY bindings/python/src ./src
167167
COPY bindings/python/tests ./tests
168168
COPY bindings/python/setup.py .
169-
COPY bindings/python/setup_jars.py .
170-
COPY bindings/python/extract_version.py .
171-
COPY bindings/python/write_version.py .
169+
COPY bindings/python/scripts/setup_jars.py ./scripts/
170+
COPY bindings/python/scripts/extract_version.py ./scripts/
171+
COPY bindings/python/scripts/write_version.py ./scripts/
172172
COPY bindings/python/jar_exclusions.txt .
173173
COPY bindings/python/pyproject.toml ./
174174
COPY bindings/python/README.md ./
175175

176-
# Also copy repository pom.xml so extract_version.py can read it
176+
# Also copy repository pom.xml so scripts/extract_version.py can read it
177177
COPY ../../pom.xml /arcadedb/pom.xml
178178

179179
# Install Python build dependencies
@@ -190,8 +190,8 @@ ARG TARGET_PLATFORM
190190
RUN echo "📌 Package name: ${PACKAGE_NAME}" && \
191191
echo "📌 Docker tag used: ${ARCADEDB_TAG}" && \
192192
echo "📌 Target platform: ${TARGET_PLATFORM}" && \
193-
python3 write_version.py /arcadedb/pom.xml && \
194-
python3 setup_jars.py && \
193+
python3 scripts/write_version.py /arcadedb/pom.xml && \
194+
python3 scripts/setup_jars.py && \
195195
echo "📦 JAR files and JRE copied"
196196

197197
# Build the wheel
@@ -201,7 +201,7 @@ RUN if [ -n "${BUILD_VERSION}" ]; then \
201201
export ARCADEDB_VERSION="${BUILD_VERSION}"; \
202202
echo "📌 Using provided version: ${ARCADEDB_VERSION}"; \
203203
else \
204-
export ARCADEDB_VERSION=$(python3 extract_version.py --format=pep440 /arcadedb/pom.xml); \
204+
export ARCADEDB_VERSION=$(python3 scripts/extract_version.py --format=pep440 /arcadedb/pom.xml); \
205205
echo "📦 Extracted version from pom.xml: ${ARCADEDB_VERSION}"; \
206206
fi && \
207207
echo "📦 Python package version: ${ARCADEDB_VERSION}" && \

0 commit comments

Comments
 (0)