Skip to content

Add mypy, pyrefly, and ty type checking - #10

Merged
chrisjkuch merged 3 commits into
mainfrom
add-typechecking
Nov 18, 2026
Merged

chrisjkuch merged 3 commits into
mainfrom
add-typechecking

Conversation

@jayqi

@jayqi jayqi commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Adds typechecking without fixing any of the typechecking errors.


  • Add a typecheck dependency group with mypy, pyrefly, and ty, included in dev
  • Add just typecheck, which runs typecheck-mypy, typecheck-pyrefly, and typecheck-ty, and fails at the end if any of them failed
  • All three check src/, tests/, and integration_tests/
  • mypy uses the pydantic plugin and check_untyped_defs, then runs a second pass with --strict on src/
  • The recipes run each checker in an isolated environment and take --python, defaulting to .python-version, which they also pass to each checker as the target version
  • Copies .python-version and the tests dependency group from Commit uv.lock and run tests against the installed package #9; whichever PR merges second has small conflicts in justfile and pyproject.toml and needs uv lock
  • Not in CI or just check yet, because existing errors would fail them
  • Current counts: mypy 13, strict mypy on src/ 149, pyrefly 13, ty 30
Type checker output (Python 3.14)

mypy

src/pdc_api_client/token.py:38: error: Incompatible return value type (got "str | None", expected "str")  [return-value]
src/pdc_api_client/transport.py:79: error: Incompatible types in assignment (expression has type "type[PDCException]", variable has type "type[PDCServiceError]")  [assignment]
src/pdc_api_client/client.py:312: error: "type[BundleT]" has no attribute "model_validate"  [attr-defined]
tests/test_client_operations.py:63: error: Argument 1 to "loads" has incompatible type "bytes | Iterable[bytes | str] | SupportsRead[bytes | str] | None"; expected "str | bytes | bytearray"  [arg-type]
tests/test_client_operations.py:117: error: Item "None" of "Funder | None" has no attribute "short_code"  [union-attr]
src/pdc_api_client/permission_grants.py:233: error: Argument "exclude" to "model_dump" of "BaseModel" has incompatible type "frozenset[str]"; expected "IncEx | None"  [arg-type]
src/pdc_api_client/seeding/keycloak_admin.py:49: error: Argument "id" to "KeycloakOrganization" has incompatible type "str | None"; expected "str"  [arg-type]
integration_tests/test_seed.py:74: error: Item "None" of "ShallowChangemaker | None" has no attribute "id"  [union-attr]
integration_tests/test_seed.py:97: error: Item "None" of "ShallowChangemaker | None" has no attribute "id"  [union-attr]
integration_tests/test_permission_grants.py:152: error: Argument "grant_id" to "get_permission_grant" has incompatible type "int | None"; expected "int"  [arg-type]
integration_tests/test_pdc_group_membership.py:62: error: Argument "grant_id" to "delete_permission_grant" has incompatible type "int | None"; expected "int"  [arg-type]
integration_tests/conftest.py:39: error: Argument "timeout" to "APISession" has incompatible type "float"; expected "int"  [arg-type]
integration_tests/conftest.py:110: error: Argument "timeout" to "APISession" has incompatible type "float"; expected "int"  [arg-type]
Found 13 errors in 10 files (checked 31 source files)

mypy --strict src

