Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-makefun for openSUSE:Factory checked in at 2023-12-08 22:32:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-makefun (Old) and /work/SRC/openSUSE:Factory/.python-makefun.new.25432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-makefun" Fri Dec 8 22:32:17 2023 rev:7 rq:1131765 version:1.15.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-makefun/python-makefun.changes 2023-03-29 23:27:24.443523495 +0200 +++ /work/SRC/openSUSE:Factory/.python-makefun.new.25432/python-makefun.changes 2023-12-08 22:32:50.849752919 +0100 @@ -1,0 +2,8 @@ +Thu Dec 7 22:55:39 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 1.15.2: + * Fixed `SyntaxError` happening when the name of a native + coroutine function to create contains `'return'`. + * Fixes #96. + +------------------------------------------------------------------- Old: ---- makefun-1.15.1.tar.gz New: ---- makefun-1.15.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-makefun.spec ++++++ --- /var/tmp/diff_new_pack.9pAC0x/_old 2023-12-08 22:32:51.269768373 +0100 +++ /var/tmp/diff_new_pack.9pAC0x/_new 2023-12-08 22:32:51.273768519 +0100 @@ -17,7 +17,7 @@ Name: python-makefun -Version: 1.15.1 +Version: 1.15.2 Release: 0 License: BSD-3-Clause Summary: Small library to dynamically create python functions ++++++ makefun-1.15.1.tar.gz -> makefun-1.15.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.15.1/PKG-INFO new/makefun-1.15.2/PKG-INFO --- old/makefun-1.15.1/PKG-INFO 2023-02-23 11:43:05.000000000 +0100 +++ new/makefun-1.15.2/PKG-INFO 2023-11-09 22:52:01.000000000 +0100 @@ -1,9 +1,9 @@ Metadata-Version: 2.1 Name: makefun -Version: 1.15.1 +Version: 1.15.2 Summary: Small library to dynamically create python functions. Home-page: https://github.com/smarie/python-makefun -Download-URL: https://github.com/smarie/python-makefun/tarball/1.15.1 +Download-URL: https://github.com/smarie/python-makefun/tarball/1.15.2 Author: Sylvain MARIE <sylvain.ma...@se.com> Maintainer: Sylvain MARIE <sylvain.ma...@se.com> License: BSD 3-Clause diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.15.1/docs/changelog.md new/makefun-1.15.2/docs/changelog.md --- old/makefun-1.15.1/docs/changelog.md 2023-02-23 11:42:03.000000000 +0100 +++ new/makefun-1.15.2/docs/changelog.md 2023-11-09 22:50:38.000000000 +0100 @@ -1,5 +1,10 @@ # Changelog +### 1.15.2 - bugfix + + - Fixed `SyntaxError` happening when the name of a native coroutine function to create contains `'return'`. + Fixes [#96](https://github.com/smarie/python-makefun/issues/96). + ### 1.15.1 - bugfixes - Fixed `ValueError: Invalid co_name` happening on python 2 when the name of a function to create starts or ends with diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.15.1/src/makefun/_version.py new/makefun-1.15.2/src/makefun/_version.py --- old/makefun-1.15.1/src/makefun/_version.py 2023-02-23 11:43:05.000000000 +0100 +++ new/makefun-1.15.2/src/makefun/_version.py 2023-11-09 22:52:01.000000000 +0100 @@ -1,4 +1,4 @@ # file generated by setuptools_scm # don't change, don't track in version control -__version__ = version = '1.15.1' -__version_tuple__ = version_tuple = (1, 15, 1) +__version__ = version = '1.15.2' +__version_tuple__ = version_tuple = (1, 15, 2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.15.1/src/makefun/main.py new/makefun-1.15.2/src/makefun/main.py --- old/makefun-1.15.1/src/makefun/main.py 2023-02-23 11:42:03.000000000 +0100 +++ new/makefun-1.15.2/src/makefun/main.py 2023-11-09 22:50:38.000000000 +0100 @@ -312,7 +312,7 @@ body = "def %s\n return _func_impl_(%s)\n" % (func_signature_str, params_str) if iscoroutinefunction(func_impl): - body = ("async " + body).replace('return', 'return await') + body = ("async " + body).replace('return _func_impl_', 'return await _func_impl_') # create the function by compiling code, mapping the `_func_impl_` symbol to `func_impl` protect_eval_dict(evaldict, func_name, params_names) @@ -816,8 +816,8 @@ **attrs)` In other words, as opposed to `@with_signature`, the metadata (doc, module name, etc.) is provided by the wrapped - `wrapped_fun`, so that the created function seems to be identical (except possiblyfor the signature). - Note that all options in `with_signature` can still be overrided using parameters of `@wraps`. + `wrapped_fun`, so that the created function seems to be identical (except possibly for the signature). + Note that all options in `with_signature` can still be overridden using parameters of `@wraps`. The additional `__wrapped__` attribute is set on the created function, to stay consistent with the `functools.wraps` behaviour. If the signature is modified through `new_sig`, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.15.1/src/makefun.egg-info/PKG-INFO new/makefun-1.15.2/src/makefun.egg-info/PKG-INFO --- old/makefun-1.15.1/src/makefun.egg-info/PKG-INFO 2023-02-23 11:43:05.000000000 +0100 +++ new/makefun-1.15.2/src/makefun.egg-info/PKG-INFO 2023-11-09 22:52:01.000000000 +0100 @@ -1,9 +1,9 @@ Metadata-Version: 2.1 Name: makefun -Version: 1.15.1 +Version: 1.15.2 Summary: Small library to dynamically create python functions. Home-page: https://github.com/smarie/python-makefun -Download-URL: https://github.com/smarie/python-makefun/tarball/1.15.1 +Download-URL: https://github.com/smarie/python-makefun/tarball/1.15.2 Author: Sylvain MARIE <sylvain.ma...@se.com> Maintainer: Sylvain MARIE <sylvain.ma...@se.com> License: BSD 3-Clause diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makefun-1.15.1/tests/test_generators_coroutines.py new/makefun-1.15.2/tests/test_generators_coroutines.py --- old/makefun-1.15.1/tests/test_generators_coroutines.py 2023-02-23 11:42:03.000000000 +0100 +++ new/makefun-1.15.2/tests/test_generators_coroutines.py 2023-11-09 22:50:38.000000000 +0100 @@ -95,3 +95,25 @@ from asyncio import get_event_loop out = get_event_loop().run_until_complete(dynamic_fun(0.1)) assert out == 0.1 + + +@pytest.mark.skipif(sys.version_info < (3, 5), reason="native coroutines with async/await require python3.6 or higher") +def test_issue_96(): + """Same as `test_native_coroutine` but tests that we can use 'return' in the coroutine name""" + + # define the handler that should be called + from tests._test_py35 import make_native_coroutine_handler + my_native_coroutine_handler = make_native_coroutine_handler() + + # create the dynamic function + dynamic_fun = create_function("foo_returns_bar(sleep_time=2)", my_native_coroutine_handler) + + # check that this is a coroutine for inspect and for asyncio + assert iscoroutinefunction(dynamic_fun) + from asyncio import iscoroutinefunction as is_native_co + assert is_native_co(dynamic_fun) + + # verify that the new function is a native coroutine and behaves correctly + from asyncio import get_event_loop + out = get_event_loop().run_until_complete(dynamic_fun(0.1)) + assert out == 0.1