[paramiko] Update to 5.0.0#15907
Conversation
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
AlexWaygood
left a comment
There was a problem hiding this comment.
Partial review, I haven't reviewed stubs/paramiko/paramiko/pkey.pyi and onwards yet
| def from_file(cls, flo: Iterable[str]) -> Self: ... | ||
| def parse(self, file_obj: Iterable[str]) -> None: ... |
There was a problem hiding this comment.
while it's true that any iterable of strings will work at runtime, the docstrings say that a file-like object is expected, and IO[str] does express that it should be an iterable of lines (rather than an iterable of words or characters).
I know you're generally opposed to using IO, though, and I share your philosophy there... not sure if there's a protocol that could also express "this needs to be an iterable of lines of source code" in the same way...
| def write_private_key_file(self, filename: FileDescriptorOrPath, password: str | None = None) -> None: ... | ||
| def write_private_key(self, file_obj: IO[str], password: str | None = None) -> None: ... | ||
| @property | ||
| def private_key(self) -> EllipticCurvePrivateKey: ... |
There was a problem hiding this comment.
this property is annotated with Optional[EllipticCurvePrivateKey] upstream. At first glance, that looks right (and I think the signing_key instance attribute should be EllipticCurvePrivateKey | None as well)
| def private_key(self) -> EllipticCurvePrivateKey: ... | |
| def private_key(self) -> EllipticCurvePrivateKey | None: ... |
| from paramiko.pkey import PKey | ||
| from paramiko.pkey import PKey, _HasReadlines | ||
|
|
||
| _VerifyKey: TypeAlias = Any # actually nacl.signing.VerifyKey |
There was a problem hiding this comment.
pynacl looks to be fully typed and has a py.typed file. We could consider adding it to the stub_uploader allowlist and then adding it as a dependency of these stubs.
Closes: #15749