Skip to content

CI: pyright errors for requests #529

@joverlee521

Description

@joverlee521

Scheduled CI ran into errors across all test-source tests, with pyright errors related to requests module. Likely related to yesterday's release of requests v2.34.0

Detail errors
/home/runner/work/cli/cli/nextstrain/cli/pathogens.py
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:457:36 - error: "status_code" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:458:34 - error: "status_code" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:459:43 - error: "request" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:460:37 - error: Argument of type "Literal['Basic ']" cannot be assigned to parameter "prefix" of type "ReadableBuffer | tuple[ReadableBuffer, ...]" in function "startswith"
    Type "Literal['Basic ']" is not assignable to type "ReadableBuffer | tuple[ReadableBuffer, ...]"
      "Literal['Basic ']" is incompatible with protocol "Buffer"
        "__buffer__" is not present
      "Literal['Basic ']" is not assignable to "tuple[ReadableBuffer, ...]" (reportArgumentType)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:461:49 - error: Argument of type "Literal[' ']" cannot be assigned to parameter "sep" of type "ReadableBuffer | None" in function "split"
    Type "Literal[' ']" is not assignable to type "ReadableBuffer | None"
      "Literal[' ']" is incompatible with protocol "Buffer"
        "__buffer__" is not present
      "Literal[' ']" is not assignable to "None" (reportArgumentType)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:523:46 - error: Argument of type "Response | None" cannot be assigned to parameter "response" of type "Response" in function "request_list"
    Type "Response | None" is not assignable to type "Response"
      "None" is not assignable to "Response" (reportArgumentType)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:525:38 - error: "status_code" is not a known attribute of "None" (reportOptionalMemberAccess)
  /home/runner/work/cli/cli/nextstrain/cli/pathogens.py:538:46 - error: Argument of type "Response | None" cannot be assigned to parameter "response" of type "Response" in function "request_list"
    Type "Response | None" is not assignable to type "Response"
      "None" is not assignable to "Response" (reportArgumentType)
/home/runner/work/cli/cli/nextstrain/cli/remote/nextstrain_dot_org.py
  /home/runner/work/cli/cli/nextstrain/cli/remote/nextstrain_dot_org.py:395:46 - error: Argument of type "str | bytes" cannot be assigned to parameter "s" of type "str" in function "write"
    Type "str | bytes" is not assignable to type "str"
      "bytes" is not assignable to "str" (reportArgumentType)
  /home/runner/work/cli/cli/nextstrain/cli/remote/nextstrain_dot_org.py:976:12 - error: Type "dict[str, str | None]" is not assignable to return type "Dict[str, str] | None"
    Type "dict[str, str | None]" is not assignable to type "Dict[str, str] | None"
      "dict[str, str | None]" is not assignable to "Dict[str, str]"
        Type parameter "_VT@dict" is invariant, but "str | None" is not the same as "str"
        Consider switching from "dict" to "Mapping" which is covariant in the value type
      "dict[str, str | None]" is not assignable to "None" (reportReturnType)
/home/runner/work/cli/cli/nextstrain/cli/requests.py
  /home/runner/work/cli/cli/nextstrain/cli/requests.py:90:118 - error: "__version__" is not exported from module "requests" (reportPrivateImportUsage)
11 errors, 0 warnings, 0 informations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions