Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-Flask-RESTful for 
openSUSE:Factory checked in at 2023-07-03 17:42:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Flask-RESTful (Old)
 and      /work/SRC/openSUSE:Factory/.python-Flask-RESTful.new.13546 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Flask-RESTful"

Mon Jul  3 17:42:18 2023 rev:7 rq:1096325 version:0.3.10

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-Flask-RESTful/python-Flask-RESTful.changes    
    2021-07-08 22:49:36.283920053 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-Flask-RESTful.new.13546/python-Flask-RESTful.changes
     2023-07-03 17:42:20.748563289 +0200
@@ -1,0 +2,6 @@
+Sat Jul  1 20:55:41 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.3.10:
+  * Compatibility with Flask 2.3
+
+-------------------------------------------------------------------

Old:
----
  Flask-RESTful-0.3.9.tar.gz

New:
----
  Flask-RESTful-0.3.10.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-Flask-RESTful.spec ++++++
--- /var/tmp/diff_new_pack.6sLBlu/_old  2023-07-03 17:42:21.428567293 +0200
+++ /var/tmp/diff_new_pack.6sLBlu/_new  2023-07-03 17:42:21.432567316 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-Flask-RESTful
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-Flask-RESTful
-Version:        0.3.9
+Version:        0.3.10
 Release:        0
 Summary:        Framework for creating REST APIs
 License:        BSD-3-Clause

++++++ Flask-RESTful-0.3.9.tar.gz -> Flask-RESTful-0.3.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/Flask_RESTful.egg-info/PKG-INFO 
new/Flask-RESTful-0.3.10/Flask_RESTful.egg-info/PKG-INFO
--- old/Flask-RESTful-0.3.9/Flask_RESTful.egg-info/PKG-INFO     2021-05-17 
21:23:11.000000000 +0200
+++ new/Flask-RESTful-0.3.10/Flask_RESTful.egg-info/PKG-INFO    2023-05-21 
05:55:52.000000000 +0200
@@ -1,12 +1,12 @@
 Metadata-Version: 2.1
 Name: Flask-RESTful
-Version: 0.3.9
+Version: 0.3.10
 Summary: Simple framework for creating REST APIs
 Home-page: https://www.github.com/flask-restful/flask-restful/
 Author: Twilio API Team
 Author-email: h...@twilio.com
 License: BSD
-Description: UNKNOWN
+Project-URL: Source, https://github.com/flask-restful/flask-restful
 Platform: any
 Classifier: Framework :: Flask
 Classifier: Programming Language :: Python :: 2
@@ -19,3 +19,5 @@
 Classifier: Programming Language :: Python :: 3.8
 Classifier: License :: OSI Approved :: BSD License
 Provides-Extra: docs
+License-File: LICENSE
+License-File: AUTHORS.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/Makefile 
new/Flask-RESTful-0.3.10/Makefile
--- old/Flask-RESTful-0.3.9/Makefile    2021-05-17 21:18:29.000000000 +0200
+++ new/Flask-RESTful-0.3.10/Makefile   2023-05-21 05:48:12.000000000 +0200
@@ -4,7 +4,7 @@
                PYTHON_MAJOR := 3
        endif
        ifndef PYTHON_MINOR
-               PYTHON_MINOR := 8
+               PYTHON_MINOR := 9
        endif
        ENV := env/py$(PYTHON_MAJOR)$(PYTHON_MINOR)
 else
@@ -139,7 +139,7 @@
 test: .depends-test .clean-test
        $(NOSE) tests --with-coverage --cover-package=$(PACKAGE)
 
-test-all: test-py27 test-py34 test-py35 test-py36 test-py37 test-py38
+test-all: test-py27 test-py34 test-py35 test-py36 test-py37 test-py38 
test-py39 test-py10 test-py11
 test-py27:
        PYTHON_MAJOR=2 PYTHON_MINOR=7 $(MAKE) test
 test-py34:
@@ -152,6 +152,12 @@
        PYTHON_MAJOR=3 PYTHON_MINOR=7 $(MAKE) test
 test-py38:
        PYTHON_MAJOR=3 PYTHON_MINOR=8 $(MAKE) test
+test-py39:
+       PYTHON_MAJOR=3 PYTHON_MINOR=9 $(MAKE) test
+test-py310:
+       PYTHON_MAJOR=3 PYTHON_MINOR=10 $(MAKE) test
+test-py311:
+       PYTHON_MAJOR=3 PYTHON_MINOR=11 $(MAKE) test
 
 .PHONY: htmlcov
 htmlcov: test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/PKG-INFO 
new/Flask-RESTful-0.3.10/PKG-INFO
--- old/Flask-RESTful-0.3.9/PKG-INFO    2021-05-17 21:23:11.894976600 +0200
+++ new/Flask-RESTful-0.3.10/PKG-INFO   2023-05-21 05:55:52.728482500 +0200
@@ -1,12 +1,12 @@
 Metadata-Version: 2.1
 Name: Flask-RESTful
-Version: 0.3.9
+Version: 0.3.10
 Summary: Simple framework for creating REST APIs
 Home-page: https://www.github.com/flask-restful/flask-restful/
 Author: Twilio API Team
 Author-email: h...@twilio.com
 License: BSD
-Description: UNKNOWN
+Project-URL: Source, https://github.com/flask-restful/flask-restful
 Platform: any
 Classifier: Framework :: Flask
 Classifier: Programming Language :: Python :: 2
@@ -19,3 +19,5 @@
 Classifier: Programming Language :: Python :: 3.8
 Classifier: License :: OSI Approved :: BSD License
 Provides-Extra: docs
+License-File: LICENSE
+License-File: AUTHORS.md
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/flask_restful/__init__.py 
new/Flask-RESTful-0.3.10/flask_restful/__init__.py
--- old/Flask-RESTful-0.3.9/flask_restful/__init__.py   2021-05-17 
21:16:30.000000000 +0200
+++ new/Flask-RESTful-0.3.10/flask_restful/__init__.py  2023-05-21 
05:45:44.000000000 +0200
@@ -18,6 +18,7 @@
 except ImportError:
     from collections import Mapping
 
+_PROPAGATE_EXCEPTIONS = 'PROPAGATE_EXCEPTIONS'
 
 __all__ = ('Api', 'Resource', 'marshal', 'marshal_with', 'marshal_with_field', 
'abort')
 
@@ -26,7 +27,7 @@
     """Raise a HTTPException for the given http_status_code. Attach any keyword
     arguments to the exception for later processing.
     """
-    #noinspection PyUnresolvedReferences
+    # noinspection PyUnresolvedReferences
     try:
         original_flask_abort(http_status_code)
     except HTTPException as e:
@@ -34,6 +35,32 @@
             e.data = kwargs
         raise
 
+
+def _get_propagate_exceptions_bool(app):
+    """Handle Flask's propagate_exceptions.
+
+    If propagate_exceptions is set to True then the exceptions are re-raised 
rather than being handled
+    by the app’s error handlers.
+
+    The default value for Flask's app.config['PROPAGATE_EXCEPTIONS'] is None. 
In this case return a sensible
+    value: self.testing or self.debug.
+    """
+    propagate_exceptions = app.config.get(_PROPAGATE_EXCEPTIONS, False)
+    if propagate_exceptions is None:
+        return app.testing or app.debug
+    return propagate_exceptions
+
+
+def _handle_flask_propagate_exceptions_config(app, e):
+    propagate_exceptions = _get_propagate_exceptions_bool(app)
+    if not isinstance(e, HTTPException) and propagate_exceptions:
+        exc_type, exc_value, tb = sys.exc_info()
+        if exc_value is e:
+            raise
+        else:
+            raise e
+
+
 DEFAULT_REPRESENTATIONS = [('application/json', output_json)]
 
 
