From 07cec31bbd6bf4b6e792a254b859f512be0c189d Mon Sep 17 00:00:00 2001 From: steffen911 Date: Wed, 17 Sep 2025 11:53:38 +0200 Subject: [PATCH 1/5] chore: create devcontainer setup --- .devcontainer/Dockerfile | 8 ++++++++ .devcontainer/devcontainer.json | 7 +++++++ .devcontainer/post-create.sh | 29 +++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/post-create.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..6a892af33 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,8 @@ +# Dev container Dockerfile +FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye + +# Install Poetry +RUN curl -sSL https://install.python-poetry.org | python3 - + +# Install Poetry Plugins +RUN poetry self add poetry-dotenv-plugin || true && poetry self add poetry-bumpversion || true diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..66c72fdff --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ + "name": "Langfuse Python SDK", + "build": { + "dockerfile": "Dockerfile" + }, + "postCreateCommand": "bash .devcontainer/post-create.sh" +} \ No newline at end of file diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh new file mode 100755 index 000000000..eee9a9ba9 --- /dev/null +++ b/.devcontainer/post-create.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e + +echo "🚀 Setting up Langfuse Python SDK development environment..." + +# Install project dependencies including all extras +echo "📚 Installing project dependencies..." +poetry install --all-extras + +# Setup pre-commit hooks +echo "🪝 Setting up pre-commit hooks..." +poetry run pre-commit install + +# Create a basic .env file if it doesn't exist +if [ ! -f .env ]; then + echo "📝 Creating .env file from template..." + cp .env.template .env +fi + +echo "✅ Development environment setup complete!" +echo "" +echo "🎯 Quick start commands:" +echo " poetry run pytest -s -v --log-cli-level=INFO # Run tests" +echo " poetry run ruff format . # Format code" +echo " poetry run ruff check . # Lint code" +echo " poetry run mypy . # Type check" +echo " poetry run pre-commit run --all-files # Run pre-commit" +echo "" From 3bbadc1e88c77401a1c880b4005359c1bc22f8ae Mon Sep 17 00:00:00 2001 From: Steffen Schmitz Date: Wed, 17 Sep 2025 10:59:27 +0000 Subject: [PATCH 2/5] config --- .devcontainer/Dockerfile | 3 --- .devcontainer/devcontainer.json | 3 +++ .devcontainer/post-create.sh | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6a892af33..1ec2a9d82 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,6 +3,3 @@ FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye # Install Poetry RUN curl -sSL https://install.python-poetry.org | python3 - - -# Install Poetry Plugins -RUN poetry self add poetry-dotenv-plugin || true && poetry self add poetry-bumpversion || true diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 66c72fdff..aabe744a2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,5 +3,8 @@ "build": { "dockerfile": "Dockerfile" }, + "containerEnv": { + "PATH": "/root/.local/bin:$PATH" + }, "postCreateCommand": "bash .devcontainer/post-create.sh" } \ No newline at end of file diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index eee9a9ba9..b7c77109d 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -6,6 +6,8 @@ echo "🚀 Setting up Langfuse Python SDK development environment..." # Install project dependencies including all extras echo "📚 Installing project dependencies..." +poetry self add poetry-dotenv-plugin || true +poetry self add poetry-bumpversion || true poetry install --all-extras # Setup pre-commit hooks From 1da75fc53fb8150e2488a6d3184117f5be831b5f Mon Sep 17 00:00:00 2001 From: steffen911 Date: Wed, 17 Sep 2025 13:04:04 +0200 Subject: [PATCH 3/5] chore: install coreutils --- .devcontainer/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1ec2a9d82..fd80f39aa 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,10 @@ # Dev container Dockerfile FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye +# Install essential utilities including coreutils +RUN apt-get update && apt-get install -y \ + coreutils \ + && rm -rf /var/lib/apt/lists/* + # Install Poetry RUN curl -sSL https://install.python-poetry.org | python3 - From 87904d0b31ff804a80465491a85843ab35838ea5 Mon Sep 17 00:00:00 2001 From: steffen911 Date: Wed, 17 Sep 2025 13:07:32 +0200 Subject: [PATCH 4/5] chore: change base image --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index fd80f39aa..eb1c35750 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Dev container Dockerfile -FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye +FROM mcr.microsoft.com/devcontainers/universal:4-noble # Install essential utilities including coreutils RUN apt-get update && apt-get install -y \ From 024ce68f990b5496c46be5706cdba76654bdbb08 Mon Sep 17 00:00:00 2001 From: steffen911 Date: Wed, 17 Sep 2025 13:14:40 +0200 Subject: [PATCH 5/5] chore: inline all post-create actions --- .devcontainer/devcontainer.json | 2 +- .devcontainer/post-create.sh | 31 ------------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100755 .devcontainer/post-create.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index aabe744a2..27ae225d6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,5 +6,5 @@ "containerEnv": { "PATH": "/root/.local/bin:$PATH" }, - "postCreateCommand": "bash .devcontainer/post-create.sh" + "postCreateCommand": "poetry self add poetry-dotenv-plugin && poetry self add poetry-bumpversion && poetry install --all-extras && poetry run pre-commit install && cp .env.template .env" } \ No newline at end of file diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh deleted file mode 100755 index b7c77109d..000000000 --- a/.devcontainer/post-create.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -set -e - -echo "🚀 Setting up Langfuse Python SDK development environment..." - -# Install project dependencies including all extras -echo "📚 Installing project dependencies..." -poetry self add poetry-dotenv-plugin || true -poetry self add poetry-bumpversion || true -poetry install --all-extras - -# Setup pre-commit hooks -echo "🪝 Setting up pre-commit hooks..." -poetry run pre-commit install - -# Create a basic .env file if it doesn't exist -if [ ! -f .env ]; then - echo "📝 Creating .env file from template..." - cp .env.template .env -fi - -echo "✅ Development environment setup complete!" -echo "" -echo "🎯 Quick start commands:" -echo " poetry run pytest -s -v --log-cli-level=INFO # Run tests" -echo " poetry run ruff format . # Format code" -echo " poetry run ruff check . # Lint code" -echo " poetry run mypy . # Type check" -echo " poetry run pre-commit run --all-files # Run pre-commit" -echo ""