@@ -9,6 +9,7 @@ This is the Langfuse Python SDK, a client library for accessing the Langfuse obs
99## Development Commands
1010
1111### Setup
12+
1213``` bash
1314# Install Poetry plugins (one-time setup)
1415poetry self add poetry-dotenv-plugin
@@ -21,6 +22,7 @@ poetry run pre-commit install
2122```
2223
2324### Testing
25+
2426``` bash
2527# Run all tests with verbose output
2628poetry run pytest -s -v --log-cli-level=INFO
@@ -33,6 +35,7 @@ poetry run pytest -s -v --log-cli-level=INFO -n auto
3335```
3436
3537### Code Quality
38+
3639``` bash
3740# Format code with Ruff
3841poetry run ruff format .
@@ -48,6 +51,7 @@ poetry run pre-commit run --all-files
4851```
4952
5053### Building and Releasing
54+
5155``` bash
5256# Build the package locally (for testing)
5357poetry build
@@ -57,6 +61,7 @@ poetry run pdoc -o docs/ --docformat google --logo "https://langfuse.com/langfus
5761```
5862
5963Releases are automated via GitHub Actions. To release:
64+
60651 . Go to Actions > "Release Python SDK" workflow
61662 . Click "Run workflow"
62673 . Select version bump type (patch/minor/major/prerelease)
@@ -89,6 +94,7 @@ The workflow handles versioning, building, PyPI publishing (via OIDC), and GitHu
8994### Key Design Patterns
9095
9196The SDK is built on OpenTelemetry for observability, using:
97+
9298- Spans for tracing LLM operations
9399- Attributes for metadata (see ` LangfuseOtelSpanAttributes ` )
94100- Resource management for efficient batching and flushing
@@ -98,6 +104,7 @@ The client follows an async-first design with automatic batching of events and b
98104## Configuration
99105
100106Environment variables (defined in ` _client/environment_variables.py ` ):
107+
101108- ` LANGFUSE_PUBLIC_KEY ` / ` LANGFUSE_SECRET_KEY ` : API credentials
102109- ` LANGFUSE_HOST ` : API endpoint (defaults to https://cloud.langfuse.com )
103110- ` LANGFUSE_DEBUG ` : Enable debug logging
@@ -127,9 +134,11 @@ The `langfuse/api/` directory is auto-generated from the Langfuse OpenAPI specif
127134## Testing Guidelines
128135
129136### Approach to Test Changes
137+
130138- Don't remove functionality from existing unit tests just to make tests pass. Only change the test, if underlying code changes warrant a test change.
131139
132140## Python Code Rules
133141
134142### Exception Handling
143+
135144- Exception must not use an f-string literal, assign to variable first
0 commit comments