@@ -280,19 +307,14 @@
         """
         got_request_exception.send(current_app._get_current_object(), 
exception=e)
 
-        if not isinstance(e, HTTPException) and 
current_app.propagate_exceptions:
-            exc_type, exc_value, tb = sys.exc_info()
-            if exc_value is e:
-                raise
-            else:
-                raise e
+        _handle_flask_propagate_exceptions_config(current_app, e)
 
         headers = Headers()
         if isinstance(e, HTTPException):
             if e.response is not None:
                 # If HTTPException is initialized with a response, then return 
e.get_response().
                 # This prevents specified error response from being overridden.
-                # eg. HTTPException(response=Response("Hello World"))
+                # e.g., HTTPException(response=Response("Hello World"))
                 resp = e.get_response()
                 return resp
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/flask_restful/__version__.py 
new/Flask-RESTful-0.3.10/flask_restful/__version__.py
--- old/Flask-RESTful-0.3.9/flask_restful/__version__.py        2021-05-17 
21:21:14.000000000 +0200
+++ new/Flask-RESTful-0.3.10/flask_restful/__version__.py       2023-05-21 
05:46:59.000000000 +0200
@@ -1,3 +1,3 @@
 #!/usr/bin/env python
 
-__version__ = '0.3.9'
+__version__ = '0.3.10'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/setup.py 
new/Flask-RESTful-0.3.10/setup.py
--- old/Flask-RESTful-0.3.9/setup.py    2020-02-06 14:42:49.000000000 +0100
+++ new/Flask-RESTful-0.3.10/setup.py   2023-05-21 05:44:25.000000000 +0200
@@ -33,6 +33,9 @@
     version=version,
     license='BSD',
     url='https://www.github.com/flask-restful/flask-restful/',
+    project_urls={
+        'Source': 'https://github.com/flask-restful/flask-restful',
+    },
     author='Twilio API Team',
     author_email='h...@twilio.com',
     description='Simple framework for creating REST APIs',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Flask-RESTful-0.3.9/tests/test_api.py 
new/Flask-RESTful-0.3.10/tests/test_api.py
--- old/Flask-RESTful-0.3.9/tests/test_api.py   2021-05-17 21:16:30.000000000 
+0200
+++ new/Flask-RESTful-0.3.10/tests/test_api.py  2023-05-21 05:51:10.000000000 
+0200
@@ -18,6 +18,19 @@
 from json import dumps, loads, JSONEncoder
 from nose.tools import assert_equal  # you need it for tests in form of 
continuations
 import six
+from types import SimpleNamespace
+from unittest.mock import patch
+
+_FLASK_RESTFUL_SYS_EXC_INFO = 'flask_restful.sys.exc_info'
+_PROPAGATE_EXCEPTIONS = 'PROPAGATE_EXCEPTIONS'
+_APP_ENDPOINT = '/foo'
+
+
+def setup_propagate_exceptions(propagate_exceptions):
+    app = Flask(__name__)
+    app.config[_PROPAGATE_EXCEPTIONS] = propagate_exceptions
+    api = flask_restful.Api(app)
+    return SimpleNamespace(app=app, api=api)
 
 
 def check_unpack(expected, value):
@@ -117,6 +130,27 @@
             self.assertEqual(resp.status_code, 400)
             self.assertEqual(resp.get_data(), b'{"message": "x"}\n')
 
+    @patch(_FLASK_RESTFUL_SYS_EXC_INFO)
+    def test_handle_error_propagate_exceptions_raise_exception(self, 
mock_sys_exc_info):
+        setup = setup_propagate_exceptions(True)
+        mock_sys_exc_info.return_value = (KeyError, ValueError, 
Exception.__traceback__)
+        with setup.app.test_request_context(_APP_ENDPOINT):
+            self.assertRaises(KeyError, setup.api.handle_error, KeyError)
+
+    @patch(_FLASK_RESTFUL_SYS_EXC_INFO)
+    def test_handle_error_propagate_exceptions_raise(self, mock_sys_exc_info):
+        setup = setup_propagate_exceptions(True)
+        mock_sys_exc_info.return_value = (KeyError, ValueError, 
Exception.__traceback__)
+        with setup.app.test_request_context(_APP_ENDPOINT):
+            self.assertRaises(Exception, setup.api.handle_error, ValueError)
+
+    @patch(_FLASK_RESTFUL_SYS_EXC_INFO)
+    def test_handle_error_propagate_exceptions_none(self, mock_sys_exc_info):
+        setup = setup_propagate_exceptions(None)
+        mock_sys_exc_info.return_value = (KeyError, ValueError, 
Exception.__traceback__)
+        setup.app.debug = True
+        with setup.app.test_request_context(_APP_ENDPOINT):
+            self.assertRaises(Exception, setup.api.handle_error, ValueError)
 
     def test_handle_error_does_not_swallow_custom_exceptions(self):
         app = Flask(__name__)
@@ -505,7 +539,7 @@
         with app.test_request_context('/foo'):
             api.error_router(exception, app.handle_exception)
 
-        self.assertTrue(app.handle_exception.called_with(exception))
+        # self.assertTrue(app.handle_exception.called_with(exception))
 
     def test_media_types(self):
         app = Flask(__name__)

Reply via email to