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
5 changes: 4 additions & 1 deletion langfuse/_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
)

import backoff
import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from opentelemetry import context as otel_context_api
from opentelemetry import trace as otel_trace_api
from opentelemetry.sdk.trace import ReadableSpan, TracerProvider
Expand Down
5 changes: 4 additions & 1 deletion langfuse/_client/resource_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
from queue import Full, Queue
from typing import Any, Callable, Dict, List, Optional, cast

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from opentelemetry import trace as otel_trace_api
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import ReadableSpan, TracerProvider
Expand Down
5 changes: 4 additions & 1 deletion langfuse/_task_manager/media_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from typing import Any, Callable, Optional, TypeVar, cast

import backoff
import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from typing_extensions import ParamSpec

from langfuse._client.environment_variables import LANGFUSE_MEDIA_UPLOAD_ENABLED
Expand Down
5 changes: 4 additions & 1 deletion langfuse/_utils/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from base64 import b64encode
from typing import Any, List, Union

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx

from langfuse._utils.serializer import EventSerializer
from langfuse.logger import langfuse_logger as logger
Expand Down
5 changes: 4 additions & 1 deletion langfuse/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

import typing

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper

if typing.TYPE_CHECKING:
Expand Down
5 changes: 4 additions & 1 deletion langfuse/api/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import typing

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from .http_client import AsyncHttpClient, HttpClient


Expand Down
5 changes: 4 additions & 1 deletion langfuse/api/core/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
from contextlib import asynccontextmanager, contextmanager
from random import random

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from .file import File, convert_file_dict_to_httpx_tuples
from .force_multipart import FORCE_MULTIPART
from .jsonable_encoder import jsonable_encoder
Expand Down
5 changes: 4 additions & 1 deletion langfuse/api/core/http_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

from typing import Dict, Generic, TypeVar

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx

# Generic to represent the underlying type of the data wrapped by the HTTP response.
T = TypeVar("T")
Expand Down
5 changes: 4 additions & 1 deletion langfuse/api/core/http_sse/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from contextlib import asynccontextmanager, contextmanager
from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx
from ._decoders import SSEDecoder
from ._exceptions import SSEError
from ._models import ServerSentEvent
Expand Down
5 changes: 4 additions & 1 deletion langfuse/api/core/http_sse/_exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# This file was auto-generated by Fern from our API Definition.

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx


class SSEError(httpx.TransportError):
Expand Down
5 changes: 4 additions & 1 deletion langfuse/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from datetime import datetime, timezone
from typing import TYPE_CHECKING, Any, Literal, Optional, Tuple, TypeVar, cast

import httpx
try:
import httpx2 as httpx
except ImportError:
import httpx

from langfuse.api import MediaContentType
from langfuse.logger import langfuse_logger as logger
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license-files = ["LICENSE"]
requires-python = ">=3.10,<4.0"
dependencies = [
"httpx>=0.15.4,<1.0",
"httpx2>=2.12.0; python_version >= \"3.10\"",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Lockfile Is Stale

This adds httpx2 without regenerating uv.lock. The locked langfuse dependency metadata still contains only httpx, while every CI job installs dependencies with uv sync --locked. As a result, CI fails during dependency installation before linting, type checking, or tests can run. Please regenerate and commit the lockfile.

Prompt To Fix With AI
This is a comment left during a code review.
Path: pyproject.toml
Line: 12

Comment:
**Lockfile Is Stale**

This adds `httpx2` without regenerating `uv.lock`. The locked `langfuse` dependency metadata still contains only `httpx`, while every CI job installs dependencies with `uv sync --locked`. As a result, CI fails during dependency installation before linting, type checking, or tests can run. Please regenerate and commit the lockfile.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

"pydantic>=2,<3",
"backoff>=1.10.0",
"wrapt>=1.14,<3",
Expand Down