Closed mbarkhau closed 3 years ago
I've generated some sub files using stubgen
but they're pretty incomplete. Lots of typing.Any
and no return types. Unless there is something better to start with I would continue to refine these.
What would mypy do for cython source code? There is no pure python code in this project to be typed.
It doesn't do anything for cython source code. It does something for the code that uses the cython source code. For example, stubs would allow mypy and pycharm to see that there is a Session
class in the ssh2.session
module, which has a handshake
function, which expects an instance of socket.socket
as a parameter.
I see, so for static code analysis of python code using the module. IMO the usefulness of that is pretty niche - Python 3.5+ with IDE or other tools that do static type checking - but useful none the less.
A PR is welcome as long as maintenance can also be provided moving forward. I personally have no interest or bandwidth for maintaining these interface files for future changes/additions.
Perhaps there is a way to generate them from the .pyx or pxd files, I'll look into it. If that doesn't work I'll just link the stub files I'm using in case anybody finds this on google.
Sounds good, thanks for considering to contribute.
I have created https://github.com/dset0x/ssh2-stubs
For now, I have only gone through exceptions
, channel
and session
. From these, I have only actually tested the most common functions with mypy
.
Everything else needs to be worked on and I hope to resume work on it soon.
If you want to send patches, all you need is:
Looks like no interest to complete this from anyone - closing.
Are there any
.pyi
files available already?