-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Remove deprecated monotonic
lib
#231
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
Conversation
This library has been long-deprecated (2021). We can use `time.monotonic` instead which has been available since Python 3.3 Closes #230
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR replaces the deprecated 'monotonic' library with Python's built-in 'time.monotonic()' function, removing a dependency on an unmaintained package.
- Removed 'monotonic' dependency and replaced with built-in 'time.monotonic()' in
/posthog/consumer.py
- Updated python-dateutil requirement from >2.1 to >=2.2 in
/setup.py
and/setup_analytics.py
- Potential compatibility issue:
/setup_analytics.py
claims Python 2.6-3.2 support but time.monotonic() requires Python 3.3+ - Duplicate package structure between
/setup.py
and/setup_analytics.py
needs consolidation
3 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib docs say "On Python 3.3 or newer, monotonic will be an alias of time.monotonic from the standard library. On older versions, it will fall back to an equivalent implementation:"
so this feels super safe
42115dd
to
295d6a8
Compare
monotonic
lib
I'm not super certain on release procedures for |
@rafaeelaudibert yep, once you have the changelog etc included it's just a manual action after merge |
@@ -1,3 +1,7 @@ | |||
## 4.0.1 – 2025-04-29 | |||
|
|||
1. Remove deprecated `monotonic` library. Use Python's core `time.monotonic` function instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it worth mentioning that now we require python min. 3.3? do we document this somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI runs on Python 3.9+ so this SHOULD be ok, but I can make this more explicit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, and only Python 3.9+ are actually maintained (security releases). I'll note that everywhere, but will consider this part of this patch version - no need for a major/minor (we've just released v4 anyway)
This library has been long-deprecated (2021). We can use
time.monotonic
instead which has been available since Python 3.3Closes #230