-
Notifications
You must be signed in to change notification settings - Fork 34
Add mypy to CI #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add mypy to CI #189
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
9245914
Add mypy dependencies
haacked d04e778
Add mypy to CI
haacked cf84ebc
Add more dependencies
haacked 988b3b0
Ignore more imports
haacked d1a25ff
Remove redundant section
haacked 03c1eb8
Remove non-existent
haacked 2f432bc
Update setup.py
haacked f3cd89f
Ignore more missing imports
haacked 3ea56e9
Update the baseline
haacked a6eaf1c
Look at mypy.ini in posthog/posthog
haacked 3a3a6f9
Add pydantic
haacked 5f1515a
Fix type annotation
haacked 239ab14
Stop ignoring pydantic
haacked 23e1cce
Create new baseline
haacked 3403833
Update mypy-baseline.txt
haacked 27b8dca
Attempt to fix CI's mypy
haacked 738d81f
Add verbose output
haacked 69ab0f6
Update mypy-baseline.txt
haacked 9a1aa3c
No site packages
haacked cd1f806
Update ci.yml
haacked 82477f0
Update ci.yml
haacked b65edfa
Remove trailing newline
haacked 6a61f2f
Update ci.yml
haacked File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
posthog/utils.py:0: error: Library stubs not installed for "six" [import-untyped] | ||
posthog/utils.py:0: error: Library stubs not installed for "dateutil.tz" [import-untyped] | ||
posthog/utils.py:0: error: Statement is unreachable [unreachable] | ||
posthog/utils.py:0: error: Argument 1 to "join" of "str" has incompatible type "AttributeError"; expected "Iterable[str]" [arg-type] | ||
posthog/request.py:0: error: Library stubs not installed for "requests" [import-untyped] | ||
posthog/request.py:0: note: Hint: "python3 -m pip install types-requests" | ||
posthog/request.py:0: error: Library stubs not installed for "dateutil.tz" [import-untyped] | ||
posthog/request.py:0: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] | ||
posthog/consumer.py:0: error: Name "Empty" already defined (possibly by an import) [no-redef] | ||
posthog/consumer.py:0: error: Need type annotation for "items" (hint: "items: list[<type>] = ...") [var-annotated] | ||
posthog/consumer.py:0: error: Unsupported operand types for <= ("int" and "str") [operator] | ||
posthog/consumer.py:0: note: Right operand is of type "int | str" | ||
posthog/consumer.py:0: error: Unsupported operand types for < ("str" and "int") [operator] | ||
posthog/consumer.py:0: note: Left operand is of type "int | str" | ||
haacked marked this conversation as resolved.
Show resolved
Hide resolved
|
||
posthog/feature_flags.py:0: error: Library stubs not installed for "dateutil" [import-untyped] | ||
posthog/feature_flags.py:0: error: Library stubs not installed for "dateutil.relativedelta" [import-untyped] | ||
posthog/feature_flags.py:0: error: Unused "type: ignore" comment [unused-ignore] | ||
posthog/client.py:0: error: Library stubs not installed for "dateutil.tz" [import-untyped] | ||
posthog/client.py:0: note: Hint: "python3 -m pip install types-python-dateutil" | ||
posthog/client.py:0: note: (or run "mypy --install-types" to install all missing stub packages) | ||
posthog/client.py:0: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports | ||
posthog/client.py:0: error: Library stubs not installed for "six" [import-untyped] | ||
posthog/client.py:0: note: Hint: "python3 -m pip install types-six" | ||
posthog/client.py:0: error: Name "queue" already defined (by an import) [no-redef] | ||
posthog/client.py:0: error: Need type annotation for "queue" [var-annotated] | ||
posthog/client.py:0: error: Item "None" of "Any | None" has no attribute "get" [union-attr] | ||
simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "capture" [call-arg] | ||
posthog/__init__.py:0: note: "capture" defined here | ||
simulator.py:0: error: Unexpected keyword argument "anonymous_id" for "identify" [call-arg] | ||
posthog/__init__.py:0: note: "identify" defined here | ||
simulator.py:0: error: Unexpected keyword argument "traits" for "identify" [call-arg] | ||
posthog/__init__.py:0: note: "identify" defined here | ||
example.py:0: error: Statement is unreachable [unreachable] | ||
posthog/sentry/posthog_integration.py:0: error: Statement is unreachable [unreachable] | ||
posthog/ai/utils.py:0: error: Need type annotation for "output" (hint: "output: list[<type>] = ...") [var-annotated] | ||
posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] | ||
posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? | ||
posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/utils.py:0: error: Function "builtins.any" is not valid as a type [valid-type] | ||
posthog/ai/utils.py:0: note: Perhaps you meant "typing.Any" instead of "any"? | ||
posthog/ai/utils.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
sentry_django_example/sentry_django_example/settings.py:0: error: Need type annotation for "ALLOWED_HOSTS" (hint: "ALLOWED_HOSTS: list[<type>] = ...") [var-annotated] | ||
sentry_django_example/sentry_django_example/settings.py:0: error: Incompatible types in assignment (expression has type "str", variable has type "None") [assignment] | ||
posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] | ||
posthog/ai/openai/openai_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/openai/openai_async.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] | ||
posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/openai/openai.py:0: error: Unpacked dict entry 11 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] | ||
posthog/ai/openai/openai.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/openai/openai.py:0: error: Unpacked dict entry 8 has incompatible type "dict[str, Any] | None"; expected "SupportsKeysAndGetItem[str, Any]" [dict-item] | ||
posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/anthropic/anthropic_async.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
posthog/ai/anthropic/anthropic.py:0: error: Incompatible types in assignment (expression has type "UUID", variable has type "str | None") [assignment] | ||
llm_observability_examples.py:0: error: Argument "posthog_client" to "OpenAI" has incompatible type Module; expected "Client" [arg-type] | ||
llm_observability_examples.py:0: error: Argument "posthog_client" to "AsyncOpenAI" has incompatible type Module; expected "Client" [arg-type] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[mypy] | ||
python_version = 3.11 | ||
plugins = | ||
pydantic.mypy | ||
strict_optional = True | ||
no_implicit_optional = True | ||
warn_unused_ignores = True | ||
check_untyped_defs = True | ||
warn_unreachable = True | ||
strict_equality = True | ||
ignore_missing_imports = True | ||
|
||
[mypy-django.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-sentry_sdk.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-posthog.test.*] | ||
ignore_errors = True | ||
|
||
[mypy-posthog.*.test.*] | ||
ignore_errors = True | ||
|
||
[mypy-openai.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-langchain.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-langchain_core.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-anthropic.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-httpx.*] | ||
ignore_missing_imports = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.