File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ FROM ubuntu
22
33RUN <<EOF
44apt-get update
5- apt-get install -y curl build-essential python3 git cmake pkg-config busybox
5+ apt-get install -y curl build-essential python3-pip git cmake pkg-config busybox
66EOF
77
88ARG TARGETARCH
@@ -15,6 +15,8 @@ ENV WASMTIME_VERSION=26.0.0
1515ENV WIZER_VERSION=7.0.5
1616ENV WASI_VFS_VERSION=0.5.4
1717ENV PYTHON_PATH=/opt/wasi-python
18+ ENV PYTHON_PYLIB=${PYTHON_PATH}/lib/python3.13
19+ ENV PYTHON_SITE=${PYTHON_PYLIB}/site-packages
1820
1921RUN <<EOF
2022mkdir ${WASI_SDK_PATH}
98100EOF
99101
100102RUN <<EOF
101- cd ${PYTHON_PATH}/lib/python3.13
103+ cd ${PYTHON_PYLIB}
102104find . -name __pycache__ -exec rm -rf {} \;
103105rm -rf config-3.13-wasm32-wasi
104106rm -rf _*_support* _pyrepl bdb ensurepip doctest* idlelib pdb pydoc*
105107rm -rf sqlite3 ssl* subprocess* tkinter turtle* venv webbrowser*
106108EOF
109+
110+ RUN pip3 install --target ${PYTHON_SITE} \
111+ --no-compile --platform wasi-wasm32 --only-binary :all: \
112+ attrs bleach charset-normalizer defusedxml idna jmespath jsonschema \
113+ pyasn1 pyparsing python-dateutil rsa tomli ua-parser
114+
115+ RUN <<EOF
116+ cd ${PYTHON_SITE}
117+ find . -name '*.dist-info' -exec rm -rf {} \;
118+ rm -rf bin
119+ /build/cpython/cross-build/build/python -m compileall -b .
120+ EOF
You can’t perform that action at this time.
0 commit comments