Skip to content

Commit

Permalink
Add polars
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Dec 20, 2024
1 parent ec731bb commit 53461c2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ PLOTNINE_WHEEL=plotnine-$(PLOTNINE_VERSION)-py3-none-any.whl
# Pyodide, Emscripten, or Python versions change here.
LIBSASS_WHEEL=libsass-0.23.0-cp312-abi3-pyodide_2024_0_wasm32.whl

# polars is built in georgestagg/polars
# When pyodide includes polars, we will be able to remove this.
POLARS_WHEEL=polars-1.17.1-cp39-abi3-emscripten_3_1_58_wasm32.whl

VENV = venv
PYBIN = $(VENV)/bin

Expand Down Expand Up @@ -175,7 +179,8 @@ pyodide_packages_local: $(BUILD_DIR)/shinylive/pyodide/$(HTMLTOOLS_WHEEL) \
$(BUILD_DIR)/shinylive/pyodide/$(SHINYWIDGETS_WHEEL) \
$(BUILD_DIR)/shinylive/pyodide/$(FAICONS_WHEEL) \
$(BUILD_DIR)/shinylive/pyodide/$(PLOTNINE_WHEEL) \
$(BUILD_DIR)/shinylive/pyodide/$(LIBSASS_WHEEL)
$(BUILD_DIR)/shinylive/pyodide/$(LIBSASS_WHEEL) \
$(BUILD_DIR)/shinylive/pyodide/$(POLARS_WHEEL)

$(BUILD_DIR)/shinylive/pyodide/$(HTMLTOOLS_WHEEL): $(PACKAGE_DIR)/$(HTMLTOOLS_WHEEL)
mkdir -p $(BUILD_DIR)/shinylive/pyodide
Expand Down Expand Up @@ -211,6 +216,11 @@ $(BUILD_DIR)/shinylive/pyodide/$(LIBSASS_WHEEL): $(PACKAGE_DIR)/$(LIBSASS_WHEEL)
rm -f $(BUILD_DIR)/shinylive/pyodide/libsass*.whl
cp $(PACKAGE_DIR)/$(LIBSASS_WHEEL) $(BUILD_DIR)/shinylive/pyodide/$(LIBSASS_WHEEL)

$(BUILD_DIR)/shinylive/pyodide/$(POLARS_WHEEL): $(PACKAGE_DIR)/$(POLARS_WHEEL)
mkdir -p $(BUILD_DIR)/shinylive/pyodide
rm -f $(BUILD_DIR)/shinylive/pyodide/$(POLARS_WHEEL)
cp $(PACKAGE_DIR)/$(POLARS_WHEEL) $(BUILD_DIR)/shinylive/pyodide/$(POLARS_WHEEL)

$(BUILD_DIR)/export_template/index.html: export_template/index.html
mkdir -p $(BUILD_DIR)/export_template
cp export_template/index.html $(BUILD_DIR)/export_template/index.html
Expand Down Expand Up @@ -316,6 +326,10 @@ $(PACKAGE_DIR)/$(LIBSASS_WHEEL): $(PYBIN) $(PACKAGE_DIR)/$(LIBSASS_WHEEL)
rm -f $(PACKAGE_DIR)/libsass*.whl
curl --fail -L https://pkg.garrickadenbuie.com/libsass-python/$(LIBSASS_WHEEL) -o $(PACKAGE_DIR)/$(LIBSASS_WHEEL)

$(PACKAGE_DIR)/$(POLARS_WHEEL): $(PYBIN) $(PACKAGE_DIR)/$(POLARS_WHEEL)
rm -f $(PACKAGE_DIR)/polars*.whl
curl --fail -L https://github.com/georgestagg/polars/releases/download/py-1.17.1/$(POLARS_WHEEL) -o $(PACKAGE_DIR)/$(POLARS_WHEEL)

## Update the shinylive_lock.json file, based on shinylive_requirements.json
update_packages_lock: $(PYBIN) $(BUILD_DIR)/shinylive/pyodide
$(PYBIN)/pip install -r requirements-dev.txt
Expand Down
13 changes: 12 additions & 1 deletion shinylive_lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"url": null,
"depends": [
{"name": "ipywidgets", "specs": [[">=", "7.6.5"]]},
{"name": "jupyter_core", "specs": []},
{"name": "jupyter-core", "specs": []},
{"name": "shiny", "specs": [[">=", "0.6.1.9005"]]},
{"name": "python-dateutil", "specs": [[">=", "2.8.2"]]}
],
Expand Down Expand Up @@ -537,5 +537,16 @@
"imports": [
"jupyter_core"
]
},
"polars": {
"name": "polars",
"version": "1.17.1",
"filename": "polars-1.17.1-cp39-abi3-emscripten_3_1_58_wasm32.whl",
"sha256": null,
"url": null,
"depends": [],
"imports": [
"polars"
]
}
}
6 changes: 6 additions & 0 deletions shinylive_requirements.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,11 @@
"source": "local",
"version": "latest",
"comment": "Built for pyodide in https://github.com/gadenbuie/libsass-python/tree/dev"
},
{
"name": "polars",
"source": "local",
"version": "latest",
"comment": "Built for pyodide in https://github.com/georgestagg/polars"
}
]

0 comments on commit 53461c2

Please sign in to comment.