Repository navigation
chore: remove all uses of deprecated APIs and make mypy report an error for use of a deprecated API - #825
Open
ThosRTanner wants to merge 1 commit into
Open
chore: remove all uses of deprecated APIs and make mypy report an error for use of a deprecated API#825ThosRTanner wants to merge 1 commit into
ThosRTanner wants to merge 1 commit into
Conversation
ThosRTanner
force-pushed
the
no-deprecated
branch
from
September 19, 2026 19:37
d074ac6 to
168194e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #825 +/- ##
==========================================
+ Coverage 94.90% 96.01% +1.10%
==========================================
Files 27 27
Lines 3811 3739 -72
==========================================
- Hits 3617 3590 -27
+ Misses 194 149 -45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ThosRTanner
force-pushed
the
no-deprecated
branch
2 times, most recently
from
September 26, 2026 21:32
de195e4 to
65ec9a9
Compare
ThosRTanner
force-pushed
the
no-deprecated
branch
2 times, most recently
from
October 9, 2026 07:34
61d8415 to
4059902
Compare
Note: Depends on python-zk#823
ThosRTanner
force-pushed
the
no-deprecated
branch
from
October 9, 2026 11:20
4059902 to
603ccb7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #823
Why is this needed?
We shouldn't be using deprecated APIs...
Proposed Changes
datetimeobjects in Lease.py (and change the version number ofLeaseobjects).utcnowmethod to the constructors, but use mocking to control behaviour.logger.warnwithlogger.warningdeprecatederror in mypy..coveragercbecause it's now unnecessary and appears to cause latest coverage to misfire.Does this PR introduce any breaking change?
Sort of. It changes the version number of the
Leaseobjects (from recipes/lease.py) as the timestamps used are no longer naive, and additionally makes them no longer take an argument to the constructor for creating adatetimeobject. Those parameters were defined as being only for test, and now we use freezegun to manipulate dates and times, so they're no longer needed.Codecov note
codecov flagged an uncovered changed line, for changing logger.warn to logger.warning in an untested path (currently untested because it'd require zookeeper to be doing something odd). I added a suppression for this as I think unit tests for this would be fragile.