From 117d3fe2d81f0df30cb49528809d650362ad7972 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 20 Mar 2018 20:03:54 +0200 Subject: Drop support for EOL Python --- .travis.yml | 2 -- README.md | 42 ++++++++++++++++++++++-------------------- blinker/_utilities.py | 10 ---------- blinker/base.py | 2 +- docs/source/index.rst | 2 +- setup.py | 7 ------- tests/test_signals.py | 7 ------- tox.ini | 2 +- 8 files changed, 25 insertions(+), 49 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27f1391..b9d7c68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: python python: - - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" diff --git a/README.md b/README.md index fcdccdc..66af3ab 100644 --- a/README.md +++ b/README.md @@ -9,31 +9,33 @@ interested parties to subscribe to events, or "signals". Signal receivers can subscribe to specific senders or receive signals sent by any sender. - >>> from blinker import signal - >>> started = signal('round-started') - >>> def each(round): - ... print "Round %s!" % round - ... - >>> started.connect(each) - - >>> def round_two(round): - ... print "This is round two." - ... - >>> started.connect(round_two, sender=2) - - >>> for round in range(1, 4): - ... started.send(round) - ... - Round 1! - Round 2! - This is round two. - Round 3! +```python +>>> from blinker import signal +>>> started = signal('round-started') +>>> def each(round): +... print "Round %s!" % round +... +>>> started.connect(each) + +>>> def round_two(round): +... print "This is round two." +... +>>> started.connect(round_two, sender=2) + +>>> for round in range(1, 4): +... started.send(round) +... +Round 1! +Round 2! +This is round two. +Round 3! +``` See the [Blinker documentation](https://pythonhosted.org/blinker/) for more information. ## Requirements -Blinker requires Python 2.4 or higher, Python 3.0 or higher, or Jython 2.5 or higher. +Blinker requires Python 2.7, Python 3.4 or higher, or Jython 2.5 or higher. ## Changelog Summary diff --git a/blinker/_utilities.py b/blinker/_utilities.py index 056270d..45e58ff 100644 --- a/blinker/_utilities.py +++ b/blinker/_utilities.py @@ -57,16 +57,6 @@ except: dict.__repr__(self)) -try: - from contextlib import contextmanager -except ImportError: - def contextmanager(fn): - def oops(*args, **kw): - raise RuntimeError("Python 2.5 or above is required to use " - "context managers.") - oops.__name__ = fn.__name__ - return oops - class _symbol(object): def __init__(self, name): diff --git a/blinker/base.py b/blinker/base.py index 3fd77d8..f16f22a 100644 --- a/blinker/base.py +++ b/blinker/base.py @@ -8,12 +8,12 @@ each manages its own receivers and message emission. The :func:`signal` function provides singleton behavior for named signals. """ +from contextlib import contextmanager from warnings import warn from weakref import WeakValueDictionary from blinker._utilities import ( WeakTypes, - contextmanager, defaultdict, hashable_identity, lazy_property, diff --git a/docs/source/index.rst b/docs/source/index.rst index 28976d8..a53cd81 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,7 +16,7 @@ The core of Blinker is quite small but provides powerful features: - thread safety Blinker was written by Jason Kirtand and is provided under the MIT -License. The library supports Python 2.4 or later; Python 3.0 or later; +License. The library supports Python 2.7 and Python 3.4 or later; or Jython 2.5 or later; or PyPy 1.6 or later. diff --git a/setup.py b/setup.py index ad53c25..0a9cb6f 100644 --- a/setup.py +++ b/setup.py @@ -24,15 +24,8 @@ setup(name="blinker", 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.4', - 'Programming Language :: Python :: 2.5', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.0', - 'Programming Language :: Python :: 3.1', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tests/test_signals.py b/tests/test_signals.py index a1172ed..2aa4b16 100644 --- a/tests/test_signals.py +++ b/tests/test_signals.py @@ -486,10 +486,3 @@ def test_named_blinker(): def values_are_empty_sets_(dictionary): for val in dictionary.values(): assert val == set() - -if sys.version_info < (2, 5): - def test_context_manager_warning(): - sig = blinker.Signal() - receiver = lambda sender: None - - assert_raises(RuntimeError, sig.connected_to, receiver) diff --git a/tox.ini b/tox.ini index 5046326..fa5ce00 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py25,py26,py27,py30,py31,py32,py33,py34,py35,jython +envlist = py27,py34,py35,py36,jython [testenv] deps=nose -- cgit v1.2.1 From e748bd36761d97ab8d7523ad148738d16e5906f1 Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 21 Mar 2018 23:58:15 +0200 Subject: Unnecessary dict call - rewrite as a literal --- tests/test_signals.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_signals.py b/tests/test_signals.py index 2aa4b16..2d6a65a 100644 --- a/tests/test_signals.py +++ b/tests/test_signals.py @@ -48,10 +48,10 @@ def test_meta_connect(): sig = blinker.Signal() sig.connect(receiver) - assert sentinel == [dict(sender=sig, - receiver_arg=receiver, - sender_arg=blinker.ANY, - weak_arg=True)] + assert sentinel == [{'sender': sig, + 'receiver_arg': receiver, + 'sender_arg': blinker.ANY, + 'weak_arg': True}] blinker.receiver_connected._clear_state() @@ -78,7 +78,7 @@ def _test_signal_signals(sender): expected = ('receiver_connected', sig, - dict(receiver=receiver, sender=sender, weak=weak)) + {'receiver': receiver, 'sender': sender, 'weak': weak}) assert sentinel[-1] == expected @@ -87,14 +87,14 @@ def _test_signal_signals(sender): expected = ('receiver_disconnected', sig, - dict(receiver=receiver1, sender=sender)) + {'receiver': receiver1, 'sender': sender}) assert sentinel[-1] == expected # disconnect from ANY and all senders (implicit disconnect signature) sig.disconnect(receiver2) assert sentinel[-1] == ('receiver_disconnected', sig, - dict(receiver=receiver2, sender=blinker.ANY)) + {'receiver': receiver2, 'sender': blinker.ANY}) def test_signal_signals_any_sender(): -- cgit v1.2.1 From 9f395d00fbee9bcc6b8c73cb27530953a785ed29 Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 21 Mar 2018 23:59:16 +0200 Subject: Unnecessary tuple call - rewrite as a literal --- blinker/_utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blinker/_utilities.py b/blinker/_utilities.py index 45e58ff..babeb74 100644 --- a/blinker/_utilities.py +++ b/blinker/_utilities.py @@ -36,7 +36,7 @@ except: def __reduce__(self): if self.default_factory is None: - args = tuple() + args = () else: args = self.default_factory, return type(self), args, None, None, self.items() -- cgit v1.2.1 From 330fec6a5f85e4968979109b76269ad0ec1ca23f Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 26 Jul 2018 13:00:32 +0300 Subject: Upgrade Python syntax with pyupgrade --- blinker/_saferef.py | 2 +- blinker/_utilities.py | 2 +- blinker/base.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blinker/_saferef.py b/blinker/_saferef.py index 269e362..081173d 100644 --- a/blinker/_saferef.py +++ b/blinker/_saferef.py @@ -198,7 +198,7 @@ class BoundMethodWeakref(object): def __str__(self): """Give a friendly representation of the object.""" - return "%s(%s.%s)" % ( + return "{}({}.{})".format( self.__class__.__name__, self.self_name, self.func_name, diff --git a/blinker/_utilities.py b/blinker/_utilities.py index babeb74..133c57a 100644 --- a/blinker/_utilities.py +++ b/blinker/_utilities.py @@ -53,7 +53,7 @@ except: copy.deepcopy(self.items())) def __repr__(self): - return 'defaultdict(%s, %s)' % (self.default_factory, + return 'defaultdict({}, {})'.format(self.default_factory, dict.__repr__(self)) diff --git a/blinker/base.py b/blinker/base.py index f16f22a..acf595b 100644 --- a/blinker/base.py +++ b/blinker/base.py @@ -416,7 +416,7 @@ class NamedSignal(Signal): def __repr__(self): base = Signal.__repr__(self) - return "%s; %r>" % (base[:-1], self.name) + return "{}; {!r}>".format(base[:-1], self.name) class Namespace(dict): -- cgit v1.2.1 From 07f8d661ad1ea772d6245d9fe0f5e85f338cb20c Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 26 Jul 2018 13:01:07 +0300 Subject: Add python_requires to help pip --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 0a9cb6f..f0a52ce 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ setup(name="blinker", long_description=readme, license='MIT License', url='http://pythonhosted.org/blinker/', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', -- cgit v1.2.1 From 298bafd0fd5e28093ec620efed15458626f98c9d Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 3 Nov 2018 22:03:41 +0200 Subject: Update minimum Jython and PyPy versions --- README.md | 2 +- docs/source/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66af3ab..907a3ec 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ See the [Blinker documentation](https://pythonhosted.org/blinker/) for more info ## Requirements -Blinker requires Python 2.7, Python 3.4 or higher, or Jython 2.5 or higher. +Blinker requires Python 2.7, Python 3.4 or higher, or Jython 2.7 or higher. ## Changelog Summary diff --git a/docs/source/index.rst b/docs/source/index.rst index a53cd81..788eb74 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -17,7 +17,7 @@ The core of Blinker is quite small but provides powerful features: Blinker was written by Jason Kirtand and is provided under the MIT License. The library supports Python 2.7 and Python 3.4 or later; -or Jython 2.5 or later; or PyPy 1.6 or later. +or Jython 2.7 or later; or PyPy 2.7 or later. Decoupling With Named Signals -- cgit v1.2.1 From f92e54348bdc9fe3e015e73b200f61043bc11152 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 19 Apr 2019 19:48:33 +0300 Subject: Drop support for EOL Python 3.4 --- .travis.yml | 1 - docs/source/index.rst | 2 +- setup.py | 3 +-- tox.ini | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9d7c68..91481c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python python: - "2.7" - - "3.4" - "3.5" - "3.6" - "pypy" diff --git a/docs/source/index.rst b/docs/source/index.rst index 788eb74..bdb40ef 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,7 +16,7 @@ The core of Blinker is quite small but provides powerful features: - thread safety Blinker was written by Jason Kirtand and is provided under the MIT -License. The library supports Python 2.7 and Python 3.4 or later; +License. The library supports Python 2.7 and Python 3.5 or later; or Jython 2.7 or later; or PyPy 2.7 or later. diff --git a/setup.py b/setup.py index f0a52ce..0d62b49 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup(name="blinker", long_description=readme, license='MIT License', url='http://pythonhosted.org/blinker/', - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -27,7 +27,6 @@ setup(name="blinker", 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries', diff --git a/tox.ini b/tox.ini index fa5ce00..8f5146f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,jython +envlist = py27,py35,py36,jython [testenv] deps=nose -- cgit v1.2.1