Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-crochet for openSUSE:Factory checked in at 2023-07-12 17:27:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-crochet (Old) and /work/SRC/openSUSE:Factory/.python-crochet.new.8922 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-crochet" Wed Jul 12 17:27:25 2023 rev:3 rq:1098213 version:2.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-crochet/python-crochet.changes 2021-05-11 23:04:27.324876936 +0200 +++ /work/SRC/openSUSE:Factory/.python-crochet.new.8922/python-crochet.changes 2023-07-12 17:27:51.518713508 +0200 @@ -1,0 +2,13 @@ +Tue Jul 11 14:21:43 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 2.1.1: + * It's possible to decorate ``async/await`` Twisted functions + with ``@wait_for`` and ``@run_in_reactor`` + * Added type hints, thanks to Merlin Davis. + * Added formal support for Python 3.9. + * Dropped the deprecated APIs ``@wait_for_reactor``, + ``@in_reactor``, ``DeferredResult``, the ``wrapped_function`` + attribute, and unlimited timeouts on ``EventualResult.wait()``. + * Dropped support for Python 2.7 and 3.5. + +------------------------------------------------------------------- Old: ---- crochet-2.0.0.tar.gz New: ---- crochet-2.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-crochet.spec ++++++ --- /var/tmp/diff_new_pack.YUWBYN/_old 2023-07-12 17:27:52.114717634 +0200 +++ /var/tmp/diff_new_pack.YUWBYN/_new 2023-07-12 17:27:52.118717662 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-crochet # -# Copyright (c) 2020 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 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-crochet -Version: 2.0.0 +Version: 2.1.1 Release: 0 Summary: Use Twisted from any applications License: MIT ++++++ crochet-2.0.0.tar.gz -> crochet-2.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/PKG-INFO new/crochet-2.1.1/PKG-INFO --- old/crochet-2.0.0/PKG-INFO 2021-05-10 22:34:43.542455400 +0200 +++ new/crochet-2.1.1/PKG-INFO 2023-07-01 22:54:22.325390000 +0200 @@ -1,328 +1,333 @@ -Metadata-Version: 1.2 +Metadata-Version: 2.1 Name: crochet -Version: 2.0.0 +Version: 2.1.1 Summary: Use Twisted anywhere! Home-page: https://github.com/itamarst/crochet Maintainer: Itamar Turner-Trauring Maintainer-email: ita...@itamarst.org License: MIT -Description: Crochet: Use Twisted anywhere! - ============================== - - Crochet is an MIT-licensed library that makes it easier to use Twisted from - regular blocking code. Some use cases include: - - * Easily use Twisted from a blocking framework like Django or Flask. - * Write a library that provides a blocking API, but uses Twisted for its - implementation. - * Port blocking code to Twisted more easily, by keeping a backwards - compatibility layer. - * Allow normal Twisted programs that use threads to interact with Twisted more - cleanly from their threaded parts. For example, this can be useful when using - Twisted as a `WSGI container`_. - - .. _WSGI container: https://twistedmatrix.com/documents/current/web/howto/web-in-60/wsgi.html - - Crochet is maintained by Itamar Turner-Trauring. - - **Note:** Crochet development is pretty slow these days because mostly it **Just Works**. PyPI shows about 30,000 downloads a month, so existing users seem happy: https://pypistats.org/packages/crochet - - You can install Crochet by running:: - - $ pip install crochet - - Downloads are available on `PyPI`_. - - Documentation can be found on `Read The Docs`_. - - Bugs and feature requests should be filed at the project `Github page`_. - - .. _Read the Docs: https://crochet.readthedocs.org/ - .. _Github page: https://github.com/itamarst/crochet/ - .. _PyPI: https://pypi.python.org/pypi/crochet - - - API and features - ================ - - Crochet supports Python 3.6, 3.7, 3.8, and 3.9 as well as PyPy3. - Python 2.7 and 3.5 support is available in older releases. - - Crochet provides the following basic APIs: - - * Allow blocking code to call into Twisted and block until results are available - or a timeout is hit, using the ``crochet.wait_for`` decorator. - * A lower-level API (``crochet.run_in_reactor``) allows blocking code to run - code "in the background" in the Twisted thread, with the ability to repeatedly - check if it's done. - - Crochet will do the following on your behalf in order to enable these APIs: - - * Transparently start Twisted's reactor in a thread it manages. - * Shut down the reactor automatically when the process' main thread finishes. - * Hook up Twisted's log system to the Python standard library ``logging`` - framework. Unlike Twisted's built-in ``logging`` bridge, this includes - support for blocking `Handler` instances. - - What's New - ========== - - 2.0.0 - ^^^^^ - - New features: - - * It's possible to decorate ``async/await`` Twisted functions with ``@wait_for`` and ``@run_in_reactor``, thanks to Ãrni Már Jónsson. - * Added type hints, thanks to Merlin Davis. - * Added formal support for Python 3.9. - - - Removed features: - - * Dropped the deprecated APIs ``@wait_for_reactor``, ``@in_reactor``, ``DeferredResult``, the ``wrapped_function`` attribute, and unlimited timeouts on ``EventualResult.wait()``. - * Dropped support for Python 2.7 and 3.5. - - 1.12.0 - ^^^^^^ - - Bug fixes: - - * Fix a timeout overflow bug in 32-bit machines. - - - 1.11.0 - ^^^^^^ - - New features: - - * Added support for Python 3.8 and PyPy 3. - - Backwards incompatibility: - - * Dropped support for Python 3.4, since latest Twisted doesn't support it. - - 1.10.0 - ^^^^^^ - - New features: - - * Added support for Python 3.7. Thanks to Jeremy Cline for the patch. - - 1.9.0 - ^^^^^ - - New features: - - * The underlying callable wrapped ``@run_in_reactor`` and ``@wait_for`` is now available via the more standard ``__wrapped__`` attribute. - - Backwards incompatibility (in tests): - - * This was actually introduced in 1.8.0: ``wrapped_function`` may not always be available on decorated callables. - You should use ``__wrapped__`` instead. - - Bug fixes: - - * Fixed regression in 1.8.0 where bound method couldn't be wrapped. - Thanks to 2mf for the bug report. - - 1.8.0 - ^^^^^ - - New features: - - * Signatures on decorated functions now match the original functions. - Thanks to Mikhail Terekhov for the original patch. - * Documentation improvements, including an API reference. - - Bug fixes: - - * Switched to EPoll reactor for logging thread. - Anecdotal evidence suggests this fixes some issues on AWS Lambda, but it's not clear why. - Thanks to Rolando Espinoza for the patch. - * It's now possible to call ``@run_in_reactor`` and ``@wait_for`` above a ``@classmethod``. - Thanks to vak for the bug report. - - 1.7.0 - ^^^^^ - - Bug fixes: - - * If the Python ``logging.Handler`` throws an exception Crochet no longer goes into a death spiral. - Thanks to Michael Schlenker for the bug report. - - Removed features: - - * Versions of Twisted < 16.0 are no longer supported (i.e. no longer tested in CI.) - - 1.6.0 - ^^^^^ - - New features: - - * Added support for Python 3.6. - - 1.5.0 - ^^^^^ - - New features: - - * Added support for Python 3.5. - - Removed features: - - * Python 2.6, Python 3.3, and versions of Twisted < 15.0 are no longer supported. - - 1.4.0 - ^^^^^ - - New features: - - * Added support for Python 3.4. - - Documentation: - - * Added a section on known issues and workarounds. - - Bug fixes: - - * Main thread detection (used to determine when Crochet should shutdown) is now less fragile. - This means Crochet now supports more environments, e.g. uWSGI. - Thanks to Ben Picolo for the patch. - - 1.3.0 - ^^^^^ - - Bug fixes: - - * It is now possible to call ``EventualResult.wait()`` (or functions - wrapped in ``wait_for``) at import time if another thread holds the - import lock. Thanks to Ken Struys for the patch. - - 1.2.0 - ^^^^^ - New features: - - * ``crochet.wait_for`` implements the timeout/cancellation pattern documented - in previous versions of Crochet. ``crochet.wait_for_reactor`` and - ``EventualResult.wait(timeout=None)`` are now deprecated, since lacking - timeouts they could potentially block forever. - * Functions wrapped with ``wait_for`` and ``run_in_reactor`` can now be accessed - via the ``wrapped_function`` attribute, to ease unit testing of the underlying - Twisted code. - - API changes: - - * It is no longer possible to call ``EventualResult.wait()`` (or functions - wrapped with ``wait_for``) at import time, since this can lead to deadlocks - or prevent other threads from importing. Thanks to Tom Prince for the bug - report. - - Bug fixes: - - * ``warnings`` are no longer erroneously turned into Twisted log messages. - * The reactor is now only imported when ``crochet.setup()`` or - ``crochet.no_setup()`` are called, allowing daemonization if only ``crochet`` - is imported (http://tm.tl/7105). Thanks to Daniel Nephin for the bug report. - - Documentation: - - * Improved motivation, added contact info and news to the documentation. - * Better example of using Crochet from a normal Twisted application. - - 1.1.0 - ^^^^^ - Bug fixes: - - * ``EventualResult.wait()`` can now be used safely from multiple threads, - thanks to Gavin Panella for reporting the bug. - * Fixed reentrancy deadlock in the logging code caused by - http://bugs.python.org/issue14976, thanks to Rod Morehead for reporting the - bug. - * Crochet now installs on Python 3.3 again, thanks to Ben Cordero. - * Crochet should now work on Windows, thanks to Konstantinos Koukopoulos. - * Crochet tests can now run without adding its absolute path to PYTHONPATH or - installing it first. - - Documentation: - - * ``EventualResult.original_failure`` is now documented. - - 1.0.0 - ^^^^^ - Documentation: - - * Added section on use cases and alternatives. Thanks to Tobias Oberstein for - the suggestion. - - Bug fixes: - - * Twisted does not have to be pre-installed to run ``setup.py``, thanks to - Paul Weaver for bug report and Chris Scutcher for patch. - * Importing Crochet does not have side-effects (installing reactor event) - any more. - * Blocking calls are interrupted earlier in the shutdown process, to reduce - scope for deadlocks. Thanks to rmorehead for bug report. - - 0.9.0 - ^^^^^ - New features: - - * Expanded and much improved documentation, including a new section with - design suggestions. - * New decorator ``@wait_for_reactor`` added, a simpler alternative to - ``@run_in_reactor``. - * Refactored ``@run_in_reactor``, making it a bit more responsive. - * Blocking operations which would otherwise never finish due to reactor having - stopped (``EventualResult.wait()`` or ``@wait_for_reactor`` decorated call) - will be interrupted with a ``ReactorStopped`` exception. Thanks to rmorehead - for the bug report. - - Bug fixes: - - * ``@run_in_reactor`` decorated functions (or rather, their generated wrapper) - are interrupted by Ctrl-C. - * On POSIX platforms, a workaround is installed to ensure processes started by - `reactor.spawnProcess` have their exit noticed. See `Twisted ticket 6378`_ - for more details about the underlying issue. - - .. _Twisted ticket 6378: http://tm.tl/6738 - - 0.8.1 - ^^^^^ - * ``EventualResult.wait()`` now raises error if called in the reactor thread, - thanks to David Buchmann. - * Unittests are now included in the release tarball. - * Allow Ctrl-C to interrupt ``EventualResult.wait(timeout=None)``. - - 0.7.0 - ^^^^^ - * Improved documentation. - - 0.6.0 - ^^^^^ - * Renamed ``DeferredResult`` to ``EventualResult``, to reduce confusion with - Twisted's ``Deferred`` class. The old name still works, but is deprecated. - * Deprecated ``@in_reactor``, replaced with ``@run_in_reactor`` which doesn't - change the arguments to the wrapped function. The deprecated API still works, - however. - * Unhandled exceptions in ``EventualResult`` objects are logged. - * Added more examples. - * ``setup.py sdist`` should work now. - - 0.5.0 - ^^^^^ - * Initial release. - Keywords: twisted threading -Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: >=3.6.0 +Requires-Python: >=3.8.0 +License-File: LICENSE + +Crochet: Use Twisted anywhere! +============================== + +Crochet is an MIT-licensed library that makes it easier to use Twisted from +regular blocking code. Some use cases include: + +* Easily use Twisted from a blocking framework like Django or Flask. +* Write a library that provides a blocking API, but uses Twisted for its + implementation. +* Port blocking code to Twisted more easily, by keeping a backwards + compatibility layer. +* Allow normal Twisted programs that use threads to interact with Twisted more + cleanly from their threaded parts. For example, this can be useful when using + Twisted as a `WSGI container`_. + +.. _WSGI container: https://twistedmatrix.com/documents/current/web/howto/web-in-60/wsgi.html + +Crochet is maintained by Itamar Turner-Trauring. + + **Note:** Crochet development is pretty slow these days because mostly it **Just Works**. PyPI shows about 30,000 downloads a month, so existing users seem happy: https://pypistats.org/packages/crochet + +You can install Crochet by running:: + + $ pip install crochet + +Downloads are available on `PyPI`_. + +Documentation can be found on `Read The Docs`_. + +Bugs and feature requests should be filed at the project `Github page`_. + +.. _Read the Docs: https://crochet.readthedocs.org/ +.. _Github page: https://github.com/itamarst/crochet/ +.. _PyPI: https://pypi.python.org/pypi/crochet + + +API and features +================ + +Crochet supports Python 3.8, 3.9, 3.10, and 3.11 as well as PyPy3. + +Crochet provides the following basic APIs: + +* Allow blocking code to call into Twisted and block until results are available + or a timeout is hit, using the ``crochet.wait_for`` decorator. +* A lower-level API (``crochet.run_in_reactor``) allows blocking code to run + code "in the background" in the Twisted thread, with the ability to repeatedly + check if it's done. + +Crochet will do the following on your behalf in order to enable these APIs: + +* Transparently start Twisted's reactor in a thread it manages. +* Shut down the reactor automatically when the process' main thread finishes. +* Hook up Twisted's log system to the Python standard library ``logging`` + framework. Unlike Twisted's built-in ``logging`` bridge, this includes + support for blocking `Handler` instances. + +What's New +========== + +2.1.0 +^^^^^ + +* Various internal modernizations and maintenance. +* Dropped Python 3.6 and 3.7 support. + +2.0.0 +^^^^^ + +New features: + +* It's possible to decorate ``async/await`` Twisted functions with ``@wait_for`` and ``@run_in_reactor``, thanks to Ãrni Már Jónsson. +* Added type hints, thanks to Merlin Davis. +* Added formal support for Python 3.9. + + +Removed features: + +* Dropped the deprecated APIs ``@wait_for_reactor``, ``@in_reactor``, ``DeferredResult``, the ``wrapped_function`` attribute, and unlimited timeouts on ``EventualResult.wait()``. +* Dropped support for Python 2.7 and 3.5. + +1.12.0 +^^^^^^ + +Bug fixes: + +* Fix a timeout overflow bug in 32-bit machines. + + +1.11.0 +^^^^^^ + +New features: + +* Added support for Python 3.8 and PyPy 3. + +Backwards incompatibility: + +* Dropped support for Python 3.4, since latest Twisted doesn't support it. + +1.10.0 +^^^^^^ + +New features: + +* Added support for Python 3.7. Thanks to Jeremy Cline for the patch. + +1.9.0 +^^^^^ + +New features: + +* The underlying callable wrapped ``@run_in_reactor`` and ``@wait_for`` is now available via the more standard ``__wrapped__`` attribute. + +Backwards incompatibility (in tests): + +* This was actually introduced in 1.8.0: ``wrapped_function`` may not always be available on decorated callables. + You should use ``__wrapped__`` instead. + +Bug fixes: + +* Fixed regression in 1.8.0 where bound method couldn't be wrapped. + Thanks to 2mf for the bug report. + +1.8.0 +^^^^^ + +New features: + +* Signatures on decorated functions now match the original functions. + Thanks to Mikhail Terekhov for the original patch. +* Documentation improvements, including an API reference. + +Bug fixes: + +* Switched to EPoll reactor for logging thread. + Anecdotal evidence suggests this fixes some issues on AWS Lambda, but it's not clear why. + Thanks to Rolando Espinoza for the patch. +* It's now possible to call ``@run_in_reactor`` and ``@wait_for`` above a ``@classmethod``. + Thanks to vak for the bug report. + +1.7.0 +^^^^^ + +Bug fixes: + +* If the Python ``logging.Handler`` throws an exception Crochet no longer goes into a death spiral. + Thanks to Michael Schlenker for the bug report. + +Removed features: + +* Versions of Twisted < 16.0 are no longer supported (i.e. no longer tested in CI.) + +1.6.0 +^^^^^ + +New features: + +* Added support for Python 3.6. + +1.5.0 +^^^^^ + +New features: + +* Added support for Python 3.5. + +Removed features: + +* Python 2.6, Python 3.3, and versions of Twisted < 15.0 are no longer supported. + +1.4.0 +^^^^^ + +New features: + +* Added support for Python 3.4. + +Documentation: + +* Added a section on known issues and workarounds. + +Bug fixes: + +* Main thread detection (used to determine when Crochet should shutdown) is now less fragile. + This means Crochet now supports more environments, e.g. uWSGI. + Thanks to Ben Picolo for the patch. + +1.3.0 +^^^^^ + +Bug fixes: + +* It is now possible to call ``EventualResult.wait()`` (or functions + wrapped in ``wait_for``) at import time if another thread holds the + import lock. Thanks to Ken Struys for the patch. + +1.2.0 +^^^^^ +New features: + +* ``crochet.wait_for`` implements the timeout/cancellation pattern documented + in previous versions of Crochet. ``crochet.wait_for_reactor`` and + ``EventualResult.wait(timeout=None)`` are now deprecated, since lacking + timeouts they could potentially block forever. +* Functions wrapped with ``wait_for`` and ``run_in_reactor`` can now be accessed + via the ``wrapped_function`` attribute, to ease unit testing of the underlying + Twisted code. + +API changes: + +* It is no longer possible to call ``EventualResult.wait()`` (or functions + wrapped with ``wait_for``) at import time, since this can lead to deadlocks + or prevent other threads from importing. Thanks to Tom Prince for the bug + report. + +Bug fixes: + +* ``warnings`` are no longer erroneously turned into Twisted log messages. +* The reactor is now only imported when ``crochet.setup()`` or + ``crochet.no_setup()`` are called, allowing daemonization if only ``crochet`` + is imported (http://tm.tl/7105). Thanks to Daniel Nephin for the bug report. + +Documentation: + +* Improved motivation, added contact info and news to the documentation. +* Better example of using Crochet from a normal Twisted application. + +1.1.0 +^^^^^ +Bug fixes: + +* ``EventualResult.wait()`` can now be used safely from multiple threads, + thanks to Gavin Panella for reporting the bug. +* Fixed reentrancy deadlock in the logging code caused by + http://bugs.python.org/issue14976, thanks to Rod Morehead for reporting the + bug. +* Crochet now installs on Python 3.3 again, thanks to Ben Cordero. +* Crochet should now work on Windows, thanks to Konstantinos Koukopoulos. +* Crochet tests can now run without adding its absolute path to PYTHONPATH or + installing it first. + +Documentation: + +* ``EventualResult.original_failure`` is now documented. + +1.0.0 +^^^^^ +Documentation: + +* Added section on use cases and alternatives. Thanks to Tobias Oberstein for + the suggestion. + +Bug fixes: + +* Twisted does not have to be pre-installed to run ``setup.py``, thanks to + Paul Weaver for bug report and Chris Scutcher for patch. +* Importing Crochet does not have side-effects (installing reactor event) + any more. +* Blocking calls are interrupted earlier in the shutdown process, to reduce + scope for deadlocks. Thanks to rmorehead for bug report. + +0.9.0 +^^^^^ +New features: + +* Expanded and much improved documentation, including a new section with + design suggestions. +* New decorator ``@wait_for_reactor`` added, a simpler alternative to + ``@run_in_reactor``. +* Refactored ``@run_in_reactor``, making it a bit more responsive. +* Blocking operations which would otherwise never finish due to reactor having + stopped (``EventualResult.wait()`` or ``@wait_for_reactor`` decorated call) + will be interrupted with a ``ReactorStopped`` exception. Thanks to rmorehead + for the bug report. + +Bug fixes: + +* ``@run_in_reactor`` decorated functions (or rather, their generated wrapper) + are interrupted by Ctrl-C. +* On POSIX platforms, a workaround is installed to ensure processes started by + `reactor.spawnProcess` have their exit noticed. See `Twisted ticket 6378`_ + for more details about the underlying issue. + +.. _Twisted ticket 6378: http://tm.tl/6738 + +0.8.1 +^^^^^ +* ``EventualResult.wait()`` now raises error if called in the reactor thread, + thanks to David Buchmann. +* Unittests are now included in the release tarball. +* Allow Ctrl-C to interrupt ``EventualResult.wait(timeout=None)``. + +0.7.0 +^^^^^ +* Improved documentation. + +0.6.0 +^^^^^ +* Renamed ``DeferredResult`` to ``EventualResult``, to reduce confusion with + Twisted's ``Deferred`` class. The old name still works, but is deprecated. +* Deprecated ``@in_reactor``, replaced with ``@run_in_reactor`` which doesn't + change the arguments to the wrapped function. The deprecated API still works, + however. +* Unhandled exceptions in ``EventualResult`` objects are logged. +* Added more examples. +* ``setup.py sdist`` should work now. + +0.5.0 +^^^^^ +* Initial release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/README.rst new/crochet-2.1.1/README.rst --- old/crochet-2.0.0/README.rst 2021-05-10 22:34:24.000000000 +0200 +++ new/crochet-2.1.1/README.rst 2023-07-01 22:54:17.000000000 +0200 @@ -37,8 +37,7 @@ API and features ================ -Crochet supports Python 3.6, 3.7, 3.8, and 3.9 as well as PyPy3. -Python 2.7 and 3.5 support is available in older releases. +Crochet supports Python 3.8, 3.9, 3.10, and 3.11 as well as PyPy3. Crochet provides the following basic APIs: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/crochet/_eventloop.py new/crochet-2.1.1/crochet/_eventloop.py --- old/crochet-2.0.0/crochet/_eventloop.py 2021-05-10 22:34:24.000000000 +0200 +++ new/crochet-2.1.1/crochet/_eventloop.py 2023-07-01 22:54:17.000000000 +0200 @@ -2,14 +2,12 @@ Expose Twisted's event loop to threaded programs. """ -from __future__ import absolute_import - -import select import threading import weakref import warnings from inspect import iscoroutinefunction from functools import wraps +from queue import SimpleQueue from twisted.python import threadable from twisted.python.runtime import platform @@ -227,30 +225,20 @@ return None +_STOP = object() + + class ThreadLogObserver(object): """ A log observer that wraps another observer, and calls it in a thread. In particular, used to wrap PythonLoggingObserver, so that blocking logging.py Handlers don't block the event loop. - - Once Python 3.6 support is dropped, this can use a queue.SimpleQueue object - instead of a whole 'nother event loop. """ def __init__(self, observer): self._observer = observer - if getattr(select, "epoll", None): - from twisted.internet.epollreactor import EPollReactor - reactorFactory = EPollReactor - elif getattr(select, "poll", None): - from twisted.internet.pollreactor import PollReactor - reactorFactory = PollReactor - else: - from twisted.internet.selectreactor import SelectReactor - reactorFactory = SelectReactor - self._logWritingReactor = reactorFactory() - self._logWritingReactor._registerAsIOThread = False + self._queue = SimpleQueue() self._thread = threading.Thread( target=self._reader, name="CrochetLogWriter") self._thread.start() @@ -260,28 +248,28 @@ Runs in a thread, reads messages from a queue and writes them to the wrapped observer. """ - self._logWritingReactor.run(installSignalHandlers=False) + while True: + msg = self._queue.get() + if msg is _STOP: + return + try: + self._observer(msg) + except Exception: + # Lower-level logging system blew up, nothing we can do, so + # just drop on the floor. + pass def stop(self): """ Stop the thread. """ - self._logWritingReactor.callFromThread(self._logWritingReactor.stop) + self._queue.put(_STOP) def __call__(self, msg): """ A log observer that writes to a queue. """ - - def log(): - try: - self._observer(msg) - except Exception: - # Lower-level logging system blew up, nothing we can do, so - # just drop on the floor. - pass - - self._logWritingReactor.callFromThread(log) + self._queue.put(msg) class EventLoop(object): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/crochet/_version.py new/crochet-2.1.1/crochet/_version.py --- old/crochet-2.0.0/crochet/_version.py 2021-05-10 22:34:43.542455400 +0200 +++ new/crochet-2.1.1/crochet/_version.py 2023-07-01 22:54:22.325390000 +0200 @@ -11,8 +11,8 @@ { "dirty": false, "error": null, - "full-revisionid": "d03b0ea69de77e74000452bdaf499557f5cece01", - "version": "2.0.0" + "full-revisionid": "9ca30d02f4dc2376545aea14cbed52fc7880c6ba", + "version": "2.1.1" } ''' # END VERSION_JSON diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/crochet/tests/test_api.py new/crochet-2.1.1/crochet/tests/test_api.py --- old/crochet-2.0.0/crochet/tests/test_api.py 2021-05-10 22:34:24.000000000 +0200 +++ new/crochet-2.1.1/crochet/tests/test_api.py 2023-07-01 22:54:17.000000000 +0200 @@ -12,7 +12,6 @@ import weakref import tempfile import os -import imp import inspect from unittest import SkipTest @@ -26,7 +25,7 @@ EventLoop, EventualResult, TimeoutError, ResultRegistry, ReactorStopped) from .test_setup import FakeReactor from .. import ( - _main, setup, retrieve_result, _store, no_setup, + _main, setup as setup_crochet, retrieve_result, _store, no_setup, run_in_reactor, wait_for) from ..tests import crochet_directory @@ -207,7 +206,8 @@ start = time.time() dr = EventualResult(Deferred(), None) self.assertRaises(TimeoutError, dr.wait, timeout=0.03) - self.assertTrue(abs(time.time() - start - 0.03) < 0.005) + # be a little lenient for slow computers: + self.assertTrue(abs(time.time() - start) < 0.05) def test_timeout_twice(self): """ @@ -525,50 +525,6 @@ """) self.assertRaises(RuntimeError, __import__, "shouldbeunimportable") - def test_waiting_during_different_thread_importing(self): - """ - EventualResult.wait() should work if called while a module is - being imported in a different thread. See - EventualResultTests.test_noWaitingDuringImport for the explanation of - what should happen if an import is happening in the current thread. - """ - test_complete = threading.Event() - lock_held = threading.Event() - er = EventualResult(succeed(123), None) - - def other_thread(): - imp.acquire_lock() - lock_held.set() - test_complete.wait() - imp.release_lock() - - t = threading.Thread(target=other_thread) - t.start() - lock_held.wait() - - # While the imp lock is held by the other thread, we can't - # allow exceptions/assertions to happen because trial will - # try to do an import causing a deadlock instead of a - # failure. We collect all assertion pairs (result, expected), - # wait for the import lock to be released, and then check our - # assertions at the end of the test. - assertions = [] - - # we want to run .wait while the other thread has the lock acquired - assertions.append((imp.lock_held(), True)) - try: - assertions.append((er.wait(0.1), 123)) - finally: - test_complete.set() - - assertions.append((imp.lock_held(), True)) - - test_complete.set() - - t.join() - - [self.assertEqual(result, expected) for result, expected in assertions] - class RunInReactorTests(TestCase): """ @@ -1100,7 +1056,7 @@ from twisted.python.log import startLoggingWithObserver from crochet import _shutdown self.assertIsInstance(_main, EventLoop) - self.assertEqual(_main.setup, setup) + self.assertEqual(_main.setup, setup_crochet) self.assertEqual(_main.no_setup, no_setup) self.assertEqual(_main.run_in_reactor, run_in_reactor) self.assertEqual(_main.wait_for, wait_for) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/crochet/tests/test_setup.py new/crochet-2.1.1/crochet/tests/test_setup.py --- old/crochet-2.0.0/crochet/tests/test_setup.py 2021-05-10 22:34:24.000000000 +0200 +++ new/crochet-2.1.1/crochet/tests/test_setup.py 2023-07-01 22:54:17.000000000 +0200 @@ -258,11 +258,11 @@ reapAllProcesses=lambda: reaps.append(1)) s.setup() reactor.advance(0.1) - self.assertEquals(reaps, [1]) + self.assertEqual(reaps, [1]) reactor.advance(0.1) - self.assertEquals(reaps, [1, 1]) + self.assertEqual(reaps, [1, 1]) reactor.advance(0.1) - self.assertEquals(reaps, [1, 1, 1]) + self.assertEqual(reaps, [1, 1, 1]) def test_non_posix(self): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/crochet.egg-info/PKG-INFO new/crochet-2.1.1/crochet.egg-info/PKG-INFO --- old/crochet-2.0.0/crochet.egg-info/PKG-INFO 2021-05-10 22:34:43.000000000 +0200 +++ new/crochet-2.1.1/crochet.egg-info/PKG-INFO 2023-07-01 22:54:22.000000000 +0200 @@ -1,328 +1,333 @@ -Metadata-Version: 1.2 +Metadata-Version: 2.1 Name: crochet -Version: 2.0.0 +Version: 2.1.1 Summary: Use Twisted anywhere! Home-page: https://github.com/itamarst/crochet Maintainer: Itamar Turner-Trauring Maintainer-email: ita...@itamarst.org License: MIT -Description: Crochet: Use Twisted anywhere! - ============================== - - Crochet is an MIT-licensed library that makes it easier to use Twisted from - regular blocking code. Some use cases include: - - * Easily use Twisted from a blocking framework like Django or Flask. - * Write a library that provides a blocking API, but uses Twisted for its - implementation. - * Port blocking code to Twisted more easily, by keeping a backwards - compatibility layer. - * Allow normal Twisted programs that use threads to interact with Twisted more - cleanly from their threaded parts. For example, this can be useful when using - Twisted as a `WSGI container`_. - - .. _WSGI container: https://twistedmatrix.com/documents/current/web/howto/web-in-60/wsgi.html - - Crochet is maintained by Itamar Turner-Trauring. - - **Note:** Crochet development is pretty slow these days because mostly it **Just Works**. PyPI shows about 30,000 downloads a month, so existing users seem happy: https://pypistats.org/packages/crochet - - You can install Crochet by running:: - - $ pip install crochet - - Downloads are available on `PyPI`_. - - Documentation can be found on `Read The Docs`_. - - Bugs and feature requests should be filed at the project `Github page`_. - - .. _Read the Docs: https://crochet.readthedocs.org/ - .. _Github page: https://github.com/itamarst/crochet/ - .. _PyPI: https://pypi.python.org/pypi/crochet - - - API and features - ================ - - Crochet supports Python 3.6, 3.7, 3.8, and 3.9 as well as PyPy3. - Python 2.7 and 3.5 support is available in older releases. - - Crochet provides the following basic APIs: - - * Allow blocking code to call into Twisted and block until results are available - or a timeout is hit, using the ``crochet.wait_for`` decorator. - * A lower-level API (``crochet.run_in_reactor``) allows blocking code to run - code "in the background" in the Twisted thread, with the ability to repeatedly - check if it's done. - - Crochet will do the following on your behalf in order to enable these APIs: - - * Transparently start Twisted's reactor in a thread it manages. - * Shut down the reactor automatically when the process' main thread finishes. - * Hook up Twisted's log system to the Python standard library ``logging`` - framework. Unlike Twisted's built-in ``logging`` bridge, this includes - support for blocking `Handler` instances. - - What's New - ========== - - 2.0.0 - ^^^^^ - - New features: - - * It's possible to decorate ``async/await`` Twisted functions with ``@wait_for`` and ``@run_in_reactor``, thanks to Ãrni Már Jónsson. - * Added type hints, thanks to Merlin Davis. - * Added formal support for Python 3.9. - - - Removed features: - - * Dropped the deprecated APIs ``@wait_for_reactor``, ``@in_reactor``, ``DeferredResult``, the ``wrapped_function`` attribute, and unlimited timeouts on ``EventualResult.wait()``. - * Dropped support for Python 2.7 and 3.5. - - 1.12.0 - ^^^^^^ - - Bug fixes: - - * Fix a timeout overflow bug in 32-bit machines. - - - 1.11.0 - ^^^^^^ - - New features: - - * Added support for Python 3.8 and PyPy 3. - - Backwards incompatibility: - - * Dropped support for Python 3.4, since latest Twisted doesn't support it. - - 1.10.0 - ^^^^^^ - - New features: - - * Added support for Python 3.7. Thanks to Jeremy Cline for the patch. - - 1.9.0 - ^^^^^ - - New features: - - * The underlying callable wrapped ``@run_in_reactor`` and ``@wait_for`` is now available via the more standard ``__wrapped__`` attribute. - - Backwards incompatibility (in tests): - - * This was actually introduced in 1.8.0: ``wrapped_function`` may not always be available on decorated callables. - You should use ``__wrapped__`` instead. - - Bug fixes: - - * Fixed regression in 1.8.0 where bound method couldn't be wrapped. - Thanks to 2mf for the bug report. - - 1.8.0 - ^^^^^ - - New features: - - * Signatures on decorated functions now match the original functions. - Thanks to Mikhail Terekhov for the original patch. - * Documentation improvements, including an API reference. - - Bug fixes: - - * Switched to EPoll reactor for logging thread. - Anecdotal evidence suggests this fixes some issues on AWS Lambda, but it's not clear why. - Thanks to Rolando Espinoza for the patch. - * It's now possible to call ``@run_in_reactor`` and ``@wait_for`` above a ``@classmethod``. - Thanks to vak for the bug report. - - 1.7.0 - ^^^^^ - - Bug fixes: - - * If the Python ``logging.Handler`` throws an exception Crochet no longer goes into a death spiral. - Thanks to Michael Schlenker for the bug report. - - Removed features: - - * Versions of Twisted < 16.0 are no longer supported (i.e. no longer tested in CI.) - - 1.6.0 - ^^^^^ - - New features: - - * Added support for Python 3.6. - - 1.5.0 - ^^^^^ - - New features: - - * Added support for Python 3.5. - - Removed features: - - * Python 2.6, Python 3.3, and versions of Twisted < 15.0 are no longer supported. - - 1.4.0 - ^^^^^ - - New features: - - * Added support for Python 3.4. - - Documentation: - - * Added a section on known issues and workarounds. - - Bug fixes: - - * Main thread detection (used to determine when Crochet should shutdown) is now less fragile. - This means Crochet now supports more environments, e.g. uWSGI. - Thanks to Ben Picolo for the patch. - - 1.3.0 - ^^^^^ - - Bug fixes: - - * It is now possible to call ``EventualResult.wait()`` (or functions - wrapped in ``wait_for``) at import time if another thread holds the - import lock. Thanks to Ken Struys for the patch. - - 1.2.0 - ^^^^^ - New features: - - * ``crochet.wait_for`` implements the timeout/cancellation pattern documented - in previous versions of Crochet. ``crochet.wait_for_reactor`` and - ``EventualResult.wait(timeout=None)`` are now deprecated, since lacking - timeouts they could potentially block forever. - * Functions wrapped with ``wait_for`` and ``run_in_reactor`` can now be accessed - via the ``wrapped_function`` attribute, to ease unit testing of the underlying - Twisted code. - - API changes: - - * It is no longer possible to call ``EventualResult.wait()`` (or functions - wrapped with ``wait_for``) at import time, since this can lead to deadlocks - or prevent other threads from importing. Thanks to Tom Prince for the bug - report. - - Bug fixes: - - * ``warnings`` are no longer erroneously turned into Twisted log messages. - * The reactor is now only imported when ``crochet.setup()`` or - ``crochet.no_setup()`` are called, allowing daemonization if only ``crochet`` - is imported (http://tm.tl/7105). Thanks to Daniel Nephin for the bug report. - - Documentation: - - * Improved motivation, added contact info and news to the documentation. - * Better example of using Crochet from a normal Twisted application. - - 1.1.0 - ^^^^^ - Bug fixes: - - * ``EventualResult.wait()`` can now be used safely from multiple threads, - thanks to Gavin Panella for reporting the bug. - * Fixed reentrancy deadlock in the logging code caused by - http://bugs.python.org/issue14976, thanks to Rod Morehead for reporting the - bug. - * Crochet now installs on Python 3.3 again, thanks to Ben Cordero. - * Crochet should now work on Windows, thanks to Konstantinos Koukopoulos. - * Crochet tests can now run without adding its absolute path to PYTHONPATH or - installing it first. - - Documentation: - - * ``EventualResult.original_failure`` is now documented. - - 1.0.0 - ^^^^^ - Documentation: - - * Added section on use cases and alternatives. Thanks to Tobias Oberstein for - the suggestion. - - Bug fixes: - - * Twisted does not have to be pre-installed to run ``setup.py``, thanks to - Paul Weaver for bug report and Chris Scutcher for patch. - * Importing Crochet does not have side-effects (installing reactor event) - any more. - * Blocking calls are interrupted earlier in the shutdown process, to reduce - scope for deadlocks. Thanks to rmorehead for bug report. - - 0.9.0 - ^^^^^ - New features: - - * Expanded and much improved documentation, including a new section with - design suggestions. - * New decorator ``@wait_for_reactor`` added, a simpler alternative to - ``@run_in_reactor``. - * Refactored ``@run_in_reactor``, making it a bit more responsive. - * Blocking operations which would otherwise never finish due to reactor having - stopped (``EventualResult.wait()`` or ``@wait_for_reactor`` decorated call) - will be interrupted with a ``ReactorStopped`` exception. Thanks to rmorehead - for the bug report. - - Bug fixes: - - * ``@run_in_reactor`` decorated functions (or rather, their generated wrapper) - are interrupted by Ctrl-C. - * On POSIX platforms, a workaround is installed to ensure processes started by - `reactor.spawnProcess` have their exit noticed. See `Twisted ticket 6378`_ - for more details about the underlying issue. - - .. _Twisted ticket 6378: http://tm.tl/6738 - - 0.8.1 - ^^^^^ - * ``EventualResult.wait()`` now raises error if called in the reactor thread, - thanks to David Buchmann. - * Unittests are now included in the release tarball. - * Allow Ctrl-C to interrupt ``EventualResult.wait(timeout=None)``. - - 0.7.0 - ^^^^^ - * Improved documentation. - - 0.6.0 - ^^^^^ - * Renamed ``DeferredResult`` to ``EventualResult``, to reduce confusion with - Twisted's ``Deferred`` class. The old name still works, but is deprecated. - * Deprecated ``@in_reactor``, replaced with ``@run_in_reactor`` which doesn't - change the arguments to the wrapped function. The deprecated API still works, - however. - * Unhandled exceptions in ``EventualResult`` objects are logged. - * Added more examples. - * ``setup.py sdist`` should work now. - - 0.5.0 - ^^^^^ - * Initial release. - Keywords: twisted threading -Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 3.6 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: >=3.6.0 +Requires-Python: >=3.8.0 +License-File: LICENSE + +Crochet: Use Twisted anywhere! +============================== + +Crochet is an MIT-licensed library that makes it easier to use Twisted from +regular blocking code. Some use cases include: + +* Easily use Twisted from a blocking framework like Django or Flask. +* Write a library that provides a blocking API, but uses Twisted for its + implementation. +* Port blocking code to Twisted more easily, by keeping a backwards + compatibility layer. +* Allow normal Twisted programs that use threads to interact with Twisted more + cleanly from their threaded parts. For example, this can be useful when using + Twisted as a `WSGI container`_. + +.. _WSGI container: https://twistedmatrix.com/documents/current/web/howto/web-in-60/wsgi.html + +Crochet is maintained by Itamar Turner-Trauring. + + **Note:** Crochet development is pretty slow these days because mostly it **Just Works**. PyPI shows about 30,000 downloads a month, so existing users seem happy: https://pypistats.org/packages/crochet + +You can install Crochet by running:: + + $ pip install crochet + +Downloads are available on `PyPI`_. + +Documentation can be found on `Read The Docs`_. + +Bugs and feature requests should be filed at the project `Github page`_. + +.. _Read the Docs: https://crochet.readthedocs.org/ +.. _Github page: https://github.com/itamarst/crochet/ +.. _PyPI: https://pypi.python.org/pypi/crochet + + +API and features +================ + +Crochet supports Python 3.8, 3.9, 3.10, and 3.11 as well as PyPy3. + +Crochet provides the following basic APIs: + +* Allow blocking code to call into Twisted and block until results are available + or a timeout is hit, using the ``crochet.wait_for`` decorator. +* A lower-level API (``crochet.run_in_reactor``) allows blocking code to run + code "in the background" in the Twisted thread, with the ability to repeatedly + check if it's done. + +Crochet will do the following on your behalf in order to enable these APIs: + +* Transparently start Twisted's reactor in a thread it manages. +* Shut down the reactor automatically when the process' main thread finishes. +* Hook up Twisted's log system to the Python standard library ``logging`` + framework. Unlike Twisted's built-in ``logging`` bridge, this includes + support for blocking `Handler` instances. + +What's New +========== + +2.1.0 +^^^^^ + +* Various internal modernizations and maintenance. +* Dropped Python 3.6 and 3.7 support. + +2.0.0 +^^^^^ + +New features: + +* It's possible to decorate ``async/await`` Twisted functions with ``@wait_for`` and ``@run_in_reactor``, thanks to Ãrni Már Jónsson. +* Added type hints, thanks to Merlin Davis. +* Added formal support for Python 3.9. + + +Removed features: + +* Dropped the deprecated APIs ``@wait_for_reactor``, ``@in_reactor``, ``DeferredResult``, the ``wrapped_function`` attribute, and unlimited timeouts on ``EventualResult.wait()``. +* Dropped support for Python 2.7 and 3.5. + +1.12.0 +^^^^^^ + +Bug fixes: + +* Fix a timeout overflow bug in 32-bit machines. + + +1.11.0 +^^^^^^ + +New features: + +* Added support for Python 3.8 and PyPy 3. + +Backwards incompatibility: + +* Dropped support for Python 3.4, since latest Twisted doesn't support it. + +1.10.0 +^^^^^^ + +New features: + +* Added support for Python 3.7. Thanks to Jeremy Cline for the patch. + +1.9.0 +^^^^^ + +New features: + +* The underlying callable wrapped ``@run_in_reactor`` and ``@wait_for`` is now available via the more standard ``__wrapped__`` attribute. + +Backwards incompatibility (in tests): + +* This was actually introduced in 1.8.0: ``wrapped_function`` may not always be available on decorated callables. + You should use ``__wrapped__`` instead. + +Bug fixes: + +* Fixed regression in 1.8.0 where bound method couldn't be wrapped. + Thanks to 2mf for the bug report. + +1.8.0 +^^^^^ + +New features: + +* Signatures on decorated functions now match the original functions. + Thanks to Mikhail Terekhov for the original patch. +* Documentation improvements, including an API reference. + +Bug fixes: + +* Switched to EPoll reactor for logging thread. + Anecdotal evidence suggests this fixes some issues on AWS Lambda, but it's not clear why. + Thanks to Rolando Espinoza for the patch. +* It's now possible to call ``@run_in_reactor`` and ``@wait_for`` above a ``@classmethod``. + Thanks to vak for the bug report. + +1.7.0 +^^^^^ + +Bug fixes: + +* If the Python ``logging.Handler`` throws an exception Crochet no longer goes into a death spiral. + Thanks to Michael Schlenker for the bug report. + +Removed features: + +* Versions of Twisted < 16.0 are no longer supported (i.e. no longer tested in CI.) + +1.6.0 +^^^^^ + +New features: + +* Added support for Python 3.6. + +1.5.0 +^^^^^ + +New features: + +* Added support for Python 3.5. + +Removed features: + +* Python 2.6, Python 3.3, and versions of Twisted < 15.0 are no longer supported. + +1.4.0 +^^^^^ + +New features: + +* Added support for Python 3.4. + +Documentation: + +* Added a section on known issues and workarounds. + +Bug fixes: + +* Main thread detection (used to determine when Crochet should shutdown) is now less fragile. + This means Crochet now supports more environments, e.g. uWSGI. + Thanks to Ben Picolo for the patch. + +1.3.0 +^^^^^ + +Bug fixes: + +* It is now possible to call ``EventualResult.wait()`` (or functions + wrapped in ``wait_for``) at import time if another thread holds the + import lock. Thanks to Ken Struys for the patch. + +1.2.0 +^^^^^ +New features: + +* ``crochet.wait_for`` implements the timeout/cancellation pattern documented + in previous versions of Crochet. ``crochet.wait_for_reactor`` and + ``EventualResult.wait(timeout=None)`` are now deprecated, since lacking + timeouts they could potentially block forever. +* Functions wrapped with ``wait_for`` and ``run_in_reactor`` can now be accessed + via the ``wrapped_function`` attribute, to ease unit testing of the underlying + Twisted code. + +API changes: + +* It is no longer possible to call ``EventualResult.wait()`` (or functions + wrapped with ``wait_for``) at import time, since this can lead to deadlocks + or prevent other threads from importing. Thanks to Tom Prince for the bug + report. + +Bug fixes: + +* ``warnings`` are no longer erroneously turned into Twisted log messages. +* The reactor is now only imported when ``crochet.setup()`` or + ``crochet.no_setup()`` are called, allowing daemonization if only ``crochet`` + is imported (http://tm.tl/7105). Thanks to Daniel Nephin for the bug report. + +Documentation: + +* Improved motivation, added contact info and news to the documentation. +* Better example of using Crochet from a normal Twisted application. + +1.1.0 +^^^^^ +Bug fixes: + +* ``EventualResult.wait()`` can now be used safely from multiple threads, + thanks to Gavin Panella for reporting the bug. +* Fixed reentrancy deadlock in the logging code caused by + http://bugs.python.org/issue14976, thanks to Rod Morehead for reporting the + bug. +* Crochet now installs on Python 3.3 again, thanks to Ben Cordero. +* Crochet should now work on Windows, thanks to Konstantinos Koukopoulos. +* Crochet tests can now run without adding its absolute path to PYTHONPATH or + installing it first. + +Documentation: + +* ``EventualResult.original_failure`` is now documented. + +1.0.0 +^^^^^ +Documentation: + +* Added section on use cases and alternatives. Thanks to Tobias Oberstein for + the suggestion. + +Bug fixes: + +* Twisted does not have to be pre-installed to run ``setup.py``, thanks to + Paul Weaver for bug report and Chris Scutcher for patch. +* Importing Crochet does not have side-effects (installing reactor event) + any more. +* Blocking calls are interrupted earlier in the shutdown process, to reduce + scope for deadlocks. Thanks to rmorehead for bug report. + +0.9.0 +^^^^^ +New features: + +* Expanded and much improved documentation, including a new section with + design suggestions. +* New decorator ``@wait_for_reactor`` added, a simpler alternative to + ``@run_in_reactor``. +* Refactored ``@run_in_reactor``, making it a bit more responsive. +* Blocking operations which would otherwise never finish due to reactor having + stopped (``EventualResult.wait()`` or ``@wait_for_reactor`` decorated call) + will be interrupted with a ``ReactorStopped`` exception. Thanks to rmorehead + for the bug report. + +Bug fixes: + +* ``@run_in_reactor`` decorated functions (or rather, their generated wrapper) + are interrupted by Ctrl-C. +* On POSIX platforms, a workaround is installed to ensure processes started by + `reactor.spawnProcess` have their exit noticed. See `Twisted ticket 6378`_ + for more details about the underlying issue. + +.. _Twisted ticket 6378: http://tm.tl/6738 + +0.8.1 +^^^^^ +* ``EventualResult.wait()`` now raises error if called in the reactor thread, + thanks to David Buchmann. +* Unittests are now included in the release tarball. +* Allow Ctrl-C to interrupt ``EventualResult.wait(timeout=None)``. + +0.7.0 +^^^^^ +* Improved documentation. + +0.6.0 +^^^^^ +* Renamed ``DeferredResult`` to ``EventualResult``, to reduce confusion with + Twisted's ``Deferred`` class. The old name still works, but is deprecated. +* Deprecated ``@in_reactor``, replaced with ``@run_in_reactor`` which doesn't + change the arguments to the wrapped function. The deprecated API still works, + however. +* Unhandled exceptions in ``EventualResult`` objects are logged. +* Added more examples. +* ``setup.py sdist`` should work now. + +0.5.0 +^^^^^ +* Initial release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/docs/news.rst new/crochet-2.1.1/docs/news.rst --- old/crochet-2.0.0/docs/news.rst 2021-05-10 22:34:24.000000000 +0200 +++ new/crochet-2.1.1/docs/news.rst 2023-07-01 22:54:17.000000000 +0200 @@ -1,6 +1,12 @@ What's New ========== +2.1.0 +^^^^^ + +* Various internal modernizations and maintenance. +* Dropped Python 3.6 and 3.7 support. + 2.0.0 ^^^^^ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/setup.cfg new/crochet-2.1.1/setup.cfg --- old/crochet-2.0.0/setup.cfg 2021-05-10 22:34:43.542455400 +0200 +++ new/crochet-2.1.1/setup.cfg 2023-07-01 22:54:22.325390000 +0200 @@ -1,5 +1,5 @@ [versioneer] -vcs = git +VCS = git style = pep440 versionfile_source = crochet/_version.py versionfile_build = crochet/_version.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crochet-2.0.0/setup.py new/crochet-2.1.1/setup.py --- old/crochet-2.0.0/setup.py 2021-05-10 22:34:24.000000000 +0200 +++ new/crochet-2.1.1/setup.py 2023-07-01 22:54:17.000000000 +0200 @@ -20,10 +20,10 @@ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], @@ -31,7 +31,7 @@ version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), description="Use Twisted anywhere!", - python_requires=">=3.6.0", + python_requires=">=3.8.0", install_requires=[ "Twisted>=16.0", "wrapt",