From b086c15cfd34323914250c04f5e95dbefdc3fc08 Mon Sep 17 00:00:00 2001 From: Daniel Morell Date: Fri, 20 Sep 2024 15:58:59 -0500 Subject: [PATCH 1/2] Added support for Python3.12. --- .github/workflows/ci.yml | 2 +- README.md | 2 +- pyproject.toml | 1 + rollbar/test/fastapi_tests/test_logger.py | 2 +- rollbar/test/fastapi_tests/test_middleware.py | 2 +- rollbar/test/fastapi_tests/test_routing.py | 2 +- rollbar/test/starlette_tests/test_logger.py | 2 +- rollbar/test/starlette_tests/test_middleware.py | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8025710..7bf8ec3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11] + python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11, 3.12] framework: - NONE - FLASK_VERSION=1.1.4 diff --git a/README.md b/README.md index 5a476da6..ae678f0c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Python notifier for reporting exceptions, errors, and log messages to [Rollbar]( | PyRollbar Version | Python Version Compatibility | Support Level | |-------------------|-----------------------------------------------|---------------------| -| 1.0.0 | 3.6, 3.7. 3.8, 3.9, 3.10, 3.11 | Full | +| 1.0.0 | 3.6, 3.7. 3.8, 3.9, 3.10, 3.11, 3.12 | Full | | 0.16.3 | 2.7, 3.4, 3.5, 3.6, 3.7. 3.8, 3.9, 3.10, 3.11 | Security Fixes Only | #### Support Level Definitions diff --git a/pyproject.toml b/pyproject.toml index 9595f351..db92b1b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", diff --git a/rollbar/test/fastapi_tests/test_logger.py b/rollbar/test/fastapi_tests/test_logger.py index 99a8d9a2..b852179e 100644 --- a/rollbar/test/fastapi_tests/test_logger.py +++ b/rollbar/test/fastapi_tests/test_logger.py @@ -99,7 +99,7 @@ async def read_root(): store_current_request.assert_called_once() scope = store_current_request.call_args[0][0] - self.assertDictContainsSubset(expected_scope, scope) + self.assertEqual(scope, {**expected_scope, **scope}) def test_should_return_current_request(self): from fastapi import FastAPI diff --git a/rollbar/test/fastapi_tests/test_middleware.py b/rollbar/test/fastapi_tests/test_middleware.py index 023754a0..9c6a1983 100644 --- a/rollbar/test/fastapi_tests/test_middleware.py +++ b/rollbar/test/fastapi_tests/test_middleware.py @@ -302,7 +302,7 @@ async def read_root(): store_current_request.assert_called_once() scope = store_current_request.call_args[0][0] - self.assertDictContainsSubset(expected_scope, scope) + self.assertEqual(scope, {**expected_scope, **scope}) @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+' diff --git a/rollbar/test/fastapi_tests/test_routing.py b/rollbar/test/fastapi_tests/test_routing.py index c26ca159..64214d58 100644 --- a/rollbar/test/fastapi_tests/test_routing.py +++ b/rollbar/test/fastapi_tests/test_routing.py @@ -728,7 +728,7 @@ async def read_root(): store_current_request.assert_called_once() scope = store_current_request.call_args[0][0] - self.assertDictContainsSubset(expected_scope, scope) + self.assertEqual(scope, {**expected_scope, **scope}) @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+' diff --git a/rollbar/test/starlette_tests/test_logger.py b/rollbar/test/starlette_tests/test_logger.py index 5981e5cb..f392fb33 100644 --- a/rollbar/test/starlette_tests/test_logger.py +++ b/rollbar/test/starlette_tests/test_logger.py @@ -96,7 +96,7 @@ async def root(request): store_current_request.assert_called_once() scope = store_current_request.call_args[0][0] - self.assertDictContainsSubset(expected_scope, scope) + self.assertEqual(scope, {**expected_scope, **scope}) def test_should_return_current_request(self): from starlette.applications import Starlette diff --git a/rollbar/test/starlette_tests/test_middleware.py b/rollbar/test/starlette_tests/test_middleware.py index e7415af0..5457f99b 100644 --- a/rollbar/test/starlette_tests/test_middleware.py +++ b/rollbar/test/starlette_tests/test_middleware.py @@ -273,7 +273,7 @@ async def root(request): store_current_request.assert_called_once() scope = store_current_request.call_args[0][0] - self.assertDictContainsSubset(expected_scope, scope) + self.assertEqual(scope, {**expected_scope, **scope}) @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+' From 01231cca7da342f84c88817df9ad6fdfc2a9a629 Mon Sep 17 00:00:00 2001 From: Daniel Morell Date: Fri, 20 Sep 2024 16:03:58 -0500 Subject: [PATCH 2/2] Removed unsupported frameworks from Python3.12 CI tests. --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bf8ec3a..f6b7da19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,8 @@ jobs: # Django - framework: DJANGO_VERSION=3.2.25 python-version: 3.11 + - framework: DJANGO_VERSION=3.2.25 + python-version: 3.12 - framework: DJANGO_VERSION=4.2.15 python-version: 3.6 - framework: DJANGO_VERSION=4.2.15 @@ -61,6 +63,8 @@ jobs: # Twisted - framework: TWISTED_VERSION=20.3.0 python-version: 3.11 + - framework: TWISTED_VERSION=20.3.0 + python-version: 3.12 - framework: TWISTED_VERSION=22.10.0 python-version: 3.6