Skip to content

Commit 13d5949

Browse files
authored
Merge pull request #125 from vmware-labs/python3.12
Python3.12
2 parents 83be643 + 2ede7fe commit 13d5949

File tree

16 files changed

+240
-21
lines changed

16 files changed

+240
-21
lines changed

.github/workflows/build-python.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
flavor: ["", "-wasmedge", "-aio", "-aio-wasmedge"]
16-
version: ["3.11.3", "3.11.4"]
16+
version: ["3.11.3", "3.11.4", "3.12.0"]
1717
runs-on: ubuntu-latest
1818
steps:
1919
- name: Checkout repository

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ build-staging
55
node_modules
66
target
77
.vscode/**
8+
.python-version
89
*.log
910
# Except this file
1011
!.gitignore

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ python/v*:
2727
$(eval $(call create_flavor_targets,python,v3.11.1,aio wasmedge aio-wasmedge))
2828
$(eval $(call create_flavor_targets,python,v3.11.3,aio wasmedge aio-wasmedge))
2929
$(eval $(call create_flavor_targets,python,v3.11.4,aio wasmedge aio-wasmedge))
30+
$(eval $(call create_flavor_targets,python,v3.12.0,aio wasmedge aio-wasmedge))
3031

3132
.PHONY: oci-python-3.11.1
3233
oci-python-3.11.1: python/v3.11.1

python/Dockerfile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
ARG WASI_SDK_VERSION
2-
ARG PY_VERSION=3.11.0
3-
ARG PY_SHORT_VERSION=3.11
4-
5-
FROM ghcr.io/vmware-labs/wasmlabs/wasi-builder:${WASI_SDK_VERSION} as build-host-python
6-
ARG PY_VERSION
7-
ARG PY_SHORT_VERSION
8-
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
9-
zlib1g-dev
10-
WORKDIR /tmp
11-
RUN wget -c https://www.python.org/ftp/python/${PY_VERSION}/Python-${PY_VERSION}.tar.xz && tar -Jxf Python-${PY_VERSION}.tar.xz
12-
WORKDIR /tmp/Python-${PY_VERSION}
13-
RUN ./configure --enable-optimizations --prefix=/opt/python${PY_SHORT_VERSION}
14-
RUN make -j4 && make install
2+
ARG PY_VERSIONS="3.12.0 3.11.4"
3+
ARG PY_DEFAULT_VERSION=3.12.0
154

165
FROM ghcr.io/vmware-labs/wasmlabs/wasi-builder:${WASI_SDK_VERSION}
17-
ARG PY_SHORT_VERSION
6+
ARG PY_VERSIONS
7+
ARG PY_DEFAULT_VERSION
188
# If more capabilities are required from the python-builder, consult this
199
# github workflow configuration for a list of possible dependencies -
2010
# https://github.com/python/cpython/blob/main/.github/workflows/posix-deps-apt.sh
21-
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
22-
tcl
11+
RUN DEBIAN_FRONTEND=noninteractive apt update && \
12+
apt install -y --no-install-recommends \
13+
libssl-dev \
14+
tcl \
15+
zlib1g-dev
16+
17+
ENV HOME="/root"
18+
WORKDIR ${HOME}
19+
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
20+
ENV PYENV_ROOT="${HOME}/.pyenv"
21+
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
22+
23+
RUN pyenv install ${PY_VERSIONS}
24+
RUN pyenv global ${PY_DEFAULT_VERSION}
2325

24-
COPY --from=build-host-python /opt/python${PY_SHORT_VERSION}/ /opt/python${PY_SHORT_VERSION}/
25-
RUN update-alternatives --install /usr/bin/python3 python3 /opt/python${PY_SHORT_VERSION}/bin/python${PY_SHORT_VERSION} 110
26-
RUN update-alternatives --install /usr/bin/python${PY_SHORT_VERSION} python${PY_SHORT_VERSION} /opt/python${PY_SHORT_VERSION}/bin/python${PY_SHORT_VERSION} 110
26+
WORKDIR /wlr

python/test/run_me.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ TESTS=$(for t in */test.py; do echo $(dirname $t); done)
1010

1111
status=0
1212

13-
for test_dir in "$TESTS"; do
13+
for test_dir in ${TESTS}; do
1414
echo "Running test in '${test_dir}'..."
1515
if diff ${test_dir}/test.stdout <($WLR_TEST_RUNTIME \
1616
--mapdir /usr::${WLR_OUTPUT}/usr \

python/v3.11.1/wlr-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ then
66
exit 1
77
fi
88

9+
pyenv local ${WLR_PY_BUILDER_VERSION}
10+
911
cd "${WLR_SOURCE_PATH}"
1012

1113
if [[ "${WLR_BUILD_FLAVOR}" == *"aio"* ]]

python/v3.11.1/wlr-env-repo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ then
77
unset WLR_ENV_NAME
88
unset WLR_PACKAGE_VERSION
99
unset WLR_PACKAGE_NAME
10+
unset WLR_PY_BUILDER_VERSION
1011
return
1112
fi
1213

@@ -15,3 +16,4 @@ export WLR_REPO_BRANCH=v3.11.1
1516
export WLR_ENV_NAME=python/v3.11.1
1617
export WLR_PACKAGE_VERSION=3.11.1
1718
export WLR_PACKAGE_NAME=python
19+
export WLR_PY_BUILDER_VERSION=3.11.4

python/v3.11.3/wlr-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ then
66
exit 1
77
fi
88

9+
pyenv local ${WLR_PY_BUILDER_VERSION}
10+
911
cd "${WLR_SOURCE_PATH}"
1012

1113
if [[ "${WLR_BUILD_FLAVOR}" == *"aio"* ]]

python/v3.11.3/wlr-env-repo.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ then
77
unset WLR_ENV_NAME
88
unset WLR_PACKAGE_VERSION
99
unset WLR_PACKAGE_NAME
10+
unset WLR_PY_BUILDER_VERSION
1011
return
1112
fi
1213

@@ -15,3 +16,4 @@ export WLR_REPO_BRANCH=v3.11.3
1516
export WLR_ENV_NAME=python/v3.11.3
1617
export WLR_PACKAGE_VERSION=3.11.3
1718
export WLR_PACKAGE_NAME=python
19+
export WLR_PY_BUILDER_VERSION=3.11.4

python/v3.11.4/wlr-build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ then
66
exit 1
77
fi
88

9+
pyenv local ${WLR_PY_BUILDER_VERSION}
10+
911
cd "${WLR_SOURCE_PATH}"
1012

1113
if [[ "${WLR_BUILD_FLAVOR}" == *"aio"* ]]

0 commit comments

Comments
 (0)