From bbcf757264bbb15c28ca04d7bb2ea52f0b9eb746 Mon Sep 17 00:00:00 2001 From: Bertrand Awenze Date: Tue, 8 Jul 2025 23:39:08 +0000 Subject: [PATCH 1/4] add post-installation script --- .devcontainer/post-install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 .devcontainer/post-install.sh diff --git a/.devcontainer/post-install.sh b/.devcontainer/post-install.sh new file mode 100755 index 000000000000..589ee361f5cb --- /dev/null +++ b/.devcontainer/post-install.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +echo "Begin post-installation steps..." + +set -e + +echo "Installing pre-commit hooks..." +pre-commit install + +echo "Installing Oh My Zsh plugins..." + +# Install zsh-autosuggestions if not present +if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" ]; then + echo "Cloning zsh-autosuggestions..." + git clone https://github.com/zsh-users/zsh-autosuggestions \ + "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" +fi + +# Install zsh-syntax-highlighting if not present +if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" ]; then + echo "Cloning zsh-syntax-highlighting..." + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \ + "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting" +fi + +echo "Configuring plugins in ~/.zshrc..." +sed -i '/^plugins=/c\plugins=(git zsh-autosuggestions zsh-syntax-highlighting)' ~/.zshrc + +echo "Post-installation steps completed successfully. Enjoy!" From 17f4017e8a0b914d70d08c35baf6dbd17c61de3d Mon Sep 17 00:00:00 2001 From: Bertrand Awenze Date: Tue, 8 Jul 2025 23:41:02 +0000 Subject: [PATCH 2/4] set zsh as default terminal and make post-install execution on postcreate --- .devcontainer/Dockerfile | 5 ++--- .devcontainer/devcontainer.json | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a0bd05f47ec8..edee3bc4febb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,6 +3,5 @@ ARG VARIANT=3.13-bookworm FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT} COPY requirements.txt /tmp/pip-tmp/ RUN python3 -m pip install --upgrade pip \ - && python3 -m pip install --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ - && pipx install pre-commit ruff \ - && pre-commit install + && python3 -m pip install --no-cache-dir -r /tmp/pip-tmp/requirements.txt \ + && pipx install pre-commit ruff diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e23263f5b9de..4639d24f7814 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,10 +7,12 @@ // Update 'VARIANT' to pick a Python version: 3, 3.11, 3.10, 3.9, 3.8 // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local on arm64/Apple Silicon. - "VARIANT": "3.13-bookworm", + "VARIANT": "3.13-bookworm" } }, + "postCreateCommand": "zsh .devcontainer/post-install.sh", + // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. @@ -20,7 +22,8 @@ "python.defaultInterpreterPath": "/usr/local/bin/python", "python.linting.enabled": true, "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy" + "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", + "terminal.integrated.defaultProfile.linux": "zsh" }, // Add the IDs of extensions you want installed when the container is created. From 68b7d6139a23aa30d68ea843f17b622926ddd2ce Mon Sep 17 00:00:00 2001 From: Bertrand Awenze Date: Tue, 8 Jul 2025 23:46:45 +0000 Subject: [PATCH 3/4] rename file --- .devcontainer/devcontainer.json | 2 +- .devcontainer/{post-install.sh => post_install.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .devcontainer/{post-install.sh => post_install.sh} (100%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4639d24f7814..6d925f24413e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ } }, - "postCreateCommand": "zsh .devcontainer/post-install.sh", + "postCreateCommand": "zsh .devcontainer/post_install.sh", // Configure tool-specific properties. "customizations": { diff --git a/.devcontainer/post-install.sh b/.devcontainer/post_install.sh similarity index 100% rename from .devcontainer/post-install.sh rename to .devcontainer/post_install.sh From b316abd0301bab58f377623cbab8487baf704e9b Mon Sep 17 00:00:00 2001 From: Bertrand Awenze Date: Wed, 9 Jul 2025 00:39:56 +0000 Subject: [PATCH 4/4] rename script --- .devcontainer/{post_install.sh => post_install} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .devcontainer/{post_install.sh => post_install} (100%) diff --git a/.devcontainer/post_install.sh b/.devcontainer/post_install similarity index 100% rename from .devcontainer/post_install.sh rename to .devcontainer/post_install