From d2d2d62bbe8751553d13dc509c38fbf65efa358b Mon Sep 17 00:00:00 2001 From: Alc-Alc Date: Thu, 28 Nov 2024 10:46:21 +0530 Subject: [PATCH 1/3] fix(devcontainers): Replace PDM with UV --- .devcontainer/Dockerfile | 6 ++++-- .devcontainer/devcontainer.json | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d613795e8e..864a501fe8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,8 +1,10 @@ # [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): 3, 3.13, 3.12, 3.11, 3.10, 3.9, 3.8, 3-bookworm, 3.13-bookworm, 3.12-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm, 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster ARG VARIANT=3.12-bookworm -FROM python:${VARIANT} +FROM ghcr.io/astral-sh/uv:python${VARIANT} +ENV UV_LOCKED=1 +ENV UV_PYTHON=/usr/local/bin/python RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get purge -y fish -RUN python3 -m pip install --upgrade setuptools cython pip pdm +RUN python3 -m pip install --upgrade setuptools cython pip diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7164363c93..cc7e84c193 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -59,8 +59,8 @@ }, "forwardPorts": [8000], "postCreateCommand": [ - "pdm", - "install" + "uv", + "sync" ], "remoteUser": "vscode" } From a746281fbee48b1d57907143446b296439f15a60 Mon Sep 17 00:00:00 2001 From: Alc-Alc Date: Thu, 28 Nov 2024 21:17:57 +0530 Subject: [PATCH 2/3] chore(devcontainers): Address review comments --- .devcontainer/Dockerfile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 864a501fe8..6b949bd11b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,10 +1,18 @@ # [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): 3, 3.13, 3.12, 3.11, 3.10, 3.9, 3.8, 3-bookworm, 3.13-bookworm, 3.12-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm, 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster -ARG VARIANT=3.12-bookworm -FROM ghcr.io/astral-sh/uv:python${VARIANT} -ENV UV_LOCKED=1 -ENV UV_PYTHON=/usr/local/bin/python +ARG VERSION=3.12 +ARG VARIANT=-bookworm +FROM python:${VERSION}${VARIANT} + +ENV UV_LOCKED=1 UV_PYTHON=${VERSION} PATH="/root/.local/bin/:$PATH" + +# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get purge -y fish + && apt-get purge -y fish \ + && apt-get install -y --no-install-recommends curl ca-certificates + +ADD https://astral.sh/uv/install.sh /uv-installer.sh + +RUN sh /uv-installer.sh && rm /uv-installer.sh RUN python3 -m pip install --upgrade setuptools cython pip From eb2fb410c47137699eda61d3c7275caf33006fc6 Mon Sep 17 00:00:00 2001 From: Alc-Alc Date: Fri, 29 Nov 2024 09:43:01 +0530 Subject: [PATCH 3/3] chore(devcontainers): Better approach to get uv --- .devcontainer/Dockerfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6b949bd11b..2513f353b5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,18 +1,13 @@ # [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): 3, 3.13, 3.12, 3.11, 3.10, 3.9, 3.8, 3-bookworm, 3.13-bookworm, 3.12-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm, 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster ARG VERSION=3.12 ARG VARIANT=-bookworm - FROM python:${VERSION}${VARIANT} -ENV UV_LOCKED=1 UV_PYTHON=${VERSION} PATH="/root/.local/bin/:$PATH" +ARG VERSION +ENV UV_LOCKED=1 UV_PYTHON=${VERSION} +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ -# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get purge -y fish \ - && apt-get install -y --no-install-recommends curl ca-certificates - -ADD https://astral.sh/uv/install.sh /uv-installer.sh - -RUN sh /uv-installer.sh && rm /uv-installer.sh + && apt-get purge -y fish RUN python3 -m pip install --upgrade setuptools cython pip