Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pyee for openSUSE:Factory checked in at 2021-01-19 16:02:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyee (Old) and /work/SRC/openSUSE:Factory/.python-pyee.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyee" Tue Jan 19 16:02:48 2021 rev:7 rq:864168 version:8.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyee/python-pyee.changes 2020-03-31 17:14:31.219599976 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyee.new.28504/python-pyee.changes 2021-01-19 16:03:15.003475543 +0100 @@ -1,0 +2,31 @@ +Mon Jan 18 22:37:12 UTC 2021 - Benjamin Greiner <c...@bnavigator.de> + +- Update to 8.1.0 + * Improved thread safety in base EventEmitter + * Documentation fix in ExecutorEventEmitter +- Changelog for Version 8.0.1 + * Update README to reflect new API +- Changelog for Version 8.0.0 + * Drop support for Python 2.7 + * Remove CompatEventEmitter and rename BaseEventEmitter to + EventEmitter + * Create an alias for BaseEventEmitter with a deprecation warning +- Changelog for Version 7.0.4 + * setup_requires vs tests_require now correct + * tests_require updated to pass in tox + * 3.7 testing removed from tox + * 2.7 testing removed from Travis +- Changelog for Version 7.0.3 + * Tag license as MIT in setup.py + * Update requirements and environment to pip -e the package +- Changelog for Version 7.0.2 + * Support Python 3.8 by attempting to import TimeoutError from + asyncio.exceptions + * Add LICENSE to package manifest + * Add trio testing to tox + * Add Python 3.8 to tox + * Fix Python 2.7 in tox +- Clarify test requirements for different python versions +- Drop python-pyee-import-asyncio.exceptions.patch merged upstream + +------------------------------------------------------------------- Old: ---- LICENSE pyee-7.0.1.tar.gz python-pyee-import-asyncio.exceptions.patch New: ---- pyee-8.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyee.spec ++++++ --- /var/tmp/diff_new_pack.LrvAu2/_old 2021-01-19 16:03:15.703476595 +0100 +++ /var/tmp/diff_new_pack.LrvAu2/_new 2021-01-19 16:03:15.707476602 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pyee # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,18 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 Name: python-pyee -Version: 7.0.1 +Version: 8.1.0 Release: 0 Summary: A port of node.js's EventEmitter to python License: MIT Group: Development/Languages/Python URL: https://github.com/jfhbrook/pyee Source: https://files.pythonhosted.org/packages/source/p/pyee/pyee-%{version}.tar.gz -Source99: https://raw.githubusercontent.com/jfhbrook/pyee/master/LICENSE -# test_async.py: import asyncio.exception.TimeoutError -# https://github.com/jfhbrook/pyee/issues/68 -Patch0: python-pyee-import-asyncio.exceptions.patch BuildRequires: %{python_module PyHamcrest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module vcversioner} @@ -37,10 +34,9 @@ BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Twisted} -BuildRequires: %{python_module mock} -BuildRequires: %{python_module pytest-runner} -BuildRequires: python3-pytest-asyncio -BuildRequires: python3-pytest-trio +BuildRequires: %{python_module pytest-asyncio} +BuildRequires: (python38-pytest-trio if python38-base else (python3-pytest-trio if python3-base >= 3.7)) +BuildRequires: (python38-trio if python38-base else (python3-trio if python3-base >= 3.7)) # /SECTION %python_subpackages @@ -50,9 +46,8 @@ %prep %setup -q -n pyee-%{version} -%patch0 -p1 -# https://github.com/jfhbrook/pyee/issues/58 -cp %{SOURCE99} . +sed -i '/pytest-runner/ d' setup.py +sed -i 's/^from mock import/from unittest.mock import/' tests/test_*.py %build %python_build @@ -62,16 +57,12 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# Only run tests for python3 (see test requirements) -%{python_expand # -if [ "${python_flavor}" == "python3" ]; then - python3 setup.py test -fi -} +%pytest %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pyee +%{python_sitelib}/pyee-%{version}*-info %changelog ++++++ pyee-7.0.1.tar.gz -> pyee-8.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/CHANGELOG.rst new/pyee-8.1.0/CHANGELOG.rst --- old/pyee-7.0.1/CHANGELOG.rst 2020-01-30 21:42:15.000000000 +0100 +++ new/pyee-8.1.0/CHANGELOG.rst 2020-10-08 21:54:37.000000000 +0200 @@ -1,3 +1,39 @@ +2020/10/08 Version 8.1.0 +------------------------ +- Improved thread safety in base EventEmitter +- Documentation fix in ExecutorEventEmitter + +2020/09/20 Version 8.0.1 +------------------------ +- Update README to reflect new API + +2020/09/20 Version 8.0.0 +------------------------ +- Drop support for Python 2.7 +- Remove CompatEventEmitter and rename BaseEventEmitter to EventEmitter +- Create an alias for BaseEventEmitter with a deprecation warning + +2020/09/20 Version 7.0.4 +------------------------ +- setup_requires vs tests_require now correct +- tests_require updated to pass in tox +- 3.7 testing removed from tox +- 2.7 testing removed from Travis + +2020/09/04 Version 7.0.3 +------------------------ +- Tag license as MIT in setup.py +- Update requirements and environment to pip -e the package + +2020/05/12 Version 7.0.2 +------------------------ +- Support Python 3.8 by attempting to import TimeoutError from + ``asyncio.exceptions`` +- Add LICENSE to package manifest +- Add trio testing to tox +- Add Python 3.8 to tox +- Fix Python 2.7 in tox + 2020/01/30 Version 7.0.1 ------------------------ - Some tweaks to the docs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/CONTRIBUTORS.rst new/pyee-8.1.0/CONTRIBUTORS.rst --- old/pyee-7.0.1/CONTRIBUTORS.rst 2019-04-06 07:07:14.000000000 +0200 +++ new/pyee-8.1.0/CONTRIBUTORS.rst 2020-10-08 21:51:16.000000000 +0200 @@ -8,3 +8,7 @@ - @Zearin - Ren?? Kijewski @Kijewski - Gabe Appleton @gappleto97 +- Daniel M. Capella @polyzen <poly...@archlinux.org> +- Fabian Affolter @fabaff <m...@fabian-affolter.ch> +- Anton Bolshakov @blshkv +- ??ke Forslund @forslund <ake.forsl...@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/DEVELOPMENT.rst new/pyee-8.1.0/DEVELOPMENT.rst --- old/pyee-7.0.1/DEVELOPMENT.rst 2019-04-13 19:50:11.000000000 +0200 +++ new/pyee-8.1.0/DEVELOPMENT.rst 2020-09-05 00:41:23.000000000 +0200 @@ -2,12 +2,12 @@ ------------ - Set up either a virtualenv or a conda env + - if using a virtualenv, `pip install -r requirements_dev.txt` will install development dependencies - if using conda, `conda env create` in this directory will create the environment and `conda env update` will update. -- You can link this project to your current environment with - ``python setup.py develop``. + - Tests can be ran with ``make test``. - Documentation can be generated locally with ``make build_docs`` and served with ``make serve_docs``. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/LICENSE new/pyee-8.1.0/LICENSE --- old/pyee-7.0.1/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/pyee-8.1.0/LICENSE 2020-09-05 00:35:48.000000000 +0200 @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Joshua Holbrook + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/MANIFEST.in new/pyee-8.1.0/MANIFEST.in --- old/pyee-7.0.1/MANIFEST.in 2019-04-06 07:07:14.000000000 +0200 +++ new/pyee-8.1.0/MANIFEST.in 2020-09-05 00:35:48.000000000 +0200 @@ -1,3 +1,4 @@ +include LICENSE include README.rst include CHANGELOG.rst include CONTRIBUTORS.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/PKG-INFO new/pyee-8.1.0/PKG-INFO --- old/pyee-7.0.1/PKG-INFO 2020-01-30 21:42:40.000000000 +0100 +++ new/pyee-8.1.0/PKG-INFO 2020-10-08 21:55:43.203007700 +0200 @@ -1,11 +1,11 @@ Metadata-Version: 1.1 Name: pyee -Version: 7.0.1 +Version: 8.1.0 Summary: A port of node.js's EventEmitter to python. Home-page: https://github.com/jfhbrook/pyee Author: Joshua Holbrook Author-email: josh.holbr...@gmail.com -License: UNKNOWN +License: MIT Description: pyee ==== @@ -14,7 +14,7 @@ .. image:: https://readthedocs.org/projects/pyee/badge/?version=latest :target: https://pyee.readthedocs.io - pyee supplies a ``BaseEventEmitter`` object that is similar to the + pyee supplies a ``EventEmitter`` object that is similar to the ``EventEmitter`` class from Node.js. It also supplies a number of subclasses with added support for async and threaded programming in python, such as async/await as seen in python 3.5+. @@ -22,7 +22,7 @@ Docs: ----- - Authgenerated API docs, including basic installation directions and examples, + Autogenerated API docs, including basic installation directions and examples, can be found at https://pyee.readthedocs.io . Development: @@ -53,9 +53,9 @@ Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Other/Nonlisted Topic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/README.rst new/pyee-8.1.0/README.rst --- old/pyee-7.0.1/README.rst 2019-04-13 19:47:29.000000000 +0200 +++ new/pyee-8.1.0/README.rst 2020-09-20 21:15:57.000000000 +0200 @@ -6,7 +6,7 @@ .. image:: https://readthedocs.org/projects/pyee/badge/?version=latest :target: https://pyee.readthedocs.io -pyee supplies a ``BaseEventEmitter`` object that is similar to the +pyee supplies a ``EventEmitter`` object that is similar to the ``EventEmitter`` class from Node.js. It also supplies a number of subclasses with added support for async and threaded programming in python, such as async/await as seen in python 3.5+. @@ -14,7 +14,7 @@ Docs: ----- -Authgenerated API docs, including basic installation directions and examples, +Autogenerated API docs, including basic installation directions and examples, can be found at https://pyee.readthedocs.io . Development: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee/__init__.py new/pyee-8.1.0/pyee/__init__.py --- old/pyee-7.0.1/pyee/__init__.py 2020-01-30 21:23:11.000000000 +0100 +++ new/pyee-8.1.0/pyee/__init__.py 2020-09-20 21:13:16.000000000 +0200 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -pyee supplies a ``BaseEventEmitter`` class that is similar to the +pyee supplies a ``EventEmitter`` class that is similar to the ``EventEmitter`` class from Node.js. In addition, it supplies the subclasses ``AsyncIOEventEmitter``, ``TwistedEventEmitter`` and ``ExecutorEventEmitter`` for supporting async and threaded execution with asyncio, twisted, and @@ -13,9 +13,9 @@ :: - In [1]: from pyee import BaseEventEmitter + In [1]: from pyee import EventEmitter - In [2]: ee = BaseEventEmitter() + In [2]: ee = EventEmitter() In [3]: @ee.on('event') ...: def event_handler(): @@ -29,11 +29,23 @@ """ +from warnings import warn + from pyee._base import ( - BaseEventEmitter, + EventEmitter, PyeeException ) -from pyee._compat import CompatEventEmitter as EventEmitter + + +class BaseEventEmitter(EventEmitter): + def __init__(self): + warn(DeprecationWarning( + 'pyee.BaseEventEmitter is deprecated and will be removed in a ' + 'future major version; you should instead use pyee.EventEmitter.' + )) + + super(BaseEventEmitter, self).__init__() + __all__ = ['BaseEventEmitter', 'EventEmitter', 'PyeeException'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee/_asyncio.py new/pyee-8.1.0/pyee/_asyncio.py --- old/pyee-7.0.1/pyee/_asyncio.py 2020-01-30 21:22:49.000000000 +0100 +++ new/pyee-8.1.0/pyee/_asyncio.py 2020-09-20 21:13:16.000000000 +0200 @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- from asyncio import ensure_future, Future, iscoroutine -from pyee._base import BaseEventEmitter +from pyee._base import EventEmitter __all__ = ['AsyncIOEventEmitter'] -class AsyncIOEventEmitter(BaseEventEmitter): +class AsyncIOEventEmitter(EventEmitter): """An event emitter class which can run asyncio coroutines in addition to synchronous blocking functions. For example:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee/_base.py new/pyee-8.1.0/pyee/_base.py --- old/pyee-7.0.1/pyee/_base.py 2020-01-30 21:23:11.000000000 +0100 +++ new/pyee-8.1.0/pyee/_base.py 2020-10-08 21:51:16.000000000 +0200 @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from collections import defaultdict, OrderedDict +from threading import Lock -__all__ = ['BaseEventEmitter', 'PyeeException'] +__all__ = ['EventEmitter', 'PyeeException'] class PyeeException(Exception): @@ -10,7 +11,7 @@ pass -class BaseEventEmitter(object): +class EventEmitter: """The base event emitter class. All other event emitters inherit from this class. @@ -38,6 +39,7 @@ """ def __init__(self): self._events = defaultdict(OrderedDict) + self._lock = Lock() def on(self, event, f=None): """Registers the function ``f`` to the event name ``event``. @@ -72,7 +74,8 @@ # Note that k and v are the same for `on` handlers, but # different for `once` handlers, where v is a wrapped version # of k which removes itself before calling k - self._events[event][k] = v + with self._lock: + self._events[event][k] = v def _emit_run(self, f, args, kwargs): f(*args, **kwargs) @@ -87,7 +90,9 @@ def _call_handlers(self, event, args, kwargs): handled = False - for f in list(self._events[event].values()): + with self._lock: + funcs = list(self._events[event].values()) + for f in funcs: self._emit_run(f, args, kwargs) handled = True @@ -118,7 +123,13 @@ """ def _wrapper(f): def g(*args, **kwargs): - self.remove_listener(event, f) + with self._lock: + # Check that the event wasn't removed already right + # before the lock + if event in self._events and f in self._events[event]: + self._remove_listener(event, f) + else: + return None # f may return a coroutine, so we need to return that # result here so that emit can schedule it return f(*args, **kwargs) @@ -131,18 +142,24 @@ else: return _wrapper(f) + def _remove_listener(self, event, f): + """Naked unprotected removal.""" + self._events[event].pop(f) + def remove_listener(self, event, f): """Removes the function ``f`` from ``event``.""" - self._events[event].pop(f) + with self._lock: + self._remove_listener(event, f) def remove_all_listeners(self, event=None): """Remove all listeners attached to ``event``. If ``event`` is ``None``, remove all listeners on all events. """ - if event is not None: - self._events[event] = OrderedDict() - else: - self._events = defaultdict(OrderedDict) + with self._lock: + if event is not None: + self._events[event] = OrderedDict() + else: + self._events = defaultdict(OrderedDict) def listeners(self, event): """Returns a list of all listeners registered to the ``event``. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee/_executor.py new/pyee-8.1.0/pyee/_executor.py --- old/pyee-7.0.1/pyee/_executor.py 2019-04-14 01:37:05.000000000 +0200 +++ new/pyee-8.1.0/pyee/_executor.py 2020-09-20 21:31:17.000000000 +0200 @@ -1,19 +1,15 @@ # -*- coding: utf-8 -*- -from pyee._base import BaseEventEmitter +from pyee._base import EventEmitter -try: - from concurrent.futures import ThreadPoolExecutor -except ImportError: - from futures import ThreadPoolExecutor +from concurrent.futures import ThreadPoolExecutor __all__ = ['ExecutorEventEmitter'] -class ExecutorEventEmitter(BaseEventEmitter): +class ExecutorEventEmitter(EventEmitter): """An event emitter class which runs handlers in a ``concurrent.futures`` - executor. If using python 2, this will fall back to trying to use the - ``futures`` backported library (caveats there apply). + executor. By default, this class creates a default ``ThreadPoolExecutor``, but a custom executor may also be passed in explicitly to, for instance, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee/_trio.py new/pyee-8.1.0/pyee/_trio.py --- old/pyee-7.0.1/pyee/_trio.py 2020-01-30 21:16:37.000000000 +0100 +++ new/pyee-8.1.0/pyee/_trio.py 2020-09-20 21:13:16.000000000 +0200 @@ -2,12 +2,12 @@ from contextlib import asynccontextmanager import trio -from pyee._base import BaseEventEmitter, PyeeException +from pyee._base import EventEmitter, PyeeException __all__ = ['TrioEventEmitter'] -class TrioEventEmitter(BaseEventEmitter): +class TrioEventEmitter(EventEmitter): """An event emitter class which can run trio tasks in a trio nursery. By default, this class will lazily create both a nursery manager (the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee/_twisted.py new/pyee-8.1.0/pyee/_twisted.py --- old/pyee-7.0.1/pyee/_twisted.py 2019-04-14 02:17:21.000000000 +0200 +++ new/pyee-8.1.0/pyee/_twisted.py 2020-09-20 21:13:16.000000000 +0200 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from pyee._base import BaseEventEmitter +from pyee._base import EventEmitter from twisted.internet.defer import Deferred, ensureDeferred from twisted.python.failure import Failure @@ -14,7 +14,7 @@ __all__ = ['TwistedEventEmitter'] -class TwistedEventEmitter(BaseEventEmitter): +class TwistedEventEmitter(EventEmitter): """An event emitter class which can run twisted coroutines and handle returned Deferreds, in addition to synchronous blocking functions. For example:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee.egg-info/PKG-INFO new/pyee-8.1.0/pyee.egg-info/PKG-INFO --- old/pyee-7.0.1/pyee.egg-info/PKG-INFO 2020-01-30 21:42:39.000000000 +0100 +++ new/pyee-8.1.0/pyee.egg-info/PKG-INFO 2020-10-08 21:55:42.000000000 +0200 @@ -1,11 +1,11 @@ Metadata-Version: 1.1 Name: pyee -Version: 7.0.1 +Version: 8.1.0 Summary: A port of node.js's EventEmitter to python. Home-page: https://github.com/jfhbrook/pyee Author: Joshua Holbrook Author-email: josh.holbr...@gmail.com -License: UNKNOWN +License: MIT Description: pyee ==== @@ -14,7 +14,7 @@ .. image:: https://readthedocs.org/projects/pyee/badge/?version=latest :target: https://pyee.readthedocs.io - pyee supplies a ``BaseEventEmitter`` object that is similar to the + pyee supplies a ``EventEmitter`` object that is similar to the ``EventEmitter`` class from Node.js. It also supplies a number of subclasses with added support for async and threaded programming in python, such as async/await as seen in python 3.5+. @@ -22,7 +22,7 @@ Docs: ----- - Authgenerated API docs, including basic installation directions and examples, + Autogenerated API docs, including basic installation directions and examples, can be found at https://pyee.readthedocs.io . Development: @@ -53,9 +53,9 @@ Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Other/Nonlisted Topic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/pyee.egg-info/SOURCES.txt new/pyee-8.1.0/pyee.egg-info/SOURCES.txt --- old/pyee-7.0.1/pyee.egg-info/SOURCES.txt 2020-01-30 21:42:39.000000000 +0100 +++ new/pyee-8.1.0/pyee.egg-info/SOURCES.txt 2020-10-08 21:55:42.000000000 +0200 @@ -1,6 +1,7 @@ CHANGELOG.rst CONTRIBUTORS.rst DEVELOPMENT.rst +LICENSE MANIFEST.in README.rst setup.cfg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/setup.py new/pyee-8.1.0/setup.py --- old/pyee-7.0.1/setup.py 2020-01-30 21:16:37.000000000 +0100 +++ new/pyee-8.1.0/setup.py 2020-09-20 21:13:16.000000000 +0200 @@ -13,17 +13,18 @@ vcversioner={}, packages=find_packages(), + tests_require=[ + 'mock', + 'pytest', + 'pytest-asyncio; python_version >= "3.4"', + 'pytest-trio; python_version >= "3.7"', + 'trio; python_version > "3.6"', + 'twisted' + ], setup_requires=[ 'pytest-runner', - 'pytest-asyncio; python_version > "3.4"', - 'pytest-trio; python_version > "3.7"', 'vcversioner' ], - tests_require=[ - 'twisted', - 'trio; python_version > "3.7"', - 'futures; python_version < "3.0"' - ], include_package_data=True, description="A port of node.js's EventEmitter to python.", @@ -31,6 +32,7 @@ author="Joshua Holbrook", author_email="josh.holbr...@gmail.com", url="https://github.com/jfhbrook/pyee", + license="MIT", keywords=[ "events", "emitter", "node.js", "node", "eventemitter", "event_emitter" @@ -42,11 +44,11 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic" ] ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/tests/test_async.py new/pyee-8.1.0/tests/test_async.py --- old/pyee-7.0.1/tests/test_async.py 2020-01-30 21:22:49.000000000 +0100 +++ new/pyee-8.1.0/tests/test_async.py 2020-09-20 21:13:16.000000000 +0200 @@ -4,29 +4,30 @@ import pytest_asyncio.plugin # noqa from asyncio import Future, wait_for -from concurrent.futures import TimeoutError + +try: + from asyncio.exceptions import TimeoutError +except ImportError: + from concurrent.futures import TimeoutError + from mock import Mock -from twisted.internet.defer import ensureDeferred, succeed +from twisted.internet.defer import succeed -from pyee import EventEmitter, AsyncIOEventEmitter, TwistedEventEmitter +from pyee import AsyncIOEventEmitter, TwistedEventEmitter class PyeeTestError(Exception): pass -@pytest.mark.parametrize('cls', [ - AsyncIOEventEmitter, - EventEmitter -]) @pytest.mark.asyncio -async def test_asyncio_emit(cls, event_loop): - """Test that asyncio-supporting event emitters can handle wrapping +async def test_asyncio_emit(event_loop): + """Test that AsyncIOEventEmitter can handle wrapping coroutines """ - ee = cls(loop=event_loop) + ee = AsyncIOEventEmitter(loop=event_loop) should_call = Future(loop=event_loop) @@ -41,17 +42,13 @@ assert result is True -@pytest.mark.parametrize('cls', [ - AsyncIOEventEmitter, - EventEmitter -]) @pytest.mark.asyncio -async def test_asyncio_once_emit(cls, event_loop): - """Test that asyncio-supporting event emitters also wrap coroutines when +async def test_asyncio_once_emit(event_loop): + """Test that AsyncIOEventEmitter also wrap coroutines when using once """ - ee = cls(loop=event_loop) + ee = AsyncIOEventEmitter(loop=event_loop) should_call = Future(loop=event_loop) @@ -66,16 +63,12 @@ assert result is True -@pytest.mark.parametrize('cls', [ - AsyncIOEventEmitter, - EventEmitter -]) @pytest.mark.asyncio -async def test_asyncio_error(cls, event_loop): - """Test that asyncio-supporting event emitters can handle errors when +async def test_asyncio_error(event_loop): + """Test that AsyncIOEventEmitter can handle errors when wrapping coroutines """ - ee = cls(loop=event_loop) + ee = AsyncIOEventEmitter(loop=event_loop) should_call = Future(loop=event_loop) @@ -144,15 +137,11 @@ assert isinstance(result, PyeeTestError) -@pytest.mark.parametrize('cls,kwargs', [ - (TwistedEventEmitter, dict()), - (EventEmitter, dict(scheduler=ensureDeferred)) -]) -def test_twisted_emit(cls, kwargs): - """Test that twisted-supporting event emitters can handle wrapping +def test_twisted_emit(): + """Test that TwistedEventEmitter can handle wrapping coroutines """ - ee = cls(**kwargs) + ee = TwistedEventEmitter() should_call = Mock() @@ -166,15 +155,11 @@ should_call.assert_called_once() -@pytest.mark.parametrize('cls,kwargs', [ - (TwistedEventEmitter, dict()), - (EventEmitter, dict(scheduler=ensureDeferred)) -]) -def test_twisted_once(cls, kwargs): - """Test that twisted-supporting event emitters also wrap coroutines for +def test_twisted_once(): + """Test that TwistedEventEmitter also wraps coroutines for once """ - ee = cls(**kwargs) + ee = TwistedEventEmitter() should_call = Mock() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/tests/test_sync.py new/pyee-8.1.0/tests/test_sync.py --- old/pyee-7.0.1/tests/test_sync.py 2020-01-30 21:23:11.000000000 +0100 +++ new/pyee-8.1.0/tests/test_sync.py 2020-09-20 21:13:16.000000000 +0200 @@ -1,28 +1,21 @@ # -*- coding: utf-8 -*- -import pytest - -from inspect import getmro from collections import OrderedDict from mock import Mock from pytest import raises -from pyee import BaseEventEmitter, EventEmitter +from pyee import EventEmitter class PyeeTestException(Exception): pass -@pytest.mark.parametrize('cls', [ - BaseEventEmitter, - EventEmitter -]) -def test_emit_sync(cls): +def test_emit_sync(): """Basic synchronous emission works""" call_me = Mock() - ee = cls() + ee = EventEmitter() @ee.on('event') def event_handler(data, **kwargs): @@ -35,15 +28,11 @@ call_me.assert_called_once() -@pytest.mark.parametrize('cls', [ - BaseEventEmitter, - EventEmitter -]) -def test_emit_error(cls): +def test_emit_error(): """Errors raise with no event handler, otherwise emit on handler""" call_me = Mock() - ee = cls() + ee = EventEmitter() test_exception = PyeeTestException('lololol') @@ -65,7 +54,7 @@ """ call_me = Mock() - ee = BaseEventEmitter() + ee = EventEmitter() # make sure emitting without a callback returns False assert not ee.emit('data') @@ -81,7 +70,7 @@ """The 'new_listener' event fires whenever a new listerner is added.""" call_me = Mock() - ee = BaseEventEmitter() + ee = EventEmitter() ee.on('new_listener', call_me) @@ -96,7 +85,7 @@ def test_listener_removal(): """Removing listeners removes the correct listener from an event.""" - ee = BaseEventEmitter() + ee = EventEmitter() # Some functions to pass to the EE def first(): @@ -148,7 +137,7 @@ """ call_me = Mock() - ee = BaseEventEmitter() + ee = EventEmitter() def should_remove(): ee.remove_listener('remove', call_me) @@ -163,7 +152,7 @@ call_me.reset_mock() # Also test with the listeners added in the opposite order - ee = BaseEventEmitter() + ee = EventEmitter() ee.on('remove', call_me) ee.on('remove', should_remove) @@ -180,7 +169,7 @@ # gets removed afterwards call_me = Mock() - ee = BaseEventEmitter() + ee = EventEmitter() def once_handler(data): assert data == 'emitter is emitted!' @@ -200,7 +189,7 @@ """Removal of once functions works """ - ee = BaseEventEmitter() + ee = EventEmitter() def once_handler(data): pass @@ -218,7 +207,7 @@ """`listeners()` returns a copied list of listeners.""" call_me = Mock() - ee = BaseEventEmitter() + ee = EventEmitter() @ee.on('event') def event_handler(): @@ -246,7 +235,7 @@ call_me = Mock() call_me_also = Mock() - ee = BaseEventEmitter() + ee = EventEmitter() @ee.on('always') def always_event_handler(): @@ -272,36 +261,3 @@ # Calling the event handler directly doesn't clear the handler ee.emit('once') call_me_also.assert_called_once() - - -def test_inheritance(): - """Test that inheritance is preserved from object""" - assert object in getmro(BaseEventEmitter) - - class example(BaseEventEmitter): - def __init__(self): - super(example, self).__init__() - - assert BaseEventEmitter in getmro(example) - assert object in getmro(example) - - -def test_multiple_inheritance(): - """Test that inheritance is preserved along a lengthy MRO""" - class example(BaseEventEmitter): - def __init__(self): - super(example, self).__init__() - - class _example(example): - def __init__(self): - super(_example, self).__init__() - - class example2(_example): - def __init__(self): - super(example2, self).__init__() - - class _example2(_example): - def __init__(self): - super(_example2, self).__init__() - - a = _example2() # noqa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/tests/test_uplift.py new/pyee-8.1.0/tests/test_uplift.py --- old/pyee-7.0.1/tests/test_uplift.py 2020-01-30 21:23:11.000000000 +0100 +++ new/pyee-8.1.0/tests/test_uplift.py 2020-09-20 21:13:16.000000000 +0200 @@ -3,18 +3,18 @@ import pytest from mock import call, Mock -from pyee import BaseEventEmitter +from pyee import EventEmitter from pyee.uplift import uplift -class UpliftedEventEmitter(BaseEventEmitter): +class UpliftedEventEmitter(EventEmitter): pass def test_uplift_emit(): call_me = Mock() - base_ee = BaseEventEmitter() + base_ee = EventEmitter() @base_ee.on('base_event') def base_handler(): @@ -98,7 +98,7 @@ 'new', 'underlying', 'neither' ]) def test_exception_handling(error_handling): - base_ee = BaseEventEmitter() + base_ee = EventEmitter() uplifted_ee = uplift( UpliftedEventEmitter, base_ee, error_handling=error_handling @@ -147,7 +147,7 @@ def test_proxy_new_listener(proxy_new_listener): call_me = Mock() - base_ee = BaseEventEmitter() + base_ee = EventEmitter() uplifted_ee = uplift( UpliftedEventEmitter, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyee-7.0.1/version.txt new/pyee-8.1.0/version.txt --- old/pyee-7.0.1/version.txt 2020-01-30 21:42:39.000000000 +0100 +++ new/pyee-8.1.0/version.txt 2020-10-08 21:55:42.000000000 +0200 @@ -1 +1 @@ -7.0.1-0-g358fb04 \ No newline at end of file +8.1.0-0-g62a3acf \ No newline at end of file