Skip to content

Commit ba794c8

Browse files
committed
feat: enhance build scripts to support Python version as an argument
1 parent 874e9de commit ba794c8

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ jobs:
179179
shell: bash
180180
run: |
181181
cd bindings/python
182-
echo "🔨 Building arcadedb-embedded for ${{ matrix.platform }}..."
183-
./build.sh ${{ matrix.platform }}
182+
echo "🔨 Building arcadedb-embedded for ${{ matrix.platform }} with Python ${{ matrix.python-version }}..."
183+
./build.sh ${{ matrix.platform }} ${{ matrix.python-version }}
184184
185185
- name: Extract wheel for additional testing
186186
shell: bash

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ jobs:
171171
shell: bash
172172
run: |
173173
cd bindings/python
174-
echo "🔨 Building arcadedb-embedded for ${{ matrix.platform }}..."
175-
./build.sh ${{ matrix.platform }}
174+
echo "🔨 Building arcadedb-embedded for ${{ matrix.platform }} with Python ${{ matrix.python-version }}..."
175+
./build.sh ${{ matrix.platform }} ${{ matrix.python-version }}
176176
177177
# Note: Java is NOT required - arcadedb-embedded has bundled JRE!
178178

bindings/python/Dockerfile.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
# Excludes JARs listed in jar_exclusions.txt to optimize size
44
#
55
# REQUIRED BUILD ARGS (passed from build.sh):
6+
# PYTHON_VERSION - Python version for wheel (e.g., 3.11, 3.12, 3.13, 3.14)
67
# PACKAGE_NAME - always: arcadedb-embedded
78
# PACKAGE_DESCRIPTION - package description
89
# ARCADEDB_TAG - version tag from pom.xml (e.g., 25.10.1-SNAPSHOT)
910
# Default below is fallback; build.sh extracts and passes actual version
1011
# TARGET_PLATFORM - target platform for JRE (e.g., linux-x64, linux-arm64, darwin-x64)
1112

13+
ARG PYTHON_VERSION=3.12
1214
ARG PACKAGE_NAME=arcadedb-embedded
1315
ARG PACKAGE_DESCRIPTION="ArcadeDB embedded multi-model database with bundled JRE - no Java installation required"
1416
ARG ARCADEDB_TAG=25.10.1-SNAPSHOT
@@ -82,7 +84,7 @@ RUN echo "🔨 Building minimal JRE for platform: ${TARGET_PLATFORM}" && \
8284

8385
# Stage 3: Build Python wheel
8486

85-
FROM python:3.12-slim AS python-builder
87+
FROM python:${PYTHON_VERSION}-slim AS python-builder
8688

8789
# Install system dependencies (JDK needed for JPype at build/test time, build-essential for jpype1 compilation)
8890
RUN apt-get update && apt-get install -y \
@@ -161,7 +163,7 @@ FROM python-builder AS export
161163
# The dist directory is preserved from python-builder stage
162164

163165
# Stage 5: Test the built wheel
164-
FROM python:3.12-slim AS tester
166+
FROM python:${PYTHON_VERSION}-slim AS tester
165167

166168
# Install Java runtime for JPype
167169
RUN apt-get update && apt-get install -y \

bindings/python/build.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ NC='\033[0m' # No Color
1414

1515
# Parse command line arguments
1616
PLATFORM="${1:-}"
17+
PYTHON_VERSION="${2:-3.12}"
1718

1819
print_header() {
1920
echo -e "${BLUE}╔════════════════════════════════════════════════════════════╗${NC}"
@@ -23,7 +24,7 @@ print_header() {
2324
}
2425

2526
print_usage() {
26-
echo "Usage: $0 [PLATFORM]"
27+
echo "Usage: $0 [PLATFORM] [PYTHON_VERSION]"
2728
echo ""
2829
echo "Builds arcadedb-embedded package with bundled JRE"
2930
echo "No external Java installation required!"
@@ -37,16 +38,19 @@ print_usage() {
3738
echo " windows/amd64 Windows x86_64 (native build on Windows)"
3839
echo " windows/arm64 Windows ARM64 (native build on Windows)"
3940
echo ""
41+
echo "PYTHON_VERSION:"
42+
echo " Python version for wheel (default: 3.12)"
43+
echo " Examples: 3.10, 3.11, 3.12, 3.13, 3.14"
44+
echo ""
4045
echo "Build Methods:"
4146
echo " Native: macOS and Windows build natively on their platforms"
4247
echo " Docker: Linux uses Docker for manylinux compliance"
4348
echo ""
4449
echo "Examples:"
45-
echo " $0 # Build for current platform (auto-detect)"
46-
echo " $0 linux/amd64 # Build for Linux x86_64 (via Docker)"
47-
echo " $0 linux/arm64 # Build for Linux ARM64 (via Docker)"
48-
echo " $0 darwin/arm64 # Build for macOS ARM64 (native on macOS)"
49-
echo " $0 windows/arm64 # Build for Windows ARM64 (native on Windows)"
50+
echo " $0 # Build for current platform with Python 3.12"
51+
echo " $0 linux/amd64 # Build for Linux x86_64 with Python 3.12 (via Docker)"
52+
echo " $0 linux/amd64 3.11 # Build for Linux x86_64 with Python 3.11 (via Docker)"
53+
echo " $0 darwin/arm64 3.12 # Build for macOS ARM64 with Python 3.12 (native)"
5054
echo ""
5155
echo "Package features:"
5256
echo " ✅ Bundled platform-specific JRE (no Java required)"
@@ -157,6 +161,7 @@ fi
157161
echo -e "${CYAN}📋 Build Configuration:${NC}"
158162
echo -e " Package: ${YELLOW}arcadedb-embedded${NC}"
159163
echo -e " Platform: ${YELLOW}${PLATFORM}${NC}"
164+
echo -e " Python Version: ${YELLOW}${PYTHON_VERSION}${NC}"
160165
echo -e " JRE: ${YELLOW}Bundled (end users need no Java)${NC}"
161166
echo -e " Build Method: ${YELLOW}${BUILD_METHOD}${NC}"
162167
echo ""
@@ -209,6 +214,7 @@ else
209214
docker build \
210215
--pull \
211216
--platform "$DOCKER_PLATFORM" \
217+
--build-arg PYTHON_VERSION="$PYTHON_VERSION" \
212218
--build-arg PACKAGE_NAME="$PACKAGE_NAME" \
213219
--build-arg PACKAGE_DESCRIPTION="$DESCRIPTION" \
214220
--build-arg ARCADEDB_TAG="$DOCKER_TAG" \
@@ -223,6 +229,7 @@ else
223229
echo -e "${CYAN}🧪 Running tests in Docker...${NC}"
224230
docker build \
225231
--platform "$DOCKER_PLATFORM" \
232+
--build-arg PYTHON_VERSION="$PYTHON_VERSION" \
226233
--build-arg PACKAGE_NAME="$PACKAGE_NAME" \
227234
--build-arg PACKAGE_DESCRIPTION="$DESCRIPTION" \
228235
--build-arg ARCADEDB_TAG="$DOCKER_TAG" \

0 commit comments

Comments
 (0)