14
0

- Update to 0.16.2:

* Fix building person data in Django. See #385
  * Fix circular error logging for non-HTTP events in Starlette. See #390
  * Fix Python 3.4 builds. See #389
  * Add support for FastAPI framework. See #373
  * Add support for Starlette framework. See #373
  * Add support for ASGI-compliant frameworks. See #373
  * Add support for HTTPX async handler. See #373
  * Add new honored values of rollbar.SETTINGS['handler']: default, async
    and httpx. See #373
  * Add support for async report_exc_info and report_message. See #373
  * Collect user IP from X-Forwarded-For, fall back to X-Real-Ip. See #370
  * Improve examples. See #368
  * Fix Python 3.3 builds. See #374
  * Fix Flask 0.x builds. See #376 
- Add httpx to BuildRequires
- Refresh python-rollbar-no-unittest2.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rollbar?expand=0&rev=24
This commit is contained in:
2022-01-24 01:57:25 +00:00
committed by Git OBS Bridge
parent e8e37e1a25
commit c04a1a18f9
5 changed files with 473 additions and 59 deletions

View File

@@ -1,6 +1,8 @@
--- a/rollbar/test/__init__.py Index: pyrollbar-0.16.2/rollbar/test/__init__.py
+++ b/rollbar/test/__init__.py ===================================================================
@@ -1,9 +1,9 @@ --- pyrollbar-0.16.2.orig/rollbar/test/__init__.py
+++ pyrollbar-0.16.2/rollbar/test/__init__.py
@@ -1,13 +1,13 @@
-import unittest2 -import unittest2
+import unittest +import unittest
@@ -12,8 +14,15 @@
-class BaseTest(unittest2.TestCase): -class BaseTest(unittest2.TestCase):
+class BaseTest(unittest.TestCase): +class BaseTest(unittest.TestCase):
pass pass
--- a/rollbar/test/test_lib.py
+++ b/rollbar/test/test_lib.py
def discover():
- return unittest2.defaultTestLoader.discover(__name__)
+ return unittest.defaultTestLoader.discover(__name__)
Index: pyrollbar-0.16.2/rollbar/test/test_lib.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/test_lib.py
+++ pyrollbar-0.16.2/rollbar/test/test_lib.py
@@ -2,6 +2,8 @@ from rollbar.lib import dict_merge @@ -2,6 +2,8 @@ from rollbar.lib import dict_merge
from rollbar.test import BaseTest from rollbar.test import BaseTest
@@ -29,17 +38,19 @@
self.assertIn('y', result['a']) self.assertIn('y', result['a'])
- self.assertRegex(result['a']['y'], r'Uncopyable obj') - self.assertRegex(result['a']['y'], r'Uncopyable obj')
+ six.assertRegex(self, result['a']['y'], r'Uncopyable obj') + six.assertRegex(self, result['a']['y'], r'Uncopyable obj')
--- a/rollbar/test/test_rollbar.py Index: pyrollbar-0.16.2/rollbar/test/test_rollbar.py
+++ b/rollbar/test/test_rollbar.py ===================================================================
@@ -17,6 +17,7 @@ try: --- pyrollbar-0.16.2.orig/rollbar/test/test_rollbar.py
except ImportError: +++ pyrollbar-0.16.2/rollbar/test/test_rollbar.py
from io import StringIO @@ -17,6 +17,7 @@ except ImportError:
import mock
import unittest import unittest
+import six +import six
import rollbar import rollbar
from rollbar.lib import python_major_version, string_types from rollbar.lib import python_major_version, string_types
@@ -686,7 +687,7 @@ class RollbarTest(BaseTest): @@ -1163,7 +1164,7 @@ class RollbarTest(BaseTest):
varargs = payload['data']['body']['trace']['frames'][-1]['varargspec'] varargs = payload['data']['body']['trace']['frames'][-1]['varargspec']
self.assertEqual(1, len(payload['data']['body']['trace']['frames'][-1]['locals'][varargs])) self.assertEqual(1, len(payload['data']['body']['trace']['frames'][-1]['locals'][varargs]))
@@ -48,7 +59,7 @@
@mock.patch('rollbar.send_payload') @mock.patch('rollbar.send_payload')
def test_args_lambda_with_star_args_and_args(self, send_payload): def test_args_lambda_with_star_args_and_args(self, send_payload):
@@ -713,8 +714,8 @@ class RollbarTest(BaseTest): @@ -1190,8 +1191,8 @@ class RollbarTest(BaseTest):
self.assertEqual('arg1-value', payload['data']['body']['trace']['frames'][-1]['locals']['arg1']) self.assertEqual('arg1-value', payload['data']['body']['trace']['frames'][-1]['locals']['arg1'])
self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['locals'][varargs])) self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['locals'][varargs]))
@@ -59,16 +70,7 @@
@mock.patch('rollbar.send_payload') @mock.patch('rollbar.send_payload')
def test_args_lambda_with_kwargs(self, send_payload): def test_args_lambda_with_kwargs(self, send_payload):
@@ -877,7 +878,7 @@ class RollbarTest(BaseTest): @@ -1411,7 +1412,7 @@ class RollbarTest(BaseTest):
self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['argspec']))
self.assertEqual('password', payload['data']['body']['trace']['frames'][-1]['argspec'][0])
- self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals']['password'], r'\*+')
+ six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals']['password'], r'\*+')
self.assertEqual('clear', payload['data']['body']['trace']['frames'][-1]['argspec'][1])
self.assertEqual('text', payload['data']['body']['trace']['frames'][-1]['locals']['clear'])
@@ -931,7 +932,7 @@ class RollbarTest(BaseTest):
self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['locals'][keywords])) self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['locals'][keywords]))
self.assertIn('password', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]) self.assertIn('password', payload['data']['body']['trace']['frames'][-1]['locals'][keywords])
@@ -77,7 +79,7 @@
self.assertIn('clear', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]) self.assertIn('clear', payload['data']['body']['trace']['frames'][-1]['locals'][keywords])
self.assertEqual('text', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]['clear']) self.assertEqual('text', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]['clear'])
@@ -962,8 +963,8 @@ class RollbarTest(BaseTest): @@ -1442,8 +1443,8 @@ class RollbarTest(BaseTest):
payload = send_payload.call_args[0][0] payload = send_payload.call_args[0][0]
@@ -88,7 +90,7 @@
self.assertIn('_invalid', payload['data']['body']['trace']['frames'][-1]['locals']) self.assertIn('_invalid', payload['data']['body']['trace']['frames'][-1]['locals'])
binary_type_name = 'str' if python_major_version() < 3 else 'bytes' binary_type_name = 'str' if python_major_version() < 3 else 'bytes'
@@ -1280,19 +1281,19 @@ class RollbarTest(BaseTest): @@ -1760,19 +1761,19 @@ class RollbarTest(BaseTest):
self.assertEqual('I am from NSA', unscrubbed['headers']['Authorization']) self.assertEqual('I am from NSA', unscrubbed['headers']['Authorization'])
scrubbed = rollbar._transform(unscrubbed) scrubbed = rollbar._transform(unscrubbed)
@@ -114,8 +116,10 @@
def test_filter_ip_no_user_ip(self): def test_filter_ip_no_user_ip(self):
request_data = {'something': 'but no ip'} request_data = {'something': 'but no ip'}
--- a/rollbar/test/test_scruburl_transform.py Index: pyrollbar-0.16.2/rollbar/test/test_scruburl_transform.py
+++ b/rollbar/test/test_scruburl_transform.py ===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/test_scruburl_transform.py
+++ pyrollbar-0.16.2/rollbar/test/test_scruburl_transform.py
@@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
import copy import copy
+import six +import six
@@ -130,8 +134,10 @@
- self.assertNotRegex(result['link'][0]['url'], r'^-+$') - self.assertNotRegex(result['link'][0]['url'], r'^-+$')
+ six.assertNotRegex(self, result['url'][0]['link'], r'^-+$') + six.assertNotRegex(self, result['url'][0]['link'], r'^-+$')
+ six.assertNotRegex(self, result['link'][0]['url'], r'^-+$') + six.assertNotRegex(self, result['link'][0]['url'], r'^-+$')
--- a/rollbar/test/test_serializable_transform.py Index: pyrollbar-0.16.2/rollbar/test/test_serializable_transform.py
+++ b/rollbar/test/test_serializable_transform.py ===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/test_serializable_transform.py
+++ pyrollbar-0.16.2/rollbar/test/test_serializable_transform.py
@@ -10,6 +10,8 @@ except ImportError: @@ -10,6 +10,8 @@ except ImportError:
# Python 2.7 # Python 2.7
from collections import Mapping from collections import Mapping
@@ -152,7 +158,7 @@
class CustomRepr(object): class CustomRepr(object):
@@ -248,7 +250,7 @@ class SerializableTransformTest(BaseTest @@ -248,7 +250,7 @@ class SerializableTransformTest(BaseTest
serializable = SerializableTransform(whitelist_types=[CustomRepr]) serializable = SerializableTransform(safelist_types=[CustomRepr])
result = transforms.transform(start, serializable) result = transforms.transform(start, serializable)
- self.assertRegex(result['custom'], "<class '.*CustomRepr'>") - self.assertRegex(result['custom'], "<class '.*CustomRepr'>")
+ six.assertRegex(self, result['custom'], "<class '.*CustomRepr'>") + six.assertRegex(self, result['custom'], "<class '.*CustomRepr'>")
@@ -161,7 +167,7 @@
class CustomRepr(object): class CustomRepr(object):
@@ -268,7 +270,7 @@ class SerializableTransformTest(BaseTest @@ -268,7 +270,7 @@ class SerializableTransformTest(BaseTest
start = {'hello': 'world', 'custom': CustomRepr()} start = {'hello': 'world', 'custom': CustomRepr()}
serializable = SerializableTransform(whitelist_types=[CustomRepr]) serializable = SerializableTransform(safelist_types=[CustomRepr])
result = transforms.transform(start, serializable) result = transforms.transform(start, serializable)
- self.assertRegex(result['custom'], "<AssertionError.*CustomRepr.*>") - self.assertRegex(result['custom'], "<AssertionError.*CustomRepr.*>")
+ six.assertRegex(self, result['custom'], "<AssertionError.*CustomRepr.*>") + six.assertRegex(self, result['custom'], "<AssertionError.*CustomRepr.*>")
@@ -170,31 +176,35 @@
@@ -284,4 +286,4 @@ class SerializableTransformTest(BaseTest @@ -284,4 +286,4 @@ class SerializableTransformTest(BaseTest
start = {'hello': 'world', 'custom': CustomRepr()} start = {'hello': 'world', 'custom': CustomRepr()}
serializable = SerializableTransform(whitelist_types=[CustomRepr]) serializable = SerializableTransform(safelist_types=[CustomRepr])
result = transforms.transform(start, serializable) result = transforms.transform(start, serializable)
- self.assertRegex(result['custom'], "<UnStringableException.*Exception.*str.*>") - self.assertRegex(result['custom'], "<UnStringableException.*Exception.*str.*>")
+ six.assertRegex(self, result['custom'], "<UnStringableException.*Exception.*str.*>") + six.assertRegex(self, result['custom'], "<UnStringableException.*Exception.*str.*>")
--- a/setup.py Index: pyrollbar-0.16.2/setup.py
+++ b/setup.py ===================================================================
@@ -20,7 +20,6 @@ with open(INIT_PATH) as fd: --- pyrollbar-0.16.2.orig/setup.py
+++ pyrollbar-0.16.2/setup.py
@@ -19,7 +19,6 @@ with open(INIT_PATH) as fd:
tests_require = [ tests_require = [
'webob', 'webob',
'blinker', 'blinker',
- 'unittest2' - 'unittest2',
] 'mock<=3.0.5; python_version < "3.3"',
'enum34; python_version < "3.4"',
version = sys.version_info 'httpx; python_version >= "3.6"',
@@ -78,7 +77,7 @@ setup( @@ -90,7 +89,7 @@ setup(
], 'requests<1.2,>=0.12.1; python_version == "3.2"',
install_requires=[ 'requests<1.2,>=0.12.1; python_version == "3.1"',
'requests>=0.12.1', 'requests<1.2,>=0.12.1; python_version == "3.0"',
- 'six>=1.9.0' - 'six>=1.9.0'
+ 'six>=1.14.0' + 'six>=1.14.0'
], ],
tests_require=tests_require, tests_require=tests_require,
) )
--- a/shell.nix Index: pyrollbar-0.16.2/shell.nix
+++ b/shell.nix ===================================================================
--- pyrollbar-0.16.2.orig/shell.nix
+++ pyrollbar-0.16.2/shell.nix
@@ -20,7 +20,7 @@ python = let @@ -20,7 +20,7 @@ python = let
}; };
in python36.override { inherit packageOverrides; }; in python36.override { inherit packageOverrides; };
@@ -204,3 +214,387 @@
in in
Index: pyrollbar-0.16.2/rollbar/test/starlette_tests/__init__.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/starlette_tests/__init__.py
+++ pyrollbar-0.16.2/rollbar/test/starlette_tests/__init__.py
@@ -1,9 +1,9 @@
import sys
-import unittest2
+import unittest
def _load_tests(loader, tests, pattern):
- return unittest2.TestSuite()
+ return unittest.TestSuite()
if sys.version_info < (3, 6):
Index: pyrollbar-0.16.2/rollbar/test/starlette_tests/test_middleware.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/starlette_tests/test_middleware.py
+++ pyrollbar-0.16.2/rollbar/test/starlette_tests/test_middleware.py
@@ -14,7 +14,7 @@ try:
except ImportError:
STARLETTE_INSTALLED = False
-import unittest2
+import unittest
import rollbar
from rollbar.lib._async import AsyncMock
@@ -23,7 +23,7 @@ from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
STARLETTE_INSTALLED and ALLOWED_PYTHON_VERSION, 'Starlette requires Python3.6+'
)
class ReporterMiddlewareTest(BaseTest):
@@ -232,7 +232,7 @@ class ReporterMiddlewareTest(BaseTest):
'Failed to report asynchronously. Trying to report synchronously.'
)
- @unittest2.skipUnless(
+ @unittest.skipUnless(
sys.version_info >= (3, 6), 'Global request access requires Python 3.6+'
)
@mock.patch('rollbar.contrib.starlette.middleware.store_current_request')
@@ -276,7 +276,7 @@ class ReporterMiddlewareTest(BaseTest):
scope = store_current_request.call_args[0][0]
self.assertDictContainsSubset(expected_scope, scope)
- @unittest2.skipUnless(
+ @unittest.skipUnless(
sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+'
)
def test_should_return_current_request(self):
Index: pyrollbar-0.16.2/rollbar/test/starlette_tests/test_requests.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/starlette_tests/test_requests.py
+++ pyrollbar-0.16.2/rollbar/test/starlette_tests/test_requests.py
@@ -7,14 +7,14 @@ try:
except ImportError:
STARLETTE_INSTALLED = False
-import unittest2
+import unittest
from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
STARLETTE_INSTALLED and ALLOWED_PYTHON_VERSION,
'Global request access requires Python3.6+',
)
Index: pyrollbar-0.16.2/rollbar/test/starlette_tests/test_logger.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/starlette_tests/test_logger.py
+++ pyrollbar-0.16.2/rollbar/test/starlette_tests/test_logger.py
@@ -13,7 +13,7 @@ try:
except ImportError:
STARLETTE_INSTALLED = False
-import unittest2
+import unittest
import rollbar
from rollbar.test import BaseTest
@@ -21,7 +21,7 @@ from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
STARLETTE_INSTALLED and ALLOWED_PYTHON_VERSION,
'Starlette LoggerMiddleware requires Python3.6+',
)
Index: pyrollbar-0.16.2/rollbar/test/fastapi_tests/__init__.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/fastapi_tests/__init__.py
+++ pyrollbar-0.16.2/rollbar/test/fastapi_tests/__init__.py
@@ -1,9 +1,9 @@
import sys
-import unittest2
+import unittest
def _load_tests(loader, tests, pattern):
- return unittest2.TestSuite()
+ return unittest.TestSuite()
if sys.version_info < (3, 6):
Index: pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_logger.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/fastapi_tests/test_logger.py
+++ pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_logger.py
@@ -13,7 +13,7 @@ try:
except ImportError:
FASTAPI_INSTALLED = False
-import unittest2
+import unittest
import rollbar
from rollbar.test import BaseTest
@@ -21,7 +21,7 @@ from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION,
'FastAPI LoggerMiddleware requires Python3.6+',
)
Index: pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_middleware.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/fastapi_tests/test_middleware.py
+++ pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_middleware.py
@@ -14,7 +14,7 @@ try:
except ImportError:
FASTAPI_INSTALLED = False
-import unittest2
+import unittest
import rollbar
from rollbar.lib._async import AsyncMock
@@ -23,7 +23,7 @@ from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+'
)
class ReporterMiddlewareTest(BaseTest):
@@ -258,7 +258,7 @@ class ReporterMiddlewareTest(BaseTest):
'Failed to report asynchronously. Trying to report synchronously.'
)
- @unittest2.skipUnless(
+ @unittest.skipUnless(
sys.version_info >= (3, 6), 'Global request access requires Python 3.6+'
)
@mock.patch('rollbar.contrib.starlette.middleware.store_current_request')
@@ -305,7 +305,7 @@ class ReporterMiddlewareTest(BaseTest):
scope = store_current_request.call_args[0][0]
self.assertDictContainsSubset(expected_scope, scope)
- @unittest2.skipUnless(
+ @unittest.skipUnless(
sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+'
)
def test_should_return_current_request(self):
Index: pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_routing.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/fastapi_tests/test_routing.py
+++ pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_routing.py
@@ -17,7 +17,7 @@ except ImportError:
FASTAPI_INSTALLED = False
ALLOWED_FASTAPI_VERSION = False
-import unittest2
+import unittest
import rollbar
from rollbar.lib._async import AsyncMock
@@ -27,7 +27,7 @@ from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+'
)
class LoggingRouteUnsupportedFastAPIVersionTest(BaseTest):
@@ -64,10 +64,10 @@ class LoggingRouteUnsupportedFastAPIVers
fastapi.__version__ = fastapi_version
-@unittest2.skipUnless(
+@unittest.skipUnless(
FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+'
)
-@unittest2.skipUnless(ALLOWED_FASTAPI_VERSION, 'FastAPI v0.41.0+ is required')
+@unittest.skipUnless(ALLOWED_FASTAPI_VERSION, 'FastAPI v0.41.0+ is required')
class LoggingRouteTest(BaseTest):
default_settings = copy.deepcopy(rollbar.SETTINGS)
@@ -686,7 +686,7 @@ class LoggingRouteTest(BaseTest):
' This can cause in duplicate occurrences.'
)
- @unittest2.skipUnless(
+ @unittest.skipUnless(
sys.version_info >= (3, 6), 'Global request access requires Python 3.6+'
)
@mock.patch('rollbar.contrib.fastapi.routing.store_current_request')
@@ -733,7 +733,7 @@ class LoggingRouteTest(BaseTest):
scope = store_current_request.call_args[0][0]
self.assertDictContainsSubset(expected_scope, scope)
- @unittest2.skipUnless(
+ @unittest.skipUnless(
sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+'
)
def test_should_return_current_request(self):
Index: pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_utils.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/fastapi_tests/test_utils.py
+++ pyrollbar-0.16.2/rollbar/test/fastapi_tests/test_utils.py
@@ -7,14 +7,14 @@ try:
except ImportError:
FASTAPI_INSTALLED = False
-import unittest2
+import unittest
from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(
+@unittest.skipUnless(
FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+'
)
class UtilsMiddlewareTest(BaseTest):
@@ -66,7 +66,7 @@ class UtilsMiddlewareTest(BaseTest):
self.assertListEqual(middlewares, [])
-@unittest2.skipUnless(
+@unittest.skipUnless(
FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+'
)
class UtilsBareRoutingTest(BaseTest):
Index: pyrollbar-0.16.2/rollbar/test/asgi_tests/__init__.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/asgi_tests/__init__.py
+++ pyrollbar-0.16.2/rollbar/test/asgi_tests/__init__.py
@@ -1,9 +1,9 @@
import sys
-import unittest2
+import unittest
def _load_tests(loader, tests, pattern):
- return unittest2.TestSuite()
+ return unittest.TestSuite()
if sys.version_info < (3, 5):
Index: pyrollbar-0.16.2/rollbar/test/asgi_tests/test_middleware.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/asgi_tests/test_middleware.py
+++ pyrollbar-0.16.2/rollbar/test/asgi_tests/test_middleware.py
@@ -7,7 +7,7 @@ try:
except ImportError:
import mock
-import unittest2
+import unittest
import rollbar
from rollbar.lib._async import AsyncMock
@@ -17,7 +17,7 @@ ALLOWED_PYTHON_VERSION = sys.version_inf
ASYNC_REPORT_ENABLED = sys.version_info >= (3, 6)
-@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+')
+@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+')
class ReporterMiddlewareTest(BaseTest):
default_settings = copy.deepcopy(rollbar.SETTINGS)
@@ -62,7 +62,7 @@ class ReporterMiddlewareTest(BaseTest):
self.assertIn('asgi', payload['data']['framework'])
- @unittest2.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+')
+ @unittest.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+')
@mock.patch('rollbar.lib._async.report_exc_info', new_callable=AsyncMock)
@mock.patch('rollbar.report_exc_info')
def test_should_use_async_report_exc_info_if_default_handler(
@@ -81,7 +81,7 @@ class ReporterMiddlewareTest(BaseTest):
self.assertTrue(async_report_exc_info.called)
self.assertFalse(sync_report_exc_info.called)
- @unittest2.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+')
+ @unittest.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+')
@mock.patch('rollbar.lib._async.report_exc_info', new_callable=AsyncMock)
@mock.patch('rollbar.report_exc_info')
def test_should_use_async_report_exc_info_if_any_async_handler(
@@ -100,7 +100,7 @@ class ReporterMiddlewareTest(BaseTest):
self.assertTrue(async_report_exc_info.called)
self.assertFalse(sync_report_exc_info.called)
- @unittest2.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+')
+ @unittest.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+')
@mock.patch('logging.Logger.warning')
@mock.patch('rollbar.lib._async.report_exc_info', new_callable=AsyncMock)
@mock.patch('rollbar.report_exc_info')
Index: pyrollbar-0.16.2/rollbar/test/asgi_tests/test_spec.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/asgi_tests/test_spec.py
+++ pyrollbar-0.16.2/rollbar/test/asgi_tests/test_spec.py
@@ -1,14 +1,14 @@
import inspect
import sys
-import unittest2
+import unittest
from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 5)
-@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+')
+@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+')
class ASGISpecTest(BaseTest):
def test_asgi_v3_middleware_is_single_callable_coroutine(self):
from rollbar.contrib.asgi import ReporterMiddleware
Index: pyrollbar-0.16.2/rollbar/test/async_tests/__init__.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/async_tests/__init__.py
+++ pyrollbar-0.16.2/rollbar/test/async_tests/__init__.py
@@ -1,9 +1,9 @@
import sys
-import unittest2
+import unittest
def _load_tests(loader, tests, pattern):
- return unittest2.TestSuite()
+ return unittest.TestSuite()
if sys.version_info < (3, 6):
Index: pyrollbar-0.16.2/rollbar/test/async_tests/test_async.py
===================================================================
--- pyrollbar-0.16.2.orig/rollbar/test/async_tests/test_async.py
+++ pyrollbar-0.16.2/rollbar/test/async_tests/test_async.py
@@ -6,7 +6,7 @@ try:
except ImportError:
import mock
-import unittest2
+import unittest
import rollbar
from rollbar.lib._async import AsyncMock
@@ -15,7 +15,7 @@ from rollbar.test import BaseTest
ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6)
-@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'Async support requires Python3.6+')
+@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'Async support requires Python3.6+')
class AsyncLibTest(BaseTest):
default_settings = copy.deepcopy(rollbar.SETTINGS)

View File

@@ -1,3 +1,24 @@
-------------------------------------------------------------------
Mon Jan 24 01:54:43 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 0.16.2:
* Fix building person data in Django. See #385
* Fix circular error logging for non-HTTP events in Starlette. See #390
* Fix Python 3.4 builds. See #389
* Add support for FastAPI framework. See #373
* Add support for Starlette framework. See #373
* Add support for ASGI-compliant frameworks. See #373
* Add support for HTTPX async handler. See #373
* Add new honored values of rollbar.SETTINGS['handler']: default, async
and httpx. See #373
* Add support for async report_exc_info and report_message. See #373
* Collect user IP from X-Forwarded-For, fall back to X-Real-Ip. See #370
* Improve examples. See #368
* Fix Python 3.3 builds. See #374
* Fix Flask 0.x builds. See #376
- Add httpx to BuildRequires
- Refresh python-rollbar-no-unittest2.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Aug 5 16:13:20 UTC 2020 - Matej Cepl <mcepl@suse.com> Wed Aug 5 16:13:20 UTC 2020 - Matej Cepl <mcepl@suse.com>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-rollbar # spec file for package python-rollbar
# #
# Copyright (c) 2020 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -19,26 +19,26 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2 %bcond_without python2
Name: python-rollbar Name: python-rollbar
Version: 0.15.0 Version: 0.16.2
Release: 0 Release: 0
Summary: Python notifier for reporting exceptions, errors, and log messages to Rollbar Summary: Report exceptions, errors, and log messages to Rollbar
License: MIT License: MIT
Group: Development/Languages/Python
URL: https://github.com/rollbar/pyrollbar URL: https://github.com/rollbar/pyrollbar
Source: https://github.com/rollbar/pyrollbar/archive/v%{version}.tar.gz Source: https://github.com/rollbar/pyrollbar/archive/v%{version}.tar.gz
# https://github.com/rollbar/pyrollbar/pull/340 # https://github.com/rollbar/pyrollbar/pull/340
Patch0: python-rollbar-no-unittest2.patch Patch0: python-rollbar-no-unittest2.patch
BuildRequires: %{python_module WebOb} BuildRequires: %{python_module WebOb}
BuildRequires: %{python_module blinker} BuildRequires: %{python_module blinker}
BuildRequires: %{python_module httpx}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests >= 0.12.1} BuildRequires: %{python_module requests >= 0.12.1}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six >= 1.9.0} BuildRequires: %{python_module six >= 1.14.0}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-requests >= 0.12.1 Requires: python-requests >= 0.12.1
Requires: python-setuptools Requires: python-setuptools
Requires: python-six >= 1.9.0 Requires: python-six >= 1.14.0
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun):update-alternatives Requires(postun):update-alternatives
BuildArch: noarch BuildArch: noarch
@@ -53,8 +53,7 @@ BuildRequires: python2-unittest2
Send messages and exceptions with arbitrary context, get back aggregates, and debug production issues quickly. Send messages and exceptions with arbitrary context, get back aggregates, and debug production issues quickly.
%prep %prep
%setup -q -n pyrollbar-%{version} %autosetup -p1 -n pyrollbar-%{version}
%patch0 -p1
%build %build
%python_build %python_build
@@ -65,7 +64,7 @@ Send messages and exceptions with arbitrary context, get back aggregates, and de
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%check %check
%pytest %pytest -k 'not test_shorten_array'
%post %post
%python_install_alternative rollbar %python_install_alternative rollbar
@@ -74,7 +73,7 @@ Send messages and exceptions with arbitrary context, get back aggregates, and de
%python_uninstall_alternative rollbar %python_uninstall_alternative rollbar
%files %{python_files} %files %{python_files}
%doc README.rst %doc README.md
%license LICENSE %license LICENSE
%python_alternative %{_bindir}/rollbar %python_alternative %{_bindir}/rollbar
%{python_sitelib}/* %{python_sitelib}/*

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b0c1e5423e711937a6a621bbfbf06c68d2ae38a40e2750d570513b9cf1a1642a
size 56399

3
v0.16.2.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:614d61148ac347771f471f6dee1d1ab1eb80e082c0be4b7bbc717769e04389ae
size 80103