From cb81a119d379b2810e73de946eca346fb0c650ae Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 23 Mar 2026 16:25:29 -0400 Subject: [PATCH 1/4] chore: drop Python 3.11 and Django 4.2 support - Remove Python 3.11 from CI matrix and tox envlist - Remove Django 4.2 from CI matrix and tox envlist - Remove Python 3.11 and Django 4.2 trove classifiers from setup.py Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 4 ++-- setup.py | 2 -- tox.ini | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee11789..4ecf818 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: matrix: os: [ubuntu-latest] python-version: - - '3.11' - toxenv: [celery54-django42, celery54-django52] + - '3.12' + toxenv: [celery54-django52] steps: - uses: actions/checkout@v6 diff --git a/setup.py b/setup.py index 59813bc..0f03819 100644 --- a/setup.py +++ b/setup.py @@ -142,13 +142,11 @@ def get_version(*file_paths): 'Development Status :: 2 - Pre-Alpha', 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 4.2', 'Framework :: Django :: 5.2', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', diff --git a/tox.ini b/tox.ini index 2ac635c..cb1fe2f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{311, 312}-celery{54}-django{42,52} +envlist = py{312}-celery{54}-django{52} [testenv] setenv = @@ -7,7 +7,6 @@ setenv = PYTHONPATH = {toxinidir} deps = celery54: -r{toxinidir}/requirements/celery54.txt - django42: Django>=4.2,<4.3 django52: Django>=5.2,<5.3 -r{toxinidir}/requirements/test.txt commands = From fdea2937fb74b9b8732e0cea7d2a71ca0b440c7a Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 23 Mar 2026 16:26:07 -0400 Subject: [PATCH 2/4] chore: regenerate requirements with Python 3.12 Co-Authored-By: Claude Sonnet 4.6 --- requirements/base.txt | 6 +++--- requirements/ci.txt | 10 +++++----- requirements/dev.txt | 22 +++++++++++----------- requirements/pip-tools.txt | 2 +- requirements/test.txt | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index fc7d74b..891015e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -8,7 +8,7 @@ amqp==5.3.1 # via kombu asgiref==3.11.1 # via django -attrs==25.4.0 +attrs==26.1.0 # via openedx-events billiard==4.2.4 # via celery @@ -32,7 +32,7 @@ click-plugins==1.1.1.2 # via celery click-repl==0.3.0 # via celery -code-annotations==2.3.2 +code-annotations==3.0.0 # via edx-toggles django==5.2.12 # via diff --git a/requirements/ci.txt b/requirements/ci.txt index f120765..ea05c72 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -8,11 +8,11 @@ cachetools==7.0.5 # via tox colorama==0.4.6 # via tox -coverage==7.13.4 +coverage==7.13.5 # via -r requirements/ci.in distlib==0.4.0 # via virtualenv -filelock==3.25.1 +filelock==3.25.2 # via # python-discovery # tox @@ -30,11 +30,11 @@ pluggy==1.6.0 # via tox pyproject-api==1.10.0 # via tox -python-discovery==1.1.2 +python-discovery==1.2.0 # via virtualenv tomli-w==1.2.0 # via tox -tox==4.49.1 +tox==4.50.3 # via -r requirements/ci.in virtualenv==21.2.0 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 58bdf7e..cb49a40 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -19,7 +19,7 @@ astroid==4.0.4 # -r requirements/test.txt # pylint # pylint-celery -attrs==25.4.0 +attrs==26.1.0 # via # -r requirements/test.txt # openedx-events @@ -47,7 +47,7 @@ cffi==2.0.0 # via # -r requirements/test.txt # pynacl -charset-normalizer==3.4.5 +charset-normalizer==3.4.6 # via requests click==8.3.1 # via @@ -78,7 +78,7 @@ click-repl==0.3.0 # via # -r requirements/test.txt # celery -code-annotations==2.3.2 +code-annotations==3.0.0 # via # -r requirements/test.txt # edx-lint @@ -87,7 +87,7 @@ colorama==0.4.6 # via # -r requirements/ci.txt # tox -coverage[toml]==7.13.4 +coverage[toml]==7.13.5 # via # -r requirements/ci.txt # -r requirements/test.txt @@ -136,7 +136,7 @@ edx-django-utils==8.0.1 # -r requirements/test.txt # edx-toggles # openedx-events -edx-lint==5.6.0 +edx-lint==6.0.0 # via # -r requirements/dev.in # -r requirements/test.txt @@ -151,7 +151,7 @@ fastavro==1.12.1 # via # -r requirements/test.txt # openedx-events -filelock==3.25.1 +filelock==3.25.2 # via # -r requirements/ci.txt # python-discovery @@ -283,13 +283,13 @@ pytest==9.0.2 # via # -r requirements/test.txt # pytest-cov -pytest-cov==7.0.0 +pytest-cov==7.1.0 # via -r requirements/test.txt python-dateutil==2.9.0.post0 # via # -r requirements/test.txt # celery -python-discovery==1.1.2 +python-discovery==1.2.0 # via # -r requirements/ci.txt # virtualenv @@ -315,7 +315,7 @@ six==1.17.0 # python-dateutil snowballstemmer==3.0.1 # via sphinx -sphinx==9.0.4 +sphinx==9.1.0 # via -r requirements/dev.in sphinxcontrib-applehelp==2.0.0 # via sphinx @@ -351,7 +351,7 @@ tomlkit==0.14.0 # via # -r requirements/test.txt # pylint -tox==4.49.1 +tox==4.50.3 # via # -r requirements/ci.txt # -r requirements/dev.in diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index df8e38d..4ddcda2 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade diff --git a/requirements/test.txt b/requirements/test.txt index 6323ba7..c147ca3 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.11 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -15,7 +15,7 @@ astroid==4.0.4 # via # pylint # pylint-celery -attrs==25.4.0 +attrs==26.1.0 # via # -r requirements/base.txt # openedx-events @@ -51,12 +51,12 @@ click-plugins==1.1.1.2 # via # -r requirements/base.txt # celery -code-annotations==2.3.2 +code-annotations==3.0.0 # via # -r requirements/base.txt # edx-lint # edx-toggles -coverage[toml]==7.13.4 +coverage[toml]==7.13.5 # via pytest-cov ddt==1.7.2 # via -r requirements/test.in @@ -93,7 +93,7 @@ edx-django-utils==8.0.1 # -r requirements/base.txt # edx-toggles # openedx-events -edx-lint==5.6.0 +edx-lint==6.0.0 # via -r requirements/test.in edx-opaque-keys[django]==3.1.0 # via @@ -177,7 +177,7 @@ pynacl==1.6.2 # edx-django-utils pytest==9.0.2 # via pytest-cov -pytest-cov==7.0.0 +pytest-cov==7.1.0 # via -r requirements/test.in python-dateutil==2.9.0.post0 # via From 8277add07bfa518805930de4c6ba0894b50d196d Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 23 Mar 2026 16:26:22 -0400 Subject: [PATCH 3/4] chore: bump version to 4.0.0 Co-Authored-By: Claude Sonnet 4.6 --- eventtracking/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventtracking/__init__.py b/eventtracking/__init__.py index a98b409..fb194cc 100644 --- a/eventtracking/__init__.py +++ b/eventtracking/__init__.py @@ -1,3 +1,3 @@ """A simple event tracking library""" -__version__ = '3.3.0' +__version__ = '4.0.0' From 81c8dbdf6363190149cfd104b3932cb6a3045e47 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Mon, 23 Mar 2026 16:35:59 -0400 Subject: [PATCH 4/4] fix: replace assertDictContainsSubset removed in Python 3.12 assertDictContainsSubset was deprecated in Python 3.2 and removed in 3.12. Replace with an equivalent inline assertion. Co-Authored-By: Claude Sonnet 4.6 --- .../backends/tests/test_event_bus.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/eventtracking/backends/tests/test_event_bus.py b/eventtracking/backends/tests/test_event_bus.py index bd170f2..0947fff 100644 --- a/eventtracking/backends/tests/test_event_bus.py +++ b/eventtracking/backends/tests/test_event_bus.py @@ -43,19 +43,18 @@ def test_successful_send_event(self, mock_send_event): backend.send(self.sample_event) mock_send_event.assert_called() - self.assertDictContainsSubset( - { - "tracking_log": TrackingLogData( - name=self.sample_event["name"], - timestamp=datetime.strptime( - self.sample_event["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z" - ), - data=json.dumps(self.sample_event["data"]), - context=json.dumps(self.sample_event["context"]), - ) - }, - mock_send_event.call_args.kwargs, - ) + expected = { + "tracking_log": TrackingLogData( + name=self.sample_event["name"], + timestamp=datetime.strptime( + self.sample_event["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z" + ), + data=json.dumps(self.sample_event["data"]), + context=json.dumps(self.sample_event["context"]), + ) + } + actual = mock_send_event.call_args.kwargs + self.assertEqual(expected, {k: actual[k] for k in expected}) @patch( "eventtracking.backends.event_bus.SEND_TRACKING_EVENT_EMITTED_SIGNAL.is_enabled"