Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Pebble for openSUSE:Factory checked in at 2022-10-08 01:23:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Pebble (Old) and /work/SRC/openSUSE:Factory/.python-Pebble.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Pebble" Sat Oct 8 01:23:31 2022 rev:11 rq:1008360 version:5.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Pebble/python-Pebble.changes 2022-09-14 13:45:30.377973431 +0200 +++ /work/SRC/openSUSE:Factory/.python-Pebble.new.2275/python-Pebble.changes 2022-10-08 01:23:35.494004874 +0200 @@ -1,0 +2,8 @@ +Thu Oct 6 07:29:26 UTC 2022 - Martin Li??ka <mli...@suse.cz> + +- Update to 5.0.1 + * Improvements: + + issue #105: run callbacks after process termination on timeout or + task cancellation + +------------------------------------------------------------------- Old: ---- Pebble-5.0.0.tar.gz New: ---- Pebble-5.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Pebble.spec ++++++ --- /var/tmp/diff_new_pack.3vXX2h/_old 2022-10-08 01:23:35.962005948 +0200 +++ /var/tmp/diff_new_pack.3vXX2h/_new 2022-10-08 01:23:35.970005966 +0200 @@ -17,7 +17,7 @@ Name: python-Pebble -Version: 5.0.0 +Version: 5.0.1 Release: 0 Summary: Threading and multiprocessing eye-candy for Python License: LGPL-3.0-only ++++++ Pebble-5.0.0.tar.gz -> Pebble-5.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/PKG-INFO new/Pebble-5.0.1/PKG-INFO --- old/Pebble-5.0.0/PKG-INFO 2022-09-13 08:44:08.715726000 +0200 +++ new/Pebble-5.0.1/PKG-INFO 2022-10-05 22:54:29.115634200 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Pebble -Version: 5.0.0 +Version: 5.0.1 Summary: Threading and multiprocessing eye-candy. Home-page: https://github.com/noxdafox/pebble Author: Matteo Cafasso @@ -89,6 +89,8 @@ from pebble import ProcessPool from concurrent.futures import TimeoutError + + TIMEOUT_SECONDS = 3 def function(foo, bar=0): return foo + bar @@ -103,8 +105,8 @@ print(error.traceback) # traceback of the function with ProcessPool(max_workers=5, max_tasks=10) as pool: - for i in range(0, 10): - future = pool.schedule(function, args=[i], timeout=3) + for index in range(0, 10): + future = pool.submit(function, TIMEOUT_SECONDS, index, bar=1) future.add_done_callback(task_done) Keywords: thread process pool decorator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/Pebble.egg-info/PKG-INFO new/Pebble-5.0.1/Pebble.egg-info/PKG-INFO --- old/Pebble-5.0.0/Pebble.egg-info/PKG-INFO 2022-09-13 08:44:08.000000000 +0200 +++ new/Pebble-5.0.1/Pebble.egg-info/PKG-INFO 2022-10-05 22:54:28.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Pebble -Version: 5.0.0 +Version: 5.0.1 Summary: Threading and multiprocessing eye-candy. Home-page: https://github.com/noxdafox/pebble Author: Matteo Cafasso @@ -89,6 +89,8 @@ from pebble import ProcessPool from concurrent.futures import TimeoutError + + TIMEOUT_SECONDS = 3 def function(foo, bar=0): return foo + bar @@ -103,8 +105,8 @@ print(error.traceback) # traceback of the function with ProcessPool(max_workers=5, max_tasks=10) as pool: - for i in range(0, 10): - future = pool.schedule(function, args=[i], timeout=3) + for index in range(0, 10): + future = pool.submit(function, TIMEOUT_SECONDS, index, bar=1) future.add_done_callback(task_done) Keywords: thread process pool decorator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/README.rst new/Pebble-5.0.1/README.rst --- old/Pebble-5.0.0/README.rst 2022-09-12 20:29:40.000000000 +0200 +++ new/Pebble-5.0.1/README.rst 2022-10-05 22:53:41.000000000 +0200 @@ -81,6 +81,8 @@ from pebble import ProcessPool from concurrent.futures import TimeoutError + + TIMEOUT_SECONDS = 3 def function(foo, bar=0): return foo + bar @@ -95,6 +97,6 @@ print(error.traceback) # traceback of the function with ProcessPool(max_workers=5, max_tasks=10) as pool: - for i in range(0, 10): - future = pool.schedule(function, args=[i], timeout=3) + for index in range(0, 10): + future = pool.submit(function, TIMEOUT_SECONDS, index, bar=1) future.add_done_callback(task_done) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/pebble/__init__.py new/Pebble-5.0.1/pebble/__init__.py --- old/Pebble-5.0.0/pebble/__init__.py 2022-09-12 20:39:06.000000000 +0200 +++ new/Pebble-5.0.1/pebble/__init__.py 2022-10-05 22:49:03.000000000 +0200 @@ -1,5 +1,5 @@ __author__ = 'Matteo Cafasso' -__version__ = '5.0.0' +__version__ = '5.0.1' __license__ = 'LGPL' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/pebble/asynchronous/process.py new/Pebble-5.0.1/pebble/asynchronous/process.py --- old/Pebble-5.0.0/pebble/asynchronous/process.py 2022-09-10 17:03:22.000000000 +0200 +++ new/Pebble-5.0.1/pebble/asynchronous/process.py 2022-10-05 22:53:41.000000000 +0200 @@ -35,7 +35,7 @@ """Runs the decorated function in a concurrent process, taking care of the result and error management. - Decorated functions will return a concurrent.futures.Future object + Decorated functions will return an asyncio.Future object once called. The timeout parameter will set a maximum execution time @@ -118,6 +118,9 @@ """ result = await _get_result(future, pipe, timeout) + if worker.is_alive(): + stop_process(worker) + if isinstance(result, BaseException): if isinstance(result, ProcessExpired): result.exitcode = worker.exitcode @@ -126,9 +129,6 @@ else: future.set_result(result) - if worker.is_alive(): - stop_process(worker) - async def _get_result(future, pipe, timeout): """Waits for result and handles communication errors.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/pebble/asynchronous/thread.py new/Pebble-5.0.1/pebble/asynchronous/thread.py --- old/Pebble-5.0.0/pebble/asynchronous/thread.py 2022-09-10 17:03:22.000000000 +0200 +++ new/Pebble-5.0.1/pebble/asynchronous/thread.py 2022-10-05 22:53:41.000000000 +0200 @@ -26,7 +26,7 @@ """Runs the decorated function within a concurrent thread, taking care of the result and error management. - Decorated functions will return a concurrent.futures.Future object + Decorated functions will return an asyncio.Future object once called. The name parameter will set the thread name. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/pebble/concurrent/process.py new/Pebble-5.0.1/pebble/concurrent/process.py --- old/Pebble-5.0.0/pebble/concurrent/process.py 2022-09-11 13:19:59.000000000 +0200 +++ new/Pebble-5.0.1/pebble/concurrent/process.py 2022-10-01 11:50:08.000000000 +0200 @@ -118,6 +118,9 @@ """ result = _get_result(future, pipe, timeout) + if worker.is_alive(): + stop_process(worker) + if isinstance(result, BaseException): if isinstance(result, ProcessExpired): result.exitcode = worker.exitcode @@ -126,9 +129,6 @@ else: future.set_result(result) - if worker.is_alive(): - stop_process(worker) - def _function_handler(function, args, kwargs, pipe): """Runs the actual function in separate process and returns its result.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Pebble-5.0.0/pebble/pool/process.py new/Pebble-5.0.1/pebble/pool/process.py --- old/Pebble-5.0.0/pebble/pool/process.py 2022-09-11 20:09:31.000000000 +0200 +++ new/Pebble-5.0.1/pebble/pool/process.py 2022-10-01 11:49:41.000000000 +0200 @@ -243,14 +243,14 @@ def update_tasks(self): """Handles timing out Tasks.""" for task in self.task_manager.timeout_tasks(): + self.worker_manager.stop_worker(task.worker_id) self.task_manager.task_done( task.id, TimeoutError("Task timeout", task.timeout)) - self.worker_manager.stop_worker(task.worker_id) for task in self.task_manager.cancelled_tasks(): + self.worker_manager.stop_worker(task.worker_id) self.task_manager.task_done( task.id, CancelledError()) - self.worker_manager.stop_worker(task.worker_id) def update_workers(self): """Handles unexpected processes termination."""