Skip to content

Commit

Permalink
Store pyodide tarball locally
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Nov 29, 2023
1 parent d0e441f commit 4c7f95f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/node_modules/
/packages/*.whl
/dist/
/downloads/
/build/
__pycache__
/typings/
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SHINYLIVE_VERSION = $(shell node -p "require('./package.json').version")

PYODIDE_VERSION = 0.22.1
PYODIDE_DIST_FILENAME = pyodide-$(PYODIDE_VERSION).tar.bz2
DOWNLOAD_DIR = ./downloads
BUILD_DIR = ./build
PACKAGE_DIR = ./packages
DIST_DIR = ./dist
Expand Down Expand Up @@ -122,11 +123,16 @@ $(BUILD_DIR)/shinylive/style-resets.css: src/style-resets.css
mkdir -p $(BUILD_DIR)/shinylive
cp src/style-resets.css $(BUILD_DIR)/shinylive

$(BUILD_DIR)/shinylive/pyodide:
$(DOWNLOAD_DIR)/$(PYODIDE_DIST_FILENAME):
mkdir -p $(DOWNLOAD_DIR)
cd $(DOWNLOAD_DIR) && \
curl --fail -L -O https://github.com/pyodide/pyodide/releases/download/$(PYODIDE_VERSION)/$(PYODIDE_DIST_FILENAME)

$(BUILD_DIR)/shinylive/pyodide: $(DOWNLOAD_DIR)/$(PYODIDE_DIST_FILENAME)
mkdir -p $(BUILD_DIR)/shinylive/pyodide
cd $(BUILD_DIR)/shinylive && \
curl --fail -L https://github.com/pyodide/pyodide/releases/download/$(PYODIDE_VERSION)/$(PYODIDE_DIST_FILENAME) \
| tar --exclude "*test*.tar" --exclude "node_modules" -xvj
tar --exclude "*test*.tar" --exclude "node_modules" \
-xvjf $(DOWNLOAD_DIR)/$(PYODIDE_DIST_FILENAME) \
-C $(BUILD_DIR)/shinylive

$(BUILD_DIR)/shinylive/webr: webr
webr:
Expand Down Expand Up @@ -331,9 +337,9 @@ clean:
rm -rf $(PACKAGE_DIR)/*.whl $(BUILD_DIR) $(DIST_DIR) \
$(SHINYLIVE_DIR)/py $(SHINYLIVE_DIR)/r quarto/docs/ typings/

## Remove all build files and venv/
## Remove all build files, venv/, and downloads/
distclean: clean
rm -rf $(VENV)
rm -rf $(VENV) $(DOWNLOAD_DIR)

## Run tests
test:
Expand Down

0 comments on commit 4c7f95f

Please sign in to comment.