Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ All prefixed with `SANDBOX_` unless noted:

Runtimes are auto-discovered from `/pkgs` at startup. Each package provides `compile` and `run` shell scripts. Currently tested and supported:

- **Python** 3.14 -- includes `matplotlib`, `numpy`, `pandas`, `scipy`, `statsmodels`, chDB (`chdb`), and other scientific packages
- **Python** 3.14 -- includes `matplotlib`, `numpy`, `pandas`, `scipy`, `statsmodels`, chDB (`chdb`), geospatial (`geopandas`, `rasterio`, `rioxarray`, `pyproj`), and other scientific packages
- **Node.js** 24 -- runs `.js` files with curated offline npm packages
- **Bun** (JavaScript/TypeScript) -- runs `.js`, `.ts`, and `.bun` files with the same curated offline package set

Expand Down
10 changes: 9 additions & 1 deletion build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,15 @@ install_python_packages() {
fonttools \
pytesseract \
pdfminer \
vsdx; then
vsdx \
rasterio \
rioxarray \
geopandas \
pyogrio \
pyproj \
osmnx \
folium \
gpxpy; then
python_packages_installed=true
else
echo "ERROR: Python package installation failed"
Expand Down
10 changes: 9 additions & 1 deletion docker/package-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,15 @@ if [ -f "$PIP_PATH" ]; then
fonttools \
pytesseract \
pdfminer \
vsdx; then
vsdx \
rasterio \
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
rioxarray \
geopandas \
pyogrio \
pyproj \
osmnx \
folium \
gpxpy; then
echo "ERROR: Python package installation failed"
INSTALL_FAILED=true
else
Expand Down
16 changes: 16 additions & 0 deletions test-sandbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,21 @@ test_statsmodels() {
fi
}

test_geospatial() {
log_info "Testing geospatial stack import and reprojection..."
result=$(execute_sandbox '{"language":"python","version":"3.14.4","files":[{"content":"import geopandas as gpd\nimport rasterio\nfrom shapely.geometry import Point\ngdf = gpd.GeoDataFrame(geometry=[Point(-74.006, 40.7128)], crs=\"EPSG:4326\").to_crs(\"EPSG:26918\")\nprint(round(float(gdf.geometry.iloc[0].x), 2))"}]}')

stdout=$(echo "$result" | jq -r '.run.stdout // empty')
if [[ "$stdout" =~ ^[0-9.-]+ ]]; then
log_success "geospatial: got '$stdout'"
return 0
else
log_error "geospatial: expected numeric UTM 18N easting, got '$stdout'"
echo "$result" | jq .
return 1
fi
}

test_chdb() {
log_info "Testing chDB import and query..."
result=$(execute_sandbox '{"language":"python","version":"3.14.4","files":[{"content":"import chdb\nprint(chdb.query(\"SELECT sum(number) FROM numbers(5)\", \"CSV\"))"}]}')
Expand Down Expand Up @@ -400,6 +415,7 @@ FAILED=0
test_basic_python || FAILED=$((FAILED + 1))
test_numpy || FAILED=$((FAILED + 1))
test_statsmodels || FAILED=$((FAILED + 1))
test_geospatial || FAILED=$((FAILED + 1))
test_chdb || FAILED=$((FAILED + 1))
test_file_write || FAILED=$((FAILED + 1))
test_network_blocked || FAILED=$((FAILED + 1))
Expand Down