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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
run: |
ruff format --check .

- name: Lint with ruff
run: |
ruff check .

- name: Check types with mypy
run: |
mypy --no-site-packages --config-file mypy.ini . | mypy-baseline filter
Expand Down
11 changes: 9 additions & 2 deletions posthog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@
set_context_session as inner_set_context_session,
identify_context as inner_identify_context,
)
from posthog.feature_flags import InconclusiveMatchError, RequiresServerEvaluation
from posthog.types import FeatureFlag, FlagsAndPayloads, FeatureFlagResult
from posthog.feature_flags import (
InconclusiveMatchError as InconclusiveMatchError,
RequiresServerEvaluation as RequiresServerEvaluation,
)
from posthog.types import (
FeatureFlag,
FlagsAndPayloads,
FeatureFlagResult as FeatureFlagResult,
)
from posthog.version import VERSION

__version__ = VERSION
Expand Down
3 changes: 1 addition & 2 deletions posthog/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import sys
from datetime import datetime, timedelta
from typing import Any, Callable, Dict, Optional, Union
from typing import Any, Dict, Optional, Union
from typing_extensions import Unpack
from uuid import uuid4

Expand Down Expand Up @@ -60,7 +60,6 @@
SizeLimitedDict,
clean,
guess_timezone,
remove_trailing_slash,
system_context,
)
from posthog.version import VERSION
Expand Down
1 change: 0 additions & 1 deletion posthog/test/ai/anthropic/test_anthropic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
from unittest.mock import patch

import pytest
Expand Down
2 changes: 1 addition & 1 deletion posthog/test/ai/langchain/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ def test_combined_reasoning_and_cache_tokens(mock_client):


@pytest.mark.skipif(not OPENAI_API_KEY, reason="OPENAI_API_KEY is not set")
def test_openai_reasoning_tokens(mock_client):
def test_openai_reasoning_tokens_o4_mini(mock_client):
model = ChatOpenAI(
api_key=OPENAI_API_KEY, model="o4-mini", max_completion_tokens=10
)
Expand Down
4 changes: 3 additions & 1 deletion posthog/test/integrations/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ def test_sync_middleware_with_filter(self):
get_response = Mock(return_value=mock_response)

# Create middleware with request filter that filters all requests
request_filter = lambda req: False
def request_filter(req):
return False

middleware = PosthogContextMiddleware.__new__(PosthogContextMiddleware)
middleware.get_response = get_response
middleware._is_coroutine = False
Expand Down
Loading