GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Git.{AutoInterrupt,CatFileContentStream} refactor broke static typing · Issue #2038 · gitpython-developers/GitPython Closed Description#2037 accidentally introduced 30 new diff --git a/a b/b index 128f3547..59913c9c 100644 --- a/a +++ b/b @@ -1,33 +1,82 @@ git\types.py:133: error: Type[...] can't contain "Union[Literal[...], Literal[...]]" [valid-type] +git\util.py:508: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\util.py:508: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\util.py:512: error: Item Git.AutoInterrupt? of "Union[Popen[Any], Git.AutoInterrupt?]" has no attribute "wait" [union-attr] git\util.py:1146: error: Variance of TypeVar "T_IterableObj" incompatible with variance in parent type [type-var] git\util.py:1217: error: Argument 2 to "getattr" has incompatible type "Union[SupportsIndex, str]"; expected "str" [arg-type] git\util.py:1219: error: Unsupported operand types for + ("str" and "SupportsIndex") [operator] git\util.py:1219: note: Right operand is of type "Union[SupportsIndex, str]" git\util.py:1226: error: Unsupported operand types for + ("str" and "SupportsIndex") [operator] git\util.py:1226: error: Unsupported operand types for + ("str" and "slice[Any, Any, Any]") [operator] git\util.py:1226: note: Right operand is of type "Union[SupportsIndex, slice[Any, Any, Any], str]" git\config.py:572: error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'", not "abc". If this is desired behavior, use f"{x!r}" or "{!r}".format(x). Otherwise, decode the bytes [str-bytes-safe] git\config.py:628: error: Redundant cast to "Union[str, PathLike[str]]" [redundant-cast] +git\cmd.py:98: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:106: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:170: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:170: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:218: error: Unused "type: ignore" comment [unused-ignore] +git\cmd.py:510: error: Variable "git.cmd.Git.CatFileContentStream" is not valid as a type [valid-type] +git\cmd.py:510: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1051: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1051: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1108: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1528: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1528: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1533: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1533: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1537: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1537: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1658: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1658: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1668: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1668: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1671: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\cmd.py:1671: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1672: error: Git.AutoInterrupt? has no attribute "stdin" [attr-defined] +git\cmd.py:1672: error: Git.AutoInterrupt? has no attribute "stdout" [attr-defined] +git\cmd.py:1673: error: Git.AutoInterrupt? has no attribute "stdin" [attr-defined] +git\cmd.py:1674: error: Git.AutoInterrupt? has no attribute "stdin" [attr-defined] +git\cmd.py:1675: error: Git.AutoInterrupt? has no attribute "stdout" [attr-defined] +git\cmd.py:1703: error: Git.CatFileContentStream? has no attribute "read" [attr-defined] +git\cmd.py:1707: error: Variable "git.cmd.Git.CatFileContentStream" is not valid as a type [valid-type] +git\cmd.py:1707: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\cmd.py:1719: error: Git.AutoInterrupt? has no attribute "stdout" [attr-defined] git\refs\log.py:148: error: Argument 1 to "RefLogEntry" has incompatible type "Tuple[str, str, Actor, Tuple[int, int], Optional[str]]"; expected "Iterable[Union[str, Actor, Tuple[int, int]]]" [arg-type] +git\diff.py:584: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\diff.py:584: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases git\objects\submodule\base.py:834: error: "SymbolicReference" has no attribute "set_tracking_branch" [attr-defined] git\objects\submodule\base.py:862: error: "SymbolicReference" has no attribute "tracking_branch" [attr-defined] +git\objects\commit.py:454: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\objects\commit.py:454: note: Error code "valid-type" not covered by "type: ignore" comment +git\objects\commit.py:454: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\objects\commit.py:459: error: Git.AutoInterrupt? has no attribute "communicate" [attr-defined] git\objects\commit.py:711: error: Argument 2 to "create" of "SymbolicReference" has incompatible type "Callable[[], SymbolicReference]"; expected "Union[str, PathLike[str]]" [arg-type] git\objects\commit.py:903: error: Argument 2 to "findall" has incompatible type "Union[str, bytes]"; expected "str" [arg-type] git\refs\symbolic.py:919: error: Incompatible types in assignment (expression has type "SymbolicReference", variable has type "T_References") [assignment] git\refs\tag.py:48: error: Read-only property cannot override read-write property [misc] git\refs\tag.py:49: error: Unused "type: ignore" comment [unused-ignore] git\refs\tag.py:83: error: Read-only property cannot override read-write property [misc] git\refs\tag.py:84: error: Unused "type: ignore" comment [unused-ignore] git\refs\head.py:48: error: Incompatible override of a setter type [override] git\refs\head.py:48: note: (base class "SymbolicReference" defined the type as "Union[Commit, SymbolicReference, str]", git\refs\head.py:48: note: override has type "Commit") git\refs\head.py:48: note: Setter types should behave contravariantly +git\remote.py:874: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\remote.py:874: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\remote.py:902: error: Git.AutoInterrupt? has no attribute "wait" [attr-defined] +git\remote.py:945: error: Variable "git.cmd.Git.AutoInterrupt" is not valid as a type [valid-type] +git\remote.py:945: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +git\remote.py:975: error: Git.AutoInterrupt? has no attribute "wait" [attr-defined] git\repo\fun.py:289: error: "Callable[[], SymbolicReference]" has no attribute "commit" [attr-defined] git\repo\fun.py:339: error: "Callable[[], SymbolicReference]" has no attribute "log_entry" [attr-defined] git\repo\base.py:688: error: Redundant cast to "Literal['system', 'global', 'user', 'repository']" [redundant-cast] git\repo\base.py:690: error: Redundant cast to "Literal['system', 'global', 'user', 'repository']" [redundant-cast] git\repo\base.py:1054: error: Incompatible return value type (got "SymbolicReference", expected "Head") [return-value] git\repo\base.py:1487: error: Argument 5 to "_clone" of "Repo" has incompatible type "Optional[Optional[Callable[[int, Union[str, float], Union[str, float, None], str], None]]]"; expected "Union[RemoteProgress, UpdateProgress, Callable[..., RemoteProgress], None]" [arg-type] git\repo\base.py:1548: error: Argument 5 to "_clone" of "Repo" has incompatible type "Optional[Callable[[int, Union[str, float], Union[str, float, None], str], None]]"; expected "Union[RemoteProgress, UpdateProgress, Callable[..., RemoteProgress], None]" [arg-type] test\deprecation\test_basic.py:137: error: Argument "change_type" to "iter_change_type" of "DiffIndex" has incompatible type "str"; expected "Literal['A', 'D', 'C', 'M', 'R', 'T', 'U']" [arg-type] -Found 27 errors in 12 files (checked 44 source files) +Found 57 errors in 15 files (checked 44 source files) The problem is that, as described in Variables vs type aliases, So even though Sphinx would readily recognize these as type aliases (hence the need to change This will actually affect users unless it is fixed before the next release is made, because I'm aware of several possible solutions, some better than others:
If (2) is done, we can still revert both it and #2037 to get (1). So I'll do (2) unless further problems arise with it, with the idea that adding a Edit: This is done in #2039. Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |