| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Ah, hm, I missed the impact on Remote.delete. Trying to think about the best way to handle that. |
Sorry, something went wrong.
delete_head and Head.delete historically accept either Head objects or a str name of a head. Adjust the typing to match. This unfortunately requires suppressing type warnings in the signature of RemoteReference.delete, since it inherits from Head but does not accept str (since it needs access to the richer data of RemoteReference). Using assignment to make add an alias for create unfortunately confuses mypy, since it loses track of the fact that it's a classmethod and starts treating it like a staticmethod. Replace with a stub wrapper instead.
|
Amended with a possible fix. Alternately, perhaps the intent was not to allow strs for Head.delete and they only worked by accident (although in that case I wasn't sure how to create the necessary Head object to pass in). |
Sorry, something went wrong.
|
FYI, for background, this fixes issues that I saw in https://github.com/lsst-sqre/neophile after updating GitPython, namely: src/neophile/repository.py:58: error: Argument 1 to "delete_head" of "Repo" has incompatible type "str"; expected "Head" [arg-type] src/neophile/repository.py:76: error: Argument 1 to "delete_head" of "Repo" has incompatible type "str"; expected "Head" [arg-type] src/neophile/pr.py:312: error: Too few arguments [call-arg] src/neophile/pr.py:313: error: Argument 1 has incompatible type "Repo"; expected "Type[Remote]" [arg-type] src/neophile/pr.py:313: error: Argument 2 has incompatible type "str"; expected "Repo" [arg-type] The last three messages are from calling Remote.add with the code as it existed prior to this patch. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
delete_head and Head.delete historically accept either Head objects
or a str name of a head. Adjust the typing to match.
Using assignment to make add an alias for create unfortunately
confuses mypy, since it loses track of the fact that it's a
classmethod and starts treating it like a staticmethod. Replace
with a stub wrapper instead.