-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some type annotations, most notably to smbclient.open_file
#295
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #295 +/- ##
=======================================
Coverage 99.06% 99.06%
=======================================
Files 24 24
Lines 5117 5146 +29
=======================================
+ Hits 5069 5098 +29
Misses 48 48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hold up on a merge just for a moment, I'm getting a runtime error on py3.10 that the tests haven't caught, making sure I didn't break anything |
Alright, good to go once the tests finish running. Sorry for the churn! |
Thanks for working on this |
Thanks for the fast reviews, and having the most pleasant SMB library in the ecosystem :D |
I won't lie, overloads are super verbose. But I worked off the ones for the stdlib
open()
, so it's "known good" at least.I tested this by looking through all the test_smbclient_os opens and making sure the correct type was inferred.
I also added some extras so you can get typed connection details from an fd. It still kinda sucks (because something like the buffer sizes are None until
connect
is called) but at least it has intellisense.Unfortunate API break: I couldn't work out a way to set the file/dir/pipe arg to specific values without forcing kwargs with * or moving the arg. I chose the latter, interested to hear your thoughts.