src/pdc_api_client/errors.py:2: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/token.py:38: error: Incompatible return value type (got "str | None", expected "str")  [return-value]
src/pdc_api_client/token.py:55: error: Call to untyped function "PDCServiceError" in typed context  [no-untyped-call]
src/pdc_api_client/token.py:57: error: Call to untyped function "PDCServiceError" in typed context  [no-untyped-call]
src/pdc_api_client/token.py:63: error: Call to untyped function "TokenRequestError" in typed context  [no-untyped-call]
src/pdc_api_client/token.py:70: error: Call to untyped function "TokenRequestError" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:27: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/transport.py:51: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:54: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:56: error: Call to untyped function "_make_api_url" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:67: error: Call to untyped function "PDCServiceError" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:69: error: Call to untyped function "PDCServiceError" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:79: error: Incompatible types in assignment (expression has type "type[PDCException]", variable has type "type[PDCServiceError]")  [assignment]
src/pdc_api_client/transport.py:80: error: Call to untyped function (unknown) in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:83: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:84: error: Call to untyped function "_make_api_request" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:86: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:87: error: Call to untyped function "_make_api_request" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:89: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:90: error: Call to untyped function "_make_api_request" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:92: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:93: error: Call to untyped function "_make_api_request" in typed context  [no-untyped-call]
src/pdc_api_client/transport.py:95: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/transport.py:96: error: Call to untyped function "_make_api_request" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:7: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:21: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:33: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:43: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:57: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:69: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:79: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:86: error: Call to untyped function "base_field_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:88: error: Call to untyped function "source_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:98: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:102: error: Call to untyped function "changemaker_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:104: error: Call to untyped function "proposal_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:109: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:113: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:124: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:128: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:133: error: Call to untyped function "source_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:142: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:146: error: Call to untyped function "source_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:153: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:167: error: Call to untyped function "changemaker_field_value_batch_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:169: error: Call to untyped function "base_field_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:178: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:182: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:194: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:195: error: Call to untyped function "add_json_response" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:198: error: Call to untyped function "changemaker_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:203: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:204: error: Call to untyped function "add_json_response" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:207: error: Call to untyped function "funder_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:212: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:213: error: Call to untyped function "add_json_response" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:216: error: Call to untyped function "proposal_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:221: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:222: error: Call to untyped function "add_json_response" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:225: error: Call to untyped function "application_form_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:230: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:231: error: Call to untyped function "add_json_response" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:234: error: Call to untyped function "organization_payload" in typed context  [no-untyped-call]
src/pdc_api_client/testing.py:239: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/testing.py:256: error: Call to untyped function "add_json_response" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:31: error: Function is missing a type annotation for one or more parameters  [no-untyped-def]
src/pdc_api_client/client.py:35: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/client.py:39: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/client.py:45: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:119: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:140: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:153: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:166: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:171: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:180: error: Call to untyped function "ApplicationFormNotFoundError" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:183: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/client.py:184: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:191: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:196: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:201: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:210: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:218: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:242: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:249: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:256: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:269: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:284: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:302: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/client.py:303: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/client.py:305: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/client.py:311: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:312: error: Returning Any from function declared to return "BundleT"  [no-any-return]
src/pdc_api_client/client.py:312: error: "type[BundleT]" has no attribute "model_validate"  [attr-defined]
src/pdc_api_client/client.py:316: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/client.py:329: error: Call to untyped function "PDCServiceError" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:46: error: Function is missing a return type annotation  [no-untyped-def]
src/pdc_api_client/permission_grants.py:213: error: Function is missing a type annotation  [no-untyped-def]
src/pdc_api_client/permission_grants.py:227: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/permission_grants.py:231: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/permission_grants.py:233: error: Argument "exclude" to "model_dump" of "BaseModel" has incompatible type "frozenset[str]"; expected "IncEx | None"  [arg-type]
src/pdc_api_client/permission_grants.py:247: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/permission_grants.py:268: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:273: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:278: error: Call to untyped function "put" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:283: error: Call to untyped function "delete" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:293: error: Call to untyped function "get" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:298: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:305: error: Call to untyped function "put" in typed context  [no-untyped-call]
src/pdc_api_client/permission_grants.py:310: error: Call to untyped function "delete" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/keycloak_admin.py:49: error: Argument "id" to "KeycloakOrganization" has incompatible type "str | None"; expected "str"  [arg-type]
src/pdc_api_client/seeding/keycloak_admin.py:57: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/keycloak_admin.py:61: error: Returning Any from function declared to return "dict[Any, Any] | None"  [no-any-return]
src/pdc_api_client/seeding/keycloak_admin.py:96: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/keycloak_admin.py:99: error: Returning Any from function declared to return "dict[Any, Any] | None"  [no-any-return]
src/pdc_api_client/seeding/keycloak_admin.py:102: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/keycloak_admin.py:105: error: Returning Any from function declared to return "dict[Any, Any] | None"  [no-any-return]
src/pdc_api_client/seeding/keycloak_admin.py:169: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/keycloak_admin.py:172: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
src/pdc_api_client/seeding/pdc_entities.py:42: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:116: error: Call to untyped function "put" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:161: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:164: error: Call to untyped function "put" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:173: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:174: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:177: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
src/pdc_api_client/seeding/pdc_entities.py:231: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:234: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:261: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:277: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:280: error: Call to untyped function "put" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:352: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:353: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:356: error: Call to untyped function "put" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:360: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
src/pdc_api_client/seeding/pdc_entities.py:368: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:369: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:374: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
src/pdc_api_client/seeding/pdc_entities.py:383: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:384: error: Call to untyped function "patch" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:388: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
src/pdc_api_client/seeding/pdc_entities.py:402: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:410: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:456: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:481: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:497: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:499: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:516: error: Missing type arguments for generic type "dict"  [type-arg]
src/pdc_api_client/seeding/pdc_entities.py:517: error: Call to untyped function "post" in typed context  [no-untyped-call]
src/pdc_api_client/seeding/pdc_entities.py:524: error: Returning Any from function declared to return "dict[Any, Any]"  [no-any-return]
Found 149 errors in 8 files (checked 13 source files)

