Skip to content

Commit e7002c9

Browse files
committed
feat: exclude unsupported Python versions for Windows ARM64 in CI workflows and update logging steps
1 parent 9f52d57 commit e7002c9

3 files changed

Lines changed: 131 additions & 83 deletions

File tree

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

Lines changed: 114 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ jobs:
129129
runs-on: windows-2025
130130
- platform: windows/arm64
131131
runs-on: windows-11-arm
132+
exclude:
133+
# Windows ARM64 doesn't have Python 3.10, 3.13, or 3.14
134+
- platform: windows/arm64
135+
python-version: '3.10'
136+
- platform: windows/arm64
137+
python-version: '3.13'
138+
- platform: windows/arm64
139+
python-version: '3.14'
132140

133141
steps:
134142
- name: Checkout code
@@ -254,89 +262,117 @@ jobs:
254262
255263
- name: Generate test summary
256264
if: always()
257-
shell: bash
265+
shell: python
258266
run: |
259-
cd bindings/python
260-
261-
echo "## 🧪 Test Results: arcadedb-embedded (${{ matrix.platform }})" >> $GITHUB_STEP_SUMMARY
262-
echo "" >> $GITHUB_STEP_SUMMARY
263-
264-
# Check test status
265-
if [ "${{ steps.pytest.outcome }}" = "success" ]; then
266-
echo "✅ **Status**: PASSED" >> $GITHUB_STEP_SUMMARY
267-
else
268-
echo "❌ **Status**: FAILED" >> $GITHUB_STEP_SUMMARY
269-
fi
270-
271-
echo "" >> $GITHUB_STEP_SUMMARY
272-
echo "| Metric | Count |" >> $GITHUB_STEP_SUMMARY
273-
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
274-
275-
# Show test results
276-
echo "| ✅ Passed | ${{ steps.pytest.outputs.passed || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
277-
echo "| ⏭️ Skipped | ${{ steps.pytest.outputs.skipped || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
278-
echo "| ❌ Failed | ${{ steps.pytest.outputs.failed || 'N/A' }} |" >> $GITHUB_STEP_SUMMARY
279-
echo "" >> $GITHUB_STEP_SUMMARY
280-
281-
echo "### 📦 Package Info:" >> $GITHUB_STEP_SUMMARY
282-
echo "" >> $GITHUB_STEP_SUMMARY
283-
284-
# Get wheel size and analyze contents
285-
WHEEL_FILE=$(ls dist/*.whl 2>/dev/null | head -n1)
286-
if [ -n "$WHEEL_FILE" ]; then
287-
# Get wheel size (portable way)
288-
if stat -c%s "$WHEEL_FILE" 2>/dev/null; then
289-
# Linux
290-
WHEEL_SIZE_BYTES=$(stat -c%s "$WHEEL_FILE")
291-
else
292-
# macOS/BSD
293-
WHEEL_SIZE_BYTES=$(stat -f%z "$WHEEL_FILE")
294-
fi
295-
WHEEL_SIZE_MB=$(python3 -c "print(f'{$WHEEL_SIZE_BYTES / 1024 / 1024:.1f}')")
296-
297-
# Unzip and analyze components (wheel is a zip file)
298-
TEMP_DIR=$(mktemp -d)
299-
unzip -q "$WHEEL_FILE" -d "$TEMP_DIR"
300-
301-
# Calculate JRE size (look for jre/ directory anywhere)
302-
JRE_DIR=$(find "$TEMP_DIR" -type d -name "jre" | head -n1)
303-
if [ -n "$JRE_DIR" ] && [ -d "$JRE_DIR" ]; then
304-
# Use du with -k for KB (portable across Linux/macOS)
305-
JRE_SIZE_KB=$(du -sk "$JRE_DIR" | cut -f1)
306-
JRE_SIZE_MB=$(python3 -c "print(f'{$JRE_SIZE_KB / 1024:.1f}')")
307-
else
308-
JRE_SIZE_MB="N/A"
309-
fi
310-
311-
# Calculate JAR size (*.jar files)
312-
JAR_COUNT=$(find "$TEMP_DIR" -name "*.jar" | wc -l | tr -d ' ')
313-
if [ "$JAR_COUNT" -gt 0 ]; then
314-
JAR_SIZE_KB=$(find "$TEMP_DIR" -name "*.jar" -exec du -k {} + | awk '{sum+=$1} END {print sum}')
315-
JAR_SIZE_MB=$(python3 -c "print(f'{$JAR_SIZE_KB / 1024:.1f}')")
316-
else
317-
JAR_SIZE_MB="N/A"
318-
fi
319-
320-
# Calculate installed size (total uncompressed)
321-
INSTALLED_SIZE_KB=$(du -sk "$TEMP_DIR" | cut -f1)
322-
INSTALLED_SIZE_MB=$(python3 -c "print(f'{$INSTALLED_SIZE_KB / 1024:.0f}')")
323-
324-
rm -rf "$TEMP_DIR"
325-
326-
echo "- **Wheel Size**: ${WHEEL_SIZE_MB}M (compressed)" >> $GITHUB_STEP_SUMMARY
327-
echo "- **JRE Size**: ${JRE_SIZE_MB}M (uncompressed)" >> $GITHUB_STEP_SUMMARY
328-
echo "- **JARs Size**: ${JAR_SIZE_MB}M (uncompressed)" >> $GITHUB_STEP_SUMMARY
329-
echo "- **Installed Size**: ~${INSTALLED_SIZE_MB}M (total uncompressed)" >> $GITHUB_STEP_SUMMARY
330-
fi
331-
332-
echo "- **Platform**: ${{ matrix.platform }}" >> $GITHUB_STEP_SUMMARY
333-
echo "- **Features**: All ArcadeDB features (some JARs excluded, see jar_exclusions.txt)" >> $GITHUB_STEP_SUMMARY
267+
import os
268+
import zipfile
269+
import glob
270+
from pathlib import Path
271+
272+
summary_file = os.environ.get('GITHUB_STEP_SUMMARY', '/dev/null')
273+
274+
with open(summary_file, 'a') as f:
275+
f.write("## 🧪 Test Results: arcadedb-embedded (${{ matrix.platform }})\n")
276+
f.write("\n")
277+
278+
# Check test status
279+
if "${{ steps.pytest.outcome }}" == "success":
280+
f.write("✅ **Status**: PASSED\n")
281+
else:
282+
f.write("❌ **Status**: FAILED\n")
283+
284+
f.write("\n")
285+
f.write("| Metric | Count |\n")
286+
f.write("|--------|-------|\n")
287+
288+
# Show test results
289+
f.write("| ✅ Passed | ${{ steps.pytest.outputs.passed or 'N/A' }} |\n")
290+
f.write("| ⏭️ Skipped | ${{ steps.pytest.outputs.skipped or 'N/A' }} |\n")
291+
f.write("| ❌ Failed | ${{ steps.pytest.outputs.failed or 'N/A' }} |\n")
292+
f.write("\n")
293+
294+
f.write("### 📦 Package Info:\n")
295+
f.write("\n")
296+
297+
# Get wheel size and analyze contents
298+
wheel_files = glob.glob("bindings/python/dist/*.whl")
299+
if wheel_files:
300+
wheel_file = wheel_files[0]
301+
302+
# Get wheel size
303+
wheel_size_bytes = os.path.getsize(wheel_file)
304+
wheel_size_mb = wheel_size_bytes / 1024 / 1024
305+
306+
# Analyze wheel contents
307+
jre_size_mb = "N/A"
308+
jar_size_mb = "N/A"
309+
installed_size_mb = "N/A"
310+
311+
try:
312+
# Extract and analyze (cross-platform)
313+
import tempfile
314+
import shutil
315+
316+
with tempfile.TemporaryDirectory() as temp_dir:
317+
with zipfile.ZipFile(wheel_file, 'r') as whl:
318+
whl.extractall(temp_dir)
319+
320+
# Calculate JRE size
321+
jre_dir = None
322+
for root, dirs, files in os.walk(temp_dir):
323+
if 'jre' in dirs:
324+
jre_dir = os.path.join(root, 'jre')
325+
break
326+
327+
if jre_dir and os.path.isdir(jre_dir):
328+
jre_size_kb = 0
329+
for root, dirs, files in os.walk(jre_dir):
330+
for file in files:
331+
jre_size_kb += os.path.getsize(os.path.join(root, file))
332+
jre_size_mb = jre_size_kb / 1024 / 1024
333+
334+
# Calculate JAR size
335+
jar_files = []
336+
for root, dirs, files in os.walk(temp_dir):
337+
for file in files:
338+
if file.endswith('.jar'):
339+
jar_files.append(os.path.join(root, file))
340+
341+
if jar_files:
342+
jar_size_kb = sum(os.path.getsize(f) for f in jar_files) / 1024
343+
jar_size_mb = jar_size_kb / 1024
344+
345+
# Calculate total size
346+
total_size_kb = 0
347+
for root, dirs, files in os.walk(temp_dir):
348+
for file in files:
349+
total_size_kb += os.path.getsize(os.path.join(root, file))
350+
installed_size_mb = total_size_kb / 1024 / 1024
351+
except Exception as e:
352+
print(f"Warning: Could not analyze wheel contents: {e}")
353+
354+
f.write(f"- **Wheel Size**: {wheel_size_mb:.1f}M (compressed)\n")
355+
if isinstance(jre_size_mb, str):
356+
f.write(f"- **JRE Size**: {jre_size_mb} (uncompressed)\n")
357+
else:
358+
f.write(f"- **JRE Size**: {jre_size_mb:.1f}M (uncompressed)\n")
359+
if isinstance(jar_size_mb, str):
360+
f.write(f"- **JARs Size**: {jar_size_mb} (uncompressed)\n")
361+
else:
362+
f.write(f"- **JARs Size**: {jar_size_mb:.1f}M (uncompressed)\n")
363+
if isinstance(installed_size_mb, str):
364+
f.write(f"- **Installed Size**: {installed_size_mb} (total uncompressed)\n")
365+
else:
366+
f.write(f"- **Installed Size**: ~{installed_size_mb:.0f}M (total uncompressed)\n")
367+
368+
f.write("- **Platform**: ${{ matrix.platform }}\n")
369+
f.write("- **Features**: All ArcadeDB features (some JARs excluded, see jar_exclusions.txt)\n")
334370
335371
- name: Upload test results
336372
if: always()
337373
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
338374
with:
339-
name: test-results-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}
375+
name: test-results-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}-py${{ matrix.python-version }}
340376
path: |
341377
bindings/python/pytest-output.txt
342378
bindings/python/.coverage
@@ -345,7 +381,7 @@ jobs:
345381
- name: Upload wheel artifact
346382
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
347383
with:
348-
name: wheel-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}-test
384+
name: wheel-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}-py${{ matrix.python-version }}
349385
path: bindings/python/dist/*.whl
350386
retention-days: 7
351387

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ jobs:
125125
runs-on: windows-2025
126126
- platform: windows/arm64
127127
runs-on: windows-11-arm
128+
exclude:
129+
# Windows ARM64 doesn't have Python 3.10, 3.13, or 3.14
130+
- platform: windows/arm64
131+
python-version: '3.10'
132+
- platform: windows/arm64
133+
python-version: '3.13'
134+
- platform: windows/arm64
135+
python-version: '3.14'
128136

129137
steps:
130138
- name: Checkout code
@@ -186,9 +194,11 @@ jobs:
186194
shell: bash
187195
run: |
188196
# Install dependencies needed by examples
189-
# Note: macOS Intel needs NumPy 1.x for PyTorch compatibility
197+
# PyTorch is required by sentence-transformers, even on macOS
198+
# For Python 3.13+, wheels might only be on PyTorch official index
190199
if [[ "$OSTYPE" == "darwin"* ]]; then
191-
# macOS: Default wheels are CPU/MPS (no CUDA)
200+
# macOS: Install CPU-only PyTorch (supports MPS acceleration)
201+
pip install torch --index-url https://download.pytorch.org/whl/cpu
192202
pip install "numpy<2.0" requests sentence-transformers
193203
else
194204
# Linux & Windows: Install CPU-only PyTorch to save space (avoid CUDA)
@@ -404,7 +414,7 @@ jobs:
404414
if: always()
405415
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
406416
with:
407-
name: example-logs-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}
417+
name: example-logs-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}-py${{ matrix.python-version }}
408418
path: |
409419
bindings/python/examples/*.log
410420
bindings/python/examples/example-results.txt
@@ -414,7 +424,7 @@ jobs:
414424
if: failure()
415425
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
416426
with:
417-
name: example-databases-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}
427+
name: example-databases-${{ matrix.platform == 'linux/amd64' && 'linux-amd64' || matrix.platform == 'linux/arm64' && 'linux-arm64' || matrix.platform == 'darwin/amd64' && 'darwin-amd64' || matrix.platform == 'darwin/arm64' && 'darwin-arm64' || matrix.platform == 'windows/amd64' && 'windows-amd64' || 'windows-arm64' }}-py${{ matrix.python-version }}
418428
path: bindings/python/examples/my_test_databases/
419429
retention-days: 3
420430

bindings/python/Dockerfile.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ FROM python-builder AS export
165165
# Stage 5: Test the built wheel
166166
FROM python:${PYTHON_VERSION}-slim AS tester
167167

168-
# Install Java runtime for JPype
168+
# Install Java runtime and build tools for JPype
169+
# (build-essential may be needed if pip needs to compile jpype1 during install)
169170
RUN apt-get update && apt-get install -y \
170171
openjdk-21-jre-headless \
172+
build-essential \
171173
&& rm -rf /var/lib/apt/lists/*
172174

173175
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64

0 commit comments

Comments
 (0)