Skip to content

Commit

Permalink
Makefile: Only install pyodide-build once
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Feb 28, 2025
1 parent 7d13cc8 commit 299db30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ tools/symlinks
xbuildenv/
.pyodide-xbuildenv*
DS_Store
.pyodide_build_installed
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,16 @@ $(eval $(call preprocess-js,pyproxy.ts))
$(eval $(call preprocess-js,python2js_buffer.js))
$(eval $(call preprocess-js,js2python.js))

.PHONY: pyodide_build
pyodide_build:
@echo "Ensuring pyodide-build is installed"
.pyodide_build_installed:
pip install -e ./pyodide-build
@which pyodide >/dev/null
touch .pyodide_build_installed


# Recursive wildcard
rwildcard=$(wildcard $1) $(foreach d,$1,$(call rwildcard,$(addsuffix /$(notdir $d),$(wildcard $(dir $d)*))))

dist/python_stdlib.zip: $(call rwildcard,src/py/*) $(CPYTHONLIB)
make pyodide_build
dist/python_stdlib.zip: $(call rwildcard,src/py/*) $(CPYTHONLIB) .pyodide_build_installed
pyodide create-zipfile $(CPYTHONLIB) src/py --exclude "$(PYZIP_EXCLUDE_FILES)" --stub "$(PYZIP_JS_STUBS)" --compression-level "$(PYODIDE_ZIP_COMPRESSION_LEVEL)" --output $@

dist/test.html: src/templates/test.html
Expand Down Expand Up @@ -316,8 +314,7 @@ $(CPYTHONLIB): emsdk/emsdk/.complete
@date +"[%F %T] done building cpython..."


dist/pyodide-lock.json: FORCE
make pyodide_build
dist/pyodide-lock.json: FORCE .pyodide_build_installed
@date +"[%F %T] Building packages..."
make -C packages
@date +"[%F %T] done building packages..."
Expand Down

0 comments on commit 299db30

Please sign in to comment.