You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,175 +4,115 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
This is the **Langfuse Python SDK**, an observability and analytics platform for AI applications. It provides tracing, evaluation, and analytics for LLM applications through multiple interfaces: decorators, low-level SDK, and integrations with popular AI libraries.
7
+
This is the Langfuse Python SDK, a client library for accessing the Langfuse observability platform. The SDK provides integration with OpenTelemetry (OTel) for tracing, automatic instrumentation for popular LLM frameworks (OpenAI, Langchain, etc.), and direct API access to Langfuse's features.
8
8
9
9
## Development Commands
10
10
11
-
### Environment Setup
11
+
### Setup
12
12
```bash
13
-
# Using UV (preferred)
14
-
uv venv --python 3.12
15
-
source .venv/bin/activate
16
-
uv sync
13
+
# Install Poetry plugins (one-time setup)
14
+
poetry self add poetry-dotenv-plugin
15
+
poetry self add poetry-bumpversion
17
16
18
-
#Using Poetry (legacy)
17
+
#Install all dependencies including optional extras
19
18
poetry install --all-extras
19
+
20
+
# Setup pre-commit hooks
20
21
poetry run pre-commit install
21
22
```
22
23
23
24
### Testing
24
25
```bash
25
-
# Run all tests
26
+
# Run all tests with verbose output
26
27
poetry run pytest -s -v --log-cli-level=INFO
27
28
28
-
# Run specific test
29
+
# Run a specific test
29
30
poetry run pytest -s -v --log-cli-level=INFO tests/test_core_sdk.py::test_flush
30
31
31
-
# Run with UV
32
-
uv run pytest -s -v --log-cli-level=INFO
32
+
# Run tests in parallel (faster)
33
+
poetry run pytest -s -v --log-cli-level=INFO -n auto
33
34
```
34
35
35
-
### Memory for Running Unit Tests
36
-
- To run unit tests you must always use the env file, use: `UV_ENV_FILE=.env uv run pytest -s -v --log-cli-level=INFO tests/TESTFILE::TEST_NAME`
37
-
38
36
### Code Quality
39
37
```bash
40
-
# Format code
41
-
ruff format .
38
+
# Format code with Ruff
39
+
poetry run ruff format .
40
+
41
+
# Run linting (development config)
42
+
poetry run ruff check .
42
43
43
-
# Run linter (development config)
44
-
ruff check.
44
+
# Run type checking
45
+
poetry run mypy.
45
46
46
-
# Run linter (CI config)
47
-
ruff check --config ci.ruff.toml .
47
+
# Run pre-commit hooks manually
48
+
poetry run pre-commit run --all-files
48
49
```
49
50
50
-
### Documentation
51
+
### Building and Releasing
51
52
```bash
52
-
#Generate SDK reference docs
53
-
poetry run pdoc -o docs/ --docformat google --logo "https://langfuse.com/langfuse_logo.svg" langfuse
53
+
#Build the package
54
+
poetry build
54
55
55
-
# Serve docs locally
56
-
poetry run pdoc --docformat google --logo "https://langfuse.com/langfuse_logo.svg" langfuse
56
+
# Run release script (handles versioning, building, tagging, and publishing)
57
+
poetry run release
58
+
59
+
# Generate documentation
60
+
poetry run pdoc -o docs/ --docformat google --logo "https://langfuse.com/langfuse_logo.svg" langfuse
0 commit comments