pyrefly

ERROR integration_tests/conftest.py:39:17-32: Argument `float` is not assignable to parameter `timeout` with type `int` in function `pdc_api_client.transport.APISession.__init__` [bad-argument-type]
ERROR integration_tests/conftest.py:110:21-36: Argument `float` is not assignable to parameter `timeout` with type `int` in function `pdc_api_client.transport.APISession.__init__` [bad-argument-type]
ERROR integration_tests/test_pdc_group_membership.py:62:55-63: Argument `int | None` is not assignable to parameter `grant_id` with type `int` in function `pdc_api_client.permission_grants.delete_permission_grant` [bad-argument-type]
ERROR integration_tests/test_permission_grants.py:152:62-72: Argument `int | None` is not assignable to parameter `grant_id` with type `int` in function `pdc_api_client.permission_grants.get_permission_grant` [bad-argument-type]
ERROR integration_tests/test_seed.py:74:16-37: Object of class `NoneType` has no attribute `id` [missing-attribute]
ERROR integration_tests/test_seed.py:97:32-53: Object of class `NoneType` has no attribute `id` [missing-attribute]
ERROR src/pdc_api_client/client.py:312:12-38: Class `PageableBundle` has no class attribute `model_validate` [missing-attribute]
ERROR src/pdc_api_client/permission_grants.py:233:64-80: Argument `frozenset[str]` is not assignable to parameter `exclude` with type `Mapping[int, bool | IncEx] | Mapping[str, bool | IncEx] | set[int] | set[str] | None` in function `pydantic.main.BaseModel.model_dump` [bad-argument-type]
ERROR src/pdc_api_client/seeding/keycloak_admin.py:49:40-46: Argument `str | None` is not assignable to parameter `id` with type `str` in function `KeycloakOrganization.__init__` [bad-argument-type]
ERROR src/pdc_api_client/token.py:38:16-27: Returned type `str | None` is not assignable to declared return type `str` [bad-return]
ERROR tests/test_client_operations.py:63:23-55: Argument `bytes | str | None` is not assignable to parameter `s` with type `bytearray | bytes | str` in function `json.loads` [bad-argument-type]
ERROR tests/test_client_operations.py:117:16-40: Object of class `NoneType` has no attribute `short_code` [missing-attribute]
ERROR tests/test_permission_grants.py:170:33-172:10: `dict[str, dict[str, list[str] | str]]` is not assignable to dict key `conditions` with type `None` [bad-assignment]

