Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade python to 3.12 #1289

Merged
merged 4 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- uses: actions/setup-python@v5
if: steps.cache-libs.outputs.cache-hit != 'true'
with:
python-version: '3.10'
python-version: '3.12'

- name: Install dependencies
if: steps.cache-libs.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- uses: actions/setup-python@v5
if: steps.cache-libs.outputs.cache-hit != 'true'
with:
python-version: '3.10'
python-version: '3.12'
- name: Install NumPy
if: steps.cache-libs.outputs.cache-hit != 'true'
run: pip install --no-cache-dir --user numpy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
# Setup Python
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install NumPy
run: pip install --no-cache-dir --user numpy

Expand All @@ -141,7 +141,7 @@ jobs:
# Setup Python
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install NumPy
run: pip install --no-cache-dir --user numpy

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: actions/setup-python@v5
if: steps.cache-libs.outputs.cache-hit != 'true'
with:
python-version: '3.10'
python-version: '3.12'
- name: Install NumPy
if: steps.cache-libs.outputs.cache-hit != 'true'
run: pip install --no-cache-dir --user numpy
Expand Down
32 changes: 17 additions & 15 deletions docker/linux/x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ RUN curl https://apt.llvm.org/llvm.sh -o llvm.sh && \
ln -sf /usr/bin/clang++-16 /usr/bin/clang++ && \
ln -sf /usr/bin/clang-format-16 /usr/bin/clang-format

# Install Python 3.12
RUN add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && \
apt-get install -y --no-install-recommends python3.12 python3.12-dev python3.12-venv python3-pip && \
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.12 get-pip.py && \
update-alternatives --install /usr/local/bin/python python /usr/bin/python3.12 10


FROM base AS android

WORKDIR /tmp
Expand All @@ -62,8 +71,8 @@ ARG ANDROID_SDK_BUILD_TOOLS_VERSION
ARG ANDROID_SDK_VERSION
ARG ANDROID_NDK_VERSION

ENV COMMANDLINETOOLS_ZIP commandlinetools.zip
ENV COMMANDLINETOOLS_SHA256 124f2d5115eee365df6cf3228ffbca6fc3911d16f8025bebd5b1c6e2fcfa7faf
ENV COMMANDLINETOOLS_ZIP=commandlinetools.zip
ENV COMMANDLINETOOLS_SHA256=124f2d5115eee365df6cf3228ffbca6fc3911d16f8025bebd5b1c6e2fcfa7faf


RUN curl -L https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip -o ${COMMANDLINETOOLS_ZIP} && \
Expand All @@ -86,13 +95,6 @@ WORKDIR /tmp
# install Android SDK and NDK
COPY --from=android /opt/android /opt/android

# Setup Python
RUN apt-get install -y --no-install-recommends python3.9 python3.9-dev python3.9-distutils && \
curl -L https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.9 get-pip.py && \
update-alternatives --install /usr/local/bin/python python /usr/bin/python3.9 10 && \
update-alternatives --install /usr/local/bin/pip pip /usr/local/bin/pip3.9 10

# Install NuGet
RUN gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list && \
Expand Down Expand Up @@ -129,20 +131,20 @@ RUN addgroup wheel && useradd -u ${UID} -m mediapipe && usermod -aG wheel mediap
USER mediapipe
WORKDIR /home/mediapipe

ENV NPM_PREFIX /home/mediapipe/.npm-packages
ENV PATH ${NPM_PREFIX}/bin:/home/mediapipe/.local/bin:${PATH}
ENV NPM_PREFIX=/home/mediapipe/.npm-packages
ENV PATH=${NPM_PREFIX}/bin:/home/mediapipe/.local/bin:${PATH}

# install numpy
RUN pip install --no-cache-dir --user numpy
RUN python -m pip install --no-cache-dir --user numpy


FROM builder

ARG ANDROID_NDK_VERSION

ENV ANDROID_HOME /opt/android
ENV ANDROID_NDK_HOME /opt/android/ndk/${ANDROID_NDK_VERSION}
ENV PYTHON_BIN_PATH /usr/bin/python3.9
ENV ANDROID_HOME=/opt/android
ENV ANDROID_NDK_HOME=/opt/android/ndk/${ANDROID_NDK_VERSION}
ENV PYTHON_BIN_PATH=/usr/bin/python3.12

COPY packages.config .
COPY .bazelrc .
Expand Down
2 changes: 1 addition & 1 deletion docker/windows/x86_64/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# escape=`

ARG NODE_VERSION=18.17.1
ARG PYTHON_VERSION=3.9.9
ARG PYTHON_VERSION=3.12.8
ARG ANDROID_SDK_VERSION=30
ARG ANDROID_NDK_VERSION=21.4.7075529

Expand Down
Loading