From 104a523cdd21ff466f0fb772e976a3e08ee49398a796c7ccf3f60e9edff8e502 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 27 Sep 2024 07:04:38 +0000 Subject: [PATCH] - Add patch no-more-monotonic.patch: * Just use time.monotonic OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-posthog?expand=0&rev=3 --- no-more-monotonic.patch | 42 +++++++++++++++++++++++++++++++++++++++++ python-posthog.changes | 6 ++++++ python-posthog.spec | 9 ++++----- 3 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 no-more-monotonic.patch diff --git a/no-more-monotonic.patch b/no-more-monotonic.patch new file mode 100644 index 0000000..9cea8bf --- /dev/null +++ b/no-more-monotonic.patch @@ -0,0 +1,42 @@ +Index: posthog-3.6.0/posthog/consumer.py +=================================================================== +--- posthog-3.6.0.orig/posthog/consumer.py ++++ posthog-3.6.0/posthog/consumer.py +@@ -1,9 +1,9 @@ + import json + import logging ++import time + from threading import Thread + + import backoff +-import monotonic + + from posthog.request import APIError, DatetimeSerializer, batch_post + +@@ -96,11 +96,11 @@ class Consumer(Thread): + queue = self.queue + items = [] + +- start_time = monotonic.monotonic() ++ start_time = time.monotonic() + total_size = 0 + + while len(items) < self.flush_at: +- elapsed = monotonic.monotonic() - start_time ++ elapsed = time.monotonic() - start_time + if elapsed >= self.flush_interval: + break + try: +Index: posthog-3.6.0/setup.py +=================================================================== +--- posthog-3.6.0.orig/setup.py ++++ posthog-3.6.0/setup.py +@@ -14,7 +14,7 @@ long_description = """ + PostHog is developer-friendly, self-hosted product analytics. posthog-python is the python package. + """ + +-install_requires = ["requests>=2.7,<3.0", "monotonic>=1.5", "backoff>=1.10.0", "python-dateutil>2.1"] ++install_requires = ["requests>=2.7,<3.0", "backoff>=1.10.0", "python-dateutil>2.1"] + + extras_require = { + "dev": [ diff --git a/python-posthog.changes b/python-posthog.changes index f4c164a..724ad51 100644 --- a/python-posthog.changes +++ b/python-posthog.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 27 07:03:56 UTC 2024 - Steve Kowalik + +- Add patch no-more-monotonic.patch: + * Just use time.monotonic + ------------------------------------------------------------------- Thu Sep 5 17:07:16 UTC 2024 - Meera Belur diff --git a/python-posthog.spec b/python-posthog.spec index 7e65494..5b53ffb 100644 --- a/python-posthog.spec +++ b/python-posthog.spec @@ -23,20 +23,19 @@ Release: 0 Summary: PostHog is developer-friendly, self-hosted product analytics License: MIT URL: https://github.com/posthog/posthog-python -Group: Development/Libraries/Python Source: https://files.pythonhosted.org/packages/source/p/posthog/posthog-%{version}.tar.gz Patch1: python-posthog-no-mock.patch Patch2: python-posthog-no-six.patch -BuildRequires: python-rpm-macros +Patch3: no-more-monotonic.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} +BuildRequires: python-rpm-macros # SECTION test requirements BuildRequires: %{python_module pytest} -BuildRequires: %{python_module pytest-timeout} -BuildRequires: %{python_module freezegun} BuildRequires: %{python_module backoff >= 1.10.0} -BuildRequires: %{python_module monotonic >= 1.5} +BuildRequires: %{python_module freezegun} +BuildRequires: %{python_module pytest-timeout} BuildRequires: %{python_module python-dateutil > 2.1} BuildRequires: %{python_module requests >= 2.7} # /SECTION