ty

integration_tests/conftest.py:39:9: error[invalid-argument-type] Argument to `APISession.__init__` is incorrect: Expected `int`, found `float*`
integration_tests/conftest.py:110:13: error[invalid-argument-type] Argument to `APISession.__init__` is incorrect: Expected `int`, found `float*`
integration_tests/test_permission_grants.py:152:53: error[invalid-argument-type] Argument to function `get_permission_grant` is incorrect: Expected `int`, found `int | None`
integration_tests/test_seed.py:74:16: error[missing-union-attribute] Attribute `id` is not defined on `None` in union `ShallowChangemaker | None`
integration_tests/test_seed.py:97:32: error[missing-union-attribute] Attribute `id` is not defined on `None` in union `ShallowChangemaker | None`
src/pdc_api_client/client.py:312:12: error[missing-attribute] Object of type `type[BundleT@get_bundle_page]` has no attribute `model_validate`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/permission_grants.py:233:56: error[invalid-argument-type] Argument to bound method `BaseModel.model_dump` is incorrect: Expected `IncEx | None`, found `frozenset[str]`
src/pdc_api_client/seeding/keycloak_admin.py:49:37: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `str | None`
src/pdc_api_client/testing.py:191:19: error[invalid-argument-type] Argument to bound method `RequestsMock.add` is incorrect: Expected `Mapping[str, str] | list[tuple[str, str]] | None`, found `list[(...) -> Any] | str | Unknown | int`
src/pdc_api_client/testing.py:191:19: error[invalid-argument-type] Argument to bound method `RequestsMock.add` is incorrect: Expected `str | BaseException | Response | ... omitted 3 union elements`, found `list[(...) -> Any] | str | Unknown | int`
src/pdc_api_client/token.py:38:16: error[invalid-return-type] Return type does not match returned value: expected `str`, found `str | None`
tests/test_client_operations.py:63:23: error[invalid-argument-type] Argument to function `loads` is incorrect: Expected `str | bytes | bytearray`, found `bytes | Iterable[bytes | str] | SupportsRead[bytes | str] | None`
tests/test_client_operations.py:117:16: error[missing-union-attribute] Attribute `short_code` is not defined on `None` in union `Funder | None`
tests/test_token.py:38:19: error[invalid-argument-type] Argument to bound method `RequestsMock.add` is incorrect: Expected `Mapping[str, str] | list[tuple[str, str]] | None`, found `dict[str, Unknown | str | int] | list[(...) -> Any] | dict[str, str] | ... omitted 3 union elements`
tests/test_token.py:38:19: error[invalid-argument-type] Argument to bound method `RequestsMock.add` is incorrect: Expected `str | BaseException | Response | ... omitted 3 union elements`, found `dict[str, Unknown | str | int] | list[(...) -> Any] | dict[str, str] | ... omitted 3 union elements`
Found 30 diagnostics

Assisted by Claude Code

@jayqi
jayqi marked this pull request as ready for review November 18, 2026 06:21
@jayqi
jayqi requested a review from chrisjkuch November 18, 2026 06:21
@chrisjkuch
chrisjkuch added this pull request to stack #12 November 18, 2026 06:45
Adds a typecheck dependency group and just recipes that run mypy (with
the pydantic plugin, plus a strict pass over src), pyrefly, and ty over
the package and both test suites.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The typecheck recipes run in an isolated environment for the Python
version from .python-version or --python, and pass that version to each
checker. `just typecheck` and `just typecheck-mypy` run all their checks
before failing. Adds .python-version and a tests dependency group.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>

@chrisjkuch chrisjkuch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. I stacked #11 on this so we could close #8.

@chrisjkuch
chrisjkuch merged commit 0920b15 into main Nov 18, 2026
5 checks passed
@chrisjkuch
chrisjkuch deleted the add-typechecking branch November 18, 2026 14:46
@chrisjkuch chrisjkuch mentioned this pull request Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants