Skip to content
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

Python3 style updates #212

Merged
merged 4 commits into from
May 1, 2023
Merged

Python3 style updates #212

merged 4 commits into from
May 1, 2023

Conversation

tik-stbuehler
Copy link
Contributor

Given "Python 3.7+" is listed as requirement, there are a few things that could be updated.
Also cleanup a previous "black" run that removed linebreaks between string literals but didn't merge them.

Regarding the super(...) cleanup: there was one non-trivial use in _SMBErrorRegistry.__call__ which I replaced with type.__call__. Perhaps this method should start with if cls != SMBResponseException: return super().__call__(header) anyway - or ensure the status code of a passed header matches the cls._STATUS_CODE for subclasses (or even forbid passing a header to subclasses).

(The git history looks a little bit like you squash PRs to merge them? I'd appreciate it if you don't do that with mine - I split my changes into commits on purpose, and I'm happy to rebase/edit them :) )

@tik-stbuehler
Copy link
Contributor Author

I didn't run black/isort on . (because it went crazy on my venv directory), only on src - now also added tests.

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #212 (868eb28) into master (5c1af5f) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #212   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files          24       24           
  Lines        5082     5082           
=======================================
  Hits         5035     5035           
  Misses         47       47           
Flag Coverage Δ
99.07% <100.00%> (ø)
py3.10 99.03% <100.00%> (ø)
py3.11 99.03% <100.00%> (ø)
py3.7 99.03% <100.00%> (ø)
py3.8 99.03% <100.00%> (ø)
py3.9 99.07% <100.00%> (ø)
x64 99.07% <100.00%> (ø)
x86 98.99% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/smbprotocol/__init__.py 100.00% <ø> (ø)
src/smbclient/_io.py 99.02% <100.00%> (ø)
src/smbclient/_os.py 98.49% <100.00%> (ø)
src/smbclient/_pool.py 95.54% <100.00%> (ø)
src/smbprotocol/change_notify.py 100.00% <100.00%> (ø)
src/smbprotocol/connection.py 99.84% <100.00%> (ø)
src/smbprotocol/create_contexts.py 100.00% <100.00%> (ø)
src/smbprotocol/dfs.py 100.00% <100.00%> (ø)
src/smbprotocol/exceptions.py 100.00% <100.00%> (ø)
src/smbprotocol/file_info.py 100.00% <100.00%> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Owner

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long to review this I've been a bit preoccupied with a few other things. Thanks for fixing these up, especially the black auto formatting artifacts that were still around.

@jborean93 jborean93 merged commit ba2ab82 into jborean93:master May 1, 2023
@tik-stbuehler tik-stbuehler deleted the python3 branch May 5, 2023 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants