Skip to content

Commit a631919

Browse files
authored
chore: fix and update devcontainer (#108)
this PR fixes and updates the VS Code devcontainer: - fix: the previous image `mcr.microsoft.com/vscode/devcontainers/python:3.9-buster` was dropped by Microsoft so switching to a version without specifying the Debian base version and upgrading to Python 3.13 - updates Graal to 25 - updates ANTLR to 4.13.2 - updates protoc to 30.2 - updates buf to 1.58.0 - updates uv to the latest version - adds the --format=docker build option which makes the SHELL dockerfile instruction work with podman - adds a `postCreateCommand` that creates a virtualenv and install the dependencies into it - adds some VS Code settings for pytest integration Signed-off-by: Niels Pardon <[email protected]>
1 parent fadc414 commit a631919

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

.devcontainer/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM mcr.microsoft.com/vscode/devcontainers/python:3.9-buster
1+
FROM mcr.microsoft.com/vscode/devcontainers/python:3.13
22
USER vscode
33
RUN curl -s "https://get.sdkman.io" | bash
44
SHELL ["/bin/bash", "-c"]
5-
RUN source "/home/vscode/.sdkman/bin/sdkman-init.sh" && sdk install java 20.0.2-graalce
6-
RUN mkdir -p ~/lib && cd ~/lib && curl -L -O http://www.antlr.org/download/antlr-4.13.1-complete.jar
5+
RUN source "/home/vscode/.sdkman/bin/sdkman-init.sh" && sdk install java 25-graalce
6+
RUN mkdir -p ~/lib && cd ~/lib && curl -L -O http://www.antlr.org/download/antlr-4.13.2-complete.jar
77
ENV ANTLR_JAR="~/lib/antlr-4.13.1-complete.jar"
8-
RUN cd ~ && curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip && \
9-
unzip protoc-25.1-linux-x86_64.zip -d ~/.local && \
10-
rm protoc-25.1-linux-x86_64.zip
11-
RUN curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.50.0/buf-$(uname -s)-$(uname -m)" -o ~/.local/bin/buf && chmod +x ~/.local/bin/buf
12-
RUN curl -LsSf https://astral.sh/uv/0.7.11/install.sh | sh
8+
RUN cd ~ && curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v30.2/protoc-30.2-linux-x86_64.zip && \
9+
unzip protoc-30.2-linux-x86_64.zip -d ~/.local && \
10+
rm protoc-30.2-linux-x86_64.zip
11+
RUN curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.58.0/buf-$(uname -s)-$(uname -m)" -o ~/.local/bin/buf && chmod +x ~/.local/bin/buf
12+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
1313
USER root

.devcontainer/devcontainer.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "substrait-python-devcontainer",
33
"build": {
44
"context": "..",
5-
"dockerfile": "Dockerfile"
5+
"dockerfile": "Dockerfile",
6+
"options": ["--format=docker"]
67
},
78

89
// Features to add to the dev container. More info: https://containers.dev/features.
@@ -14,10 +15,21 @@
1415
// "forwardPorts": [],
1516

1617
// Use 'postCreateCommand' to run commands after the container is created.
17-
// "postCreateCommand": "poetry install"
18+
"postCreateCommand": "uv venv --clear && uv sync --extra test",
1819

1920
// Configure tool-specific properties.
20-
// "customizations": {},
21+
"customizations": {
22+
"vscode": {
23+
"settings": {
24+
"python.testing.pytestArgs": [
25+
"tests"
26+
],
27+
"python.testing.unittestEnabled": false,
28+
"python.testing.pytestEnabled": true
29+
},
30+
"extensions": []
31+
}
32+
}
2133

2234
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
2335
// "remoteUser": "root"

0 commit comments

Comments
 (0)