Skip to content
Open
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
25 changes: 25 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM mcr.microsoft.com/devcontainers/python:3-3.12-bookworm

ARG TARGETARCH

RUN rm -f /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
libcairo2-dev \
pkg-config \
python3-dev \
&& changie_version="1.26.0" \
&& case "${TARGETARCH}" in \
amd64) changie_sha256="8586d01c321d3958bac72a7b3aeb29744b31bdabb06ffc65dbc4fb018a04f3d1" ;; \
arm64) changie_sha256="d31e2b7570e479fdebf43737458173ee9bdc90e3cd3d5aece0bf15a43a71eb50" ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac \
&& changie_deb="changie_${changie_version}_linux_${TARGETARCH}.deb" \
&& curl -fsSL \
"https://github.com/miniscruff/changie/releases/download/v${changie_version}/${changie_deb}" \
-o "/tmp/${changie_deb}" \
&& echo "${changie_sha256} /tmp/${changie_deb}" | sha256sum -c - \
&& apt-get install -y "/tmp/${changie_deb}" \
Comment thread
ayeshurun marked this conversation as resolved.
&& rm -f "/tmp/${changie_deb}" \
&& rm -rf /var/lib/apt/lists/*
7 changes: 4 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/node:2": {}
"ghcr.io/devcontainers/features/azure-cli:1": {}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
9 changes: 9 additions & 0 deletions .devcontainer/local.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Optional pip index override for the dev container setup script.
#
# Copy this file to `.devcontainer/local.env` and edit it. That path is
# git-ignored so private mirror URLs are not committed accidentally.
#
# cp .devcontainer/local.env.example .devcontainer/local.env
#
# Use this when the network requires an internal Python package mirror.
# PIP_INDEX_URL=https://your-mirror.example.com/pypi/simple/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,5 @@ marimo/_static/
marimo/_lsp/
__marimo__/

devcontainer.local.json
.devcontainer/local.env
devcontainer-lock.json
19 changes: 11 additions & 8 deletions scripts/install_dev_container_dependencies.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env bash
set -e
set -euo pipefail

apt-get update && apt-get install -y \
cmake \
libcairo2-dev \
pkg-config \
python3-dev
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd "${script_dir}/.." && pwd)"

pip3 install -r requirements-dev.txt -r requirements-docs.txt
local_env="${repo_root}/.devcontainer/local.env"
if [ -f "$local_env" ]; then
pip_index_url="$(sed -n 's/^PIP_INDEX_URL=//p' "$local_env" | tail -n 1)"
if [ -n "$pip_index_url" ]; then
export PIP_INDEX_URL="$pip_index_url"
fi
fi

npm install -g changie
pip3 install -r "${repo_root}/requirements-dev.txt" -r "${repo_root}/requirements-docs.txt"