Skip to content

Commit fdbce19

Browse files
committed
Working final nano build for pyodide 0.18.0
1 parent 708358b commit fdbce19

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ all: check \
1616
build/pyodide.asm.js \
1717
build/pyodide.js \
1818
build/console.html \
19+
build/distutils.data \
1920
build/packages.json \
21+
$(if $(PYODIDE_BUILD), , "build/test.data") \
22+
$(if $(PYODIDE_BUILD), , "build/test.html") \
2023
build/webworker.js \
2124
build/webworker_dev.js
2225
echo -e "\nSUCCESS!"
@@ -53,6 +56,10 @@ build/pyodide.asm.js: \
5356
-lproxyfs.js \
5457
-lworkerfs.js \
5558
--preload-file $(CPYTHONLIB)@/lib/python$(PYMAJOR).$(PYMINOR) \
59+
$(if $(PYODIDE_BUILD), "", "--preload-file src/webbrowser.py@/lib/python$(PYMAJOR).$(PYMINOR)/webbrowser.py") \
60+
$(if $(PYODIDE_BUILD), "", "--preload-file src/_testcapi.py@/lib/python$(PYMAJOR).$(PYMINOR)/_testcapi.py") \
61+
$(if $(PYODIDE_BUILD), "", "--preload-file src/_testinternalcapi.py@/lib/python$(PYMAJOR).$(PYMINOR)/_testinternalcapi.py") \
62+
$(if $(PYODIDE_BUILD), "", "--preload-file src/pystone.py@/lib/python$(PYMAJOR).$(PYMINOR)/pystone.py") \
5663
--preload-file src/py/pyodide@/lib/python$(PYMAJOR).$(PYMINOR)/site-packages/pyodide \
5764
--preload-file src/py/_pyodide@/lib/python$(PYMAJOR).$(PYMINOR)/site-packages/_pyodide \
5865
--exclude-file "*__pycache__*" \
@@ -220,11 +227,9 @@ FORCE:
220227
check: $(UGLIFYJS)
221228
./tools/dependency-check.sh
222229

223-
224230
minimal :
225231
PYODIDE_PACKAGES+=",micropip" make
226232

227-
228233
debug :
229234
EXTRA_CFLAGS+=" -D DEBUG_F" \
230235
PYODIDE_PACKAGES+=", micropip, pyparsing, pytz, packaging, " \

cpython/Makefile

+8-5
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ $(INSTALL)/lib/$(LIB): $(BUILD)/$(LIB) remove_modules$(PYODIDE_BUILD).txt
4848
rm pybuilddir.txt
4949
cd $(INSTALL)/lib/python$(PYMAJOR).$(PYMINOR)/ && rm -rf `cat $(ROOT)/remove_modules$(PYODIDE_BUILD).txt`
5050
\
51-
# try to run pyminify; If this fails, pyminify is not available. Check your Docker container version!
51+
# try to run pyminify --version;
52+
# If this fails, pyminify is not available.
5253
pyminify --version >/dev/null 2>&1
53-
for py in `find $(INSTALL)/lib/python$(PYMAJOR).$(PYMINOR) -name "*.py"`; \
54-
do echo "Minifying $${py}..."; \
55-
pyminify --remove-literal-statements $${py} > $${py}.min; mv $${py}.min $${py}; \
56-
done
54+
if [ "$(PYODIDE_BUILD)" ]; then \
55+
for py in `find $(INSTALL)/lib/python$(PYMAJOR).$(PYMINOR) -name "*.py"`; \
56+
do echo "Minifying $${py}..."; \
57+
pyminify --remove-literal-statements $${py} > $${py}.min; mv $${py}.min $${py}; \
58+
done \
59+
fi
5760

5861

5962
clean:

cpython/remove_modules_nano.txt

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ crypt.py
3333
dataclasses.py
3434
decimal.py
3535
difflib.py
36-
distutils
3736
doctest.py
3837
dummy_threading.py
3938
_dummy_thread.py

0 commit comments

Comments
 (0)