python-zk / kazoo

Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.
https://kazoo.readthedocs.io
Apache License 2.0
1.3k stars 386 forks source link

refactor: Remove vestiges of python2 support #678

Closed a-ungurianu closed 1 year ago

a-ungurianu commented 1 year ago

Fixes #677

Why is this needed?

Not "needed", but this removes unnecessary dependencies on six and selectors2 making this package a no-deps package for runtime usage.

More of a spring cleaning

Proposed Changes

Does this PR introduce any breaking change?

Should be completely backwards compatible. Exceptions might change a bit as we use python3's raise ... from ... syntax

codecov-commenter commented 1 year ago

Codecov Report

Base: 94.38% // Head: 94.67% // Increases project coverage by +0.29% :tada:

Coverage data is based on head (536007a) compared to base (4b13135). Patch coverage: 86.15% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #678 +/- ## ========================================== + Coverage 94.38% 94.67% +0.29% ========================================== Files 57 56 -1 Lines 8388 8341 -47 ========================================== - Hits 7917 7897 -20 + Misses 471 444 -27 ``` | [Impacted Files](https://codecov.io/gh/python-zk/kazoo/pull/678?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk) | Coverage Δ | | |---|---|---| | [kazoo/tests/conftest.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vdGVzdHMvY29uZnRlc3QucHk=) | `37.50% <0.00%> (-5.36%)` | :arrow_down: | | [kazoo/protocol/connection.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vcHJvdG9jb2wvY29ubmVjdGlvbi5weQ==) | `96.69% <71.42%> (+0.40%)` | :arrow_up: | | [kazoo/handlers/threading.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vaGFuZGxlcnMvdGhyZWFkaW5nLnB5) | `86.95% <84.61%> (-0.28%)` | :arrow_down: | | [kazoo/client.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vY2xpZW50LnB5) | `98.40% <100.00%> (-0.01%)` | :arrow_down: | | [kazoo/handlers/eventlet.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vaGFuZGxlcnMvZXZlbnRsZXQucHk=) | `99.01% <100.00%> (-0.99%)` | :arrow_down: | | [kazoo/handlers/gevent.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vaGFuZGxlcnMvZ2V2ZW50LnB5) | `92.47% <100.00%> (-2.16%)` | :arrow_down: | | [kazoo/handlers/utils.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vaGFuZGxlcnMvdXRpbHMucHk=) | `95.89% <100.00%> (+0.84%)` | :arrow_up: | | [kazoo/hosts.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vaG9zdHMucHk=) | `100.00% <100.00%> (ø)` | | | [kazoo/protocol/serialization.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vcHJvdG9jb2wvc2VyaWFsaXphdGlvbi5weQ==) | `99.04% <100.00%> (-0.01%)` | :arrow_down: | | [kazoo/recipe/lock.py](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk#diff-a2F6b28vcmVjaXBlL2xvY2sucHk=) | `99.28% <100.00%> (+0.33%)` | :arrow_up: | | ... and [13 more](https://codecov.io/gh/python-zk/kazoo/pull/678/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=python-zk)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

jeffwidman commented 1 year ago

Thanks for tackling this!

👍 from me other than a minor nitpick on syntax of reporting exception messages.

StephenSorriaux commented 1 year ago

Gentle ping @ceache and @jeffwidman, would you like to give it a last look?

a-ungurianu commented 1 year ago

Any idea why isort take care of the import ordering/grouping?

I swear I saw isort errors in this repo. Maybe I confused it with some other one :)

StephenSorriaux commented 1 year ago

@a-ungurianu Thank you again for this. I'll let you free to merge this whenever you want, and, if I am not mistaken, make it your first merge as an official Kazoo contributor :rocket:

a-ungurianu commented 1 year ago

Didn't realize I can press the big green button :). Here goes nothing

jeffwidman commented 1 year ago

Thanks again for driving this to completion! Congrats on your first merge.