Skip to content

Commit 5bfc865

Browse files
committed
readd virtualenv. build-whl is successful; use-whl still fails
1 parent 543d8f5 commit 5bfc865

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

Dockerfile.build-whl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
1414
--no-install-recommends \
1515
&& rm -rf /var/lib/apt/lists/*
1616

17-
# RUN python -m venv /venv
17+
RUN python -m venv /venv
1818
# normall we do some uv here; but for simplicity lets not
19-
# ENV PATH="/venv/bin:$PATH"
20-
# RUN /venv/bin/python -m pip install pydantic
19+
ENV PATH="/venv/bin:$PATH"
20+
RUN /venv/bin/python -m pip install pydantic==2.11.7
2121

2222
# install rust
2323
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
@@ -29,9 +29,6 @@ COPY ./component /component
2929
# build pydantic whl
3030
RUN bash /component/build_pydantic.sh
3131

32-
# copy to venv location
33-
# RUN cp -R /wasi_deps/pydantic_core /venv/lib/python3.13/site-packages/
34-
3532
WORKDIR /component
3633

3734
# build wasm

Dockerfile.use-whl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
1414
--no-install-recommends \
1515
&& rm -rf /var/lib/apt/lists/*
1616

17-
# RUN python -m venv /venv
17+
RUN python -m venv /venv
1818
# normall we do some uv here; but for simplicity lets not
19-
# ENV PATH="/venv/bin:$PATH"
20-
# RUN /venv/bin/python -m pip install pydantic
19+
ENV PATH="/venv/bin:$PATH"
20+
RUN /venv/bin/python -m pip install pydantic==2.11.7
2121

2222
# install pydantic wasi to folder
2323
RUN pip install --target /wasi_deps --platform any --platform wasi_0_0_0_wasm32 --python-version "3.13" --only-binary :all: --index-url https://benbrandt.github.io/wasi-wheels/ --extra-index-url https://pypi.org/simple --upgrade pydantic_core pydantic
2424

25-
# copy to venv location
26-
# RUN cp -R /wasi_deps/pydantic_core /venv/lib/python3.13/site-packages/
27-
2825
RUN pip install componentize-py
2926
COPY ./app /app
3027
COPY ./component /component

component/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
componentize-py -d main.wit -w hello bindings some-world
44

55
cd /app
6-
componentize-py -w hello -d /component/main.wit componentize --stub-wasi main -o /component/output.wasm -p . -p /wasi_deps
6+
componentize-py -w hello -d /component/main.wit componentize --stub-wasi main -o /component/output.wasm -p . -p /wasi_deps -p /venv/**/site-packages

component/build_pydantic.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ cargo run -- build pydantic-core 2.33.2 --python-versions py3-13
1919

2020
# install wheel
2121
pip install --target /wasi_deps --platform any --platform wasi_0_0_0_wasm32 --python-version "3.13" --only-binary :all: `find . -name \*cp313-cp313-wasi_0_0_0_wasm32.whl`
22-
pip install --target /wasi_deps --platform any --platform wasi_0_0_0_wasm32 --python-version "3.13" --only-binary :all: pydantic

0 commit comments

Comments
 (0)