summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2022-07-17 09:44:48 -0700
committerGitHub <noreply@github.com>2022-07-17 09:44:48 -0700
commit084d2bdb86f7e2e29e4bc88d5317955b9c4d76dc (patch)
treee64ab09025c4d6cac129f141d74682721e9639e3
parent399778023f3dc771329cfa068c1f7a05159d68d9 (diff)
parent834b37fedbc977262914b427d1f1fd94005fd12a (diff)
downloadblinker-084d2bdb86f7e2e29e4bc88d5317955b9c4d76dc.tar.gz
Merge pull request #72 from pallets-eco/refresh
refresh project layout
-rw-r--r--.github/workflows/tests.yaml36
-rw-r--r--.gitignore9
-rw-r--r--.gitmodules3
-rw-r--r--.readthedocs.yaml13
-rw-r--r--.travis.yml35
-rw-r--r--AUTHORS8
-rw-r--r--CHANGES86
-rw-r--r--CHANGES.rst86
-rw-r--r--LICENSE.rst (renamed from LICENSE)12
-rw-r--r--MANIFEST.in14
-rw-r--r--Makefile30
-rw-r--r--README.md74
-rw-r--r--README.rst40
-rw-r--r--blinker/base.py24
-rw-r--r--docs/Makefile20
-rw-r--r--docs/_static/blinker-named.pngbin0 -> 3627 bytes
-rw-r--r--docs/conf.py33
-rw-r--r--docs/index.rst (renamed from docs/source/index.rst)39
-rw-r--r--docs/make.bat35
-rw-r--r--docs/requirements.in2
-rw-r--r--docs/requirements.txt58
-rw-r--r--docs/source/Makefile54
m---------docs/source/_themes0
-rw-r--r--docs/source/conf.py146
-rw-r--r--setup.cfg8
-rw-r--r--setup.py14
-rw-r--r--tests/requirements.in1
-rw-r--r--tests/requirements.txt22
-rw-r--r--tox.ini10
29 files changed, 407 insertions, 505 deletions
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
new file mode 100644
index 0000000..521431d
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,36 @@
+name: Tests
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+jobs:
+ tests:
+ name: ${{ matrix.name }}
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - {name: '3.11', python: '3.11-dev', tox: py311}
+ - {name: '3.10', python: '3.10', tox: py310}
+ - {name: '3.9', python: '3.9', tox: py39}
+ - {name: '3.8', python: '3.8', tox: py38}
+ - {name: '3.7', python: '3.7', tox: py37}
+ - {name: 'PyPy', python: 'pypy-3.9', tox: pypy39}
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python }}
+ cache: 'pip'
+ cache-dependency-path: 'tests/requirements.txt'
+ - name: update pip
+ run: |
+ pip install -U wheel
+ pip install -U setuptools
+ python -m pip install -U pip
+ - run: pip install tox
+ - run: tox -e ${{ matrix.tox }} -s false
diff --git a/.gitignore b/.gitignore
index 52b37ea..3c90d3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,11 +5,4 @@
build
dist
MANIFEST
-docs/text
-docs/html
-docs/doctrees
-docs/doctest
-docs/pickles
-docs/source/_static
-docs/source/_template
-docs/website
+docs/_build
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 9f86fc9..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "docs/source/_themes"]
- path = docs/source/_themes
- url = https://github.com/mitsuhiko/flask-sphinx-themes.git
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 0000000..db1749d
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,13 @@
+version: 2
+build:
+ os: ubuntu-20.04
+ tools:
+ python: "3.10"
+python:
+ install:
+ - requirements: docs/requirements.txt
+ - method: pip
+ path: .
+sphinx:
+ builder: dirhtml
+ fail_on_warning: true
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 995721e..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-language: python
-
-matrix:
- include:
- - python: 2.7
- os: linux
- dist: trusty
- env: TOXENV=py27
- - python: pypy
- os: linux
- dist: trusty
- env: TOXENV=pypy
- - python: 3.5
- os: linux
- dist: trusty
- env: TOXENV=py35
- - python: 3.6
- os: linux
- dist: trusty
- env: TOXENV=py36
- - python: 3.7
- os: linux
- dist: xenial
- env: TOXENV=py37
- - python: 3.8
- os: linux
- dist: xenial
- env: TOXENV=py38
-
-# command to install dependencies
-install:
- - "pip install ."
-
-# command to run tests
-script: nosetests
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index ee0dd62..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1,8 +0,0 @@
-Blinker was originally written by Jason Kirtland.
-
-Contributors are:
-
-- Jason Kirtland <jek@discorporate.us>
-
-Blinker includes code from Louie, by Patrick K. O'Brien, Mike
-C. Fletcher, and Matthew R. Scott.
diff --git a/CHANGES b/CHANGES
deleted file mode 100644
index 9777302..0000000
--- a/CHANGES
+++ /dev/null
@@ -1,86 +0,0 @@
-
-Blinker Changelog
-=================
-
-Version 1.5dev
---------------
-
-Not yet released.
-
-- Verified Python 3.7 support (no changes needed).
-- Verified Python 3.6 support (no changes needed).
-- Verified Python 3.5 support (no changes needed).
-
-Version 1.4
------------
-
-Released July 23, 2015
-
-- Verified Python 3.4 support (no changes needed)
-- Additional bookkeeping cleanup for non-ANY connections at disconnect
- time.
-- Added Signal._cleanup_bookeeping() to prune stale bookkeeping on
- demand
-
-Version 1.3
------------
-
-Released July 3, 2013
-
-- The global signal stash behind blinker.signal() is now backed by a
- regular name-to-Signal dictionary. Previously, weak references were
- held in the mapping and ephermal usage in code like
- ``signal('foo').connect(...)`` could have surprising program behavior
- depending on import order of modules.
-- blinker.Namespace is now built on a regular dict. Use
- blinker.WeakNamespace for the older, weak-referencing behavior.
-- Signal.connect('text-sender') uses an alterate hashing strategy to
- avoid sharp edges in text identity.
-
-Version 1.2
------------
-
-Released October 26, 2011
-
-- Added Signal.receiver_connected and
- Signal.receiver_disconnected per-Signal signals.
-- Deprecated the global 'receiver_connected' signal.
-- Verified Python 3.2 support (no changes needed!)
-
-Version 1.1
------------
-
-Released July 21, 2010
-
-- Added ``@signal.connect_via(sender)`` decorator
-- Added ``signal.connected_to`` shorthand name for the
- ``temporarily_connected_to`` context manager.
-
-
-Version 1.0
------------
-
-Released March 28, 2010
-
-- Python 3.0 and 3.1 compatibility
-
-
-Version 0.9
------------
-
-Released February 26, 2010
-
-- Added ``Signal.temporarily_connected_to`` context manager
-- Docs! Sphinx docs, project web site.
-
-
-Version 0.8
------------
-
-Released February 14, 2010
-
-- Initial release
-- Extracted from flatland.util.signals
-- Added Python 2.4 compatibility
-- Added nearly functional Python 3.1 compatibility (everything except
- connecting to instance methods seems to work.)
diff --git a/CHANGES.rst b/CHANGES.rst
new file mode 100644
index 0000000..d123b19
--- /dev/null
+++ b/CHANGES.rst
@@ -0,0 +1,86 @@
+Version 1.5
+-----------
+
+Unreleased
+
+- Support Python >= 3.7 and PyPy. Python 2, Python < 3.7, and Jython
+ may continue to work, but the next release will make incompatible
+ changes.
+
+
+Version 1.4
+-----------
+
+Released 2015-07-23
+
+- Verified Python 3.4 support, no changes needed.
+- Additional bookkeeping cleanup for non-``ANY`` connections at
+ disconnect time.
+- Added ``Signal._cleanup_bookeeping()`` to prune stale bookkeeping on
+ demand.
+
+
+Version 1.3
+-----------
+
+Released 2013-07-03
+
+- The global signal stash behind ``signal()`` is now backed by a
+ regular name-to-``Signal`` dictionary. Previously, weak references
+ were held in the mapping and ephermal usage in code like
+ ``signal('foo').connect(...)`` could have surprising program
+ behavior depending on import order of modules.
+- ``Namespace`` is now built on a regular dict. Use ``WeakNamespace``
+ for the older, weak-referencing behavior.
+- ``Signal.connect('text-sender')`` uses an alterate hashing strategy
+ to avoid sharp edges in text identity.
+
+
+Version 1.2
+-----------
+
+Released 2011-10-26
+
+- Added ``Signal.receiver_connected`` and
+ ``Signal.receiver_disconnected`` per-``Signal`` signals.
+- Deprecated the global ``receiver_connected`` signal.
+- Verified Python 3.2 support, no changes needed.
+
+
+Version 1.1
+-----------
+
+Released 2010-07-21
+
+- Added ``@signal.connect_via(sender)`` decorator
+- Added ``signal.connected_to`` shorthand name for the
+ ``temporarily_connected_to`` context manager.
+
+
+Version 1.0
+-----------
+
+Released 2010-03-28
+
+- Python 3.0 and 3.1 compatibility.
+
+
+Version 0.9
+-----------
+
+Released 2010-02-26
+
+- Added ``Signal.temporarily_connected_to`` context manager.
+- Docs! Sphinx docs, project web site.
+
+
+Version 0.8
+-----------
+
+Released 2010-02-14
+
+- Initial release.
+- Extracted from ``flatland.util.signals``.
+- Added Python 2.4 compatibility.
+- Added nearly functional Python 3.1 compatibility. Everything except
+ connecting to instance methods seems to work.
diff --git a/LICENSE b/LICENSE.rst
index 88f6e84..79c9825 100644
--- a/LICENSE
+++ b/LICENSE.rst
@@ -1,4 +1,4 @@
-Copyright (c) The Blinker authors and contributors <see AUTHORS file>
+Copyright 2010 Jason Kirtland
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
@@ -13,8 +13,8 @@ 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.
+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 --git a/MANIFEST.in b/MANIFEST.in
index 0a5c596..cab5663 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,8 +1,6 @@
-include LICENSE
-include README.md
-include AUTHORS
-include CHANGES
-recursive-include tests *py
-recursive-include docs/source *rst *py
-recursive-include docs/text *txt
-recursive-include docs/html *html *txt *png *css *js *inv
+include CHANGES.rst
+include tox.ini
+graft docs
+prune docs/_build
+graft tests
+global-exclude *.pyc
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 4e53a9e..0000000
--- a/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-REL=$(shell python -c 'import blinker; print blinker.__version__')
-
-.PHONY: clean sdist clean website docs test
-
-
-release: clean test docs sdist website
- @echo Preparing blinker release $(REL)
- (cd docs/source && make clean)
- (cd docs/source && make doctest)
- (cd docs/source && VERSION=$(REL) make html)
- (cd docs/source && VERSION=$(REL) make text)
- python setup.py sdist --formats=zip
-
-sdist:
- python setup.py sdist
-
-clean:
- (cd docs/source && make clean)
-
-website:
- (cd docs/source && VERSION=$(REL) make website)
-
-docs:
- (cd docs/source && VERSION=$(REL) make html)
- (cd docs/source && VERSION=$(REL) make text)
-
-
-test:
- (cd docs/source && make doctest)
- tox
diff --git a/README.md b/README.md
deleted file mode 100644
index 907a3ec..0000000
--- a/README.md
+++ /dev/null
@@ -1,74 +0,0 @@
-[![Build Status](https://travis-ci.org/jek/blinker.svg?branch=master)](https://travis-ci.org/jek/blinker)
-
-
-# Blinker
-
-Blinker provides a fast dispatching system that allows any number of
-interested parties to subscribe to events, or "signals".
-
-Signal receivers can subscribe to specific senders or receive signals
-sent by any sender.
-
-```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.7, Python 3.4 or higher, or Jython 2.7 or higher.
-
-## Changelog Summary
-
-1.3 (July 3, 2013)
-
- - The global signal stash behind blinker.signal() is now backed by a
- regular name-to-Signal dictionary. Previously, weak references were
- held in the mapping and ephemeral usage in code like
- ``signal('foo').connect(...)`` could have surprising program behavior
- depending on import order of modules.
- - blinker.Namespace is now built on a regular dict. Use
- blinker.WeakNamespace for the older, weak-referencing behavior.
- - Signal.connect('text-sender') uses an alternate hashing strategy to
- avoid sharp edges in text identity.
-
-1.2 (October 26, 2011)
-
- - Added Signal.receiver_connected and Signal.receiver_disconnected
- per-Signal signals.
- - Deprecated the global 'receiver_connected' signal.
- - Verified Python 3.2 support (no changes needed!)
-
-1.1 (July 21, 2010)
-
- - Added ``@signal.connect_via(sender)`` decorator
- - Added ``signal.connected_to`` shorthand name for the
- ``temporarily_connected_to`` context manager.
-
-1.0 (March 28, 2010)
-
- - Python 3.x compatibility
-
-0.9 (February 26, 2010)
-
- - Sphinx docs, project website
- - Added ``with a_signal.temporarily_connected_to(receiver): ...`` support
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..883dded
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,40 @@
+Blinker
+=======
+
+Blinker provides a fast dispatching system that allows any number of
+interested parties to subscribe to events, or "signals".
+
+Signal receivers can subscribe to specific senders or receive signals
+sent by any sender.
+
+.. code-block:: pycon
+
+ >>> 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!
+
+
+Links
+-----
+
+- Documentation: https://blinker.readthedocs.io/
+- Changes: https://blinker.readthedocs.io/#changes
+- PyPI Releases: https://pypi.org/project/blinker/
+- Source Code: https://github.com/pallets-eco/blinker/
+- Issue Tracker: https://github.com/pallets-eco/blinker/issues/
diff --git a/blinker/base.py b/blinker/base.py
index b68d8db..8a3e4f9 100644
--- a/blinker/base.py
+++ b/blinker/base.py
@@ -90,10 +90,10 @@ class Signal(object):
self._weak_senders = {}
def connect(self, receiver, sender=ANY, weak=True):
- r"""Connect *receiver* to signal events sent by *sender*.
+ """Connect *receiver* to signal events sent by *sender*.
:param receiver: A callable. Will be invoked by :meth:`send` with
- `sender=` as a single positional argument and any \*\*kwargs that
+ `sender=` as a single positional argument and any ``kwargs`` that
were provided to a call to :meth:`send`.
:param sender: Any object or :obj:`ANY`, defaults to ``ANY``.
@@ -158,7 +158,7 @@ class Signal(object):
return receiver
def connect_via(self, sender, weak=False):
- r"""Connect the decorated function as a receiver for *sender*.
+ """Connect the decorated function as a receiver for *sender*.
:param sender: Any object or :obj:`ANY`. The decorated function
will only receive :meth:`send` emissions sent by *sender*. If
@@ -171,7 +171,7 @@ class Signal(object):
:meth:`connect`, this defaults to False.
The decorated function will be invoked by :meth:`send` with
- `sender=` as a single positional argument and any \*\*kwargs that
+ `sender=` as a single positional argument and any ``kwargs`` that
were provided to the call to :meth:`send`.
@@ -195,14 +195,7 @@ class Signal(object):
the duration of the ``with`` block, and will be disconnected
automatically when exiting the block:
- .. testsetup::
-
- from __future__ import with_statement
- from blinker import Signal
- on_ready = Signal()
- receiver = lambda sender: None
-
- .. testcode::
+ .. code-block:: python
with on_ready.connected_to(receiver):
# do stuff
@@ -239,16 +232,15 @@ class Signal(object):
return self.connected_to(receiver, sender)
def send(self, *sender, **kwargs):
- r"""Emit this signal on behalf of *sender*, passing on \*\*kwargs.
+ """Emit this signal on behalf of *sender*, passing on ``kwargs``.
Returns a list of 2-tuples, pairing receivers with their return
value. The ordering of receiver notification is undefined.
- :param \*sender: Any object or ``None``. If omitted, synonymous
+ :param sender: Any object or ``None``. If omitted, synonymous
with ``None``. Only accepts one positional argument.
- :param \*\*kwargs: Data to be sent to receivers.
-
+ :param kwargs: Data to be sent to receivers.
"""
if not self.receivers:
# Ensure correct signature even on no-op sends, disable with -O
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..d4bb2cb
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,20 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line, and also
+# from the environment for the first two.
+SPHINXOPTS ?=
+SPHINXBUILD ?= sphinx-build
+SOURCEDIR = .
+BUILDDIR = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/_static/blinker-named.png b/docs/_static/blinker-named.png
new file mode 100644
index 0000000..88e1818
--- /dev/null
+++ b/docs/_static/blinker-named.png
Binary files differ
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..5bbd200
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,33 @@
+from pallets_sphinx_themes import get_version
+from pallets_sphinx_themes import ProjectLink
+
+project = "Blinker"
+copyright = "2010 Jason Kirtland"
+release, version = get_version("blinker", placeholder=None)
+
+extensions = [
+ "sphinx.ext.autodoc",
+ "pallets_sphinx_themes",
+]
+
+autoclass_content = "both"
+autodoc_member_order = "groupwise"
+
+html_theme = "flask"
+html_theme_options = {"index_sidebar_logo": False}
+html_context = {
+ "project_links": [
+ ProjectLink("PyPI Releases", "https://pypi.org/project/blinker/"),
+ ProjectLink("Source Code", "https://github.com/pallets-eco/blinker/"),
+ ProjectLink("Issue Tracker", "https://github.com/pallets-eco/blinker/issues/"),
+ ]
+}
+html_sidebars = {
+ "index": ["project.html", "localtoc.html", "searchbox.html", "ethicalads.html"],
+ "**": ["localtoc.html", "relations.html", "searchbox.html", "ethicalads.html"],
+}
+singlehtml_sidebars = {"index": ["project.html", "localtoc.html", "ethicalads.html"]}
+html_static_path = ["_static"]
+html_logo = "_static/blinker-named.png"
+html_title = f"Blinker Documentation ({version})"
+html_show_sourcelink = False
diff --git a/docs/source/index.rst b/docs/index.rst
index bdb40ef..2853115 100644
--- a/docs/source/index.rst
+++ b/docs/index.rst
@@ -1,6 +1,11 @@
+.. rst-class:: hide-header
+
Blinker Documentation
=====================
+.. image:: _static/blinker-named.png
+ :align: center
+
Blinker provides fast & simple object-to-object and broadcast
signaling for Python objects.
@@ -25,7 +30,7 @@ Decoupling With Named Signals
Named signals are created with :func:`signal`:
-.. doctest::
+.. code-block:: python
>>> from blinker import signal
>>> initialized = signal('initialized')
@@ -45,7 +50,7 @@ Subscribing to Signals
the signal is emitted. Connected functions are always passed the
object that caused the signal to be emitted.
-.. doctest::
+.. code-block:: python
>>> def subscriber(sender):
... print("Got a signal sent by %r" % sender)
@@ -66,7 +71,7 @@ about to process something, and ``complete`` when it is done. It
passes ``self`` to the :meth:`~Signal.send` method, signifying that
that particular instance was responsible for emitting the signal.
-.. doctest::
+.. code-block:: python
>>> class Processor:
... def __init__(self, name):
@@ -102,7 +107,7 @@ any sender emits it. The :meth:`Signal.connect` function accepts an
optional argument to restrict the subscription to one specific sending
object:
-.. doctest::
+.. code-block:: python
>>> def b_subscriber(sender):
... print("Caught signal from processor_b.")
@@ -115,7 +120,7 @@ object:
This function has been subscribed to ``ready`` but only when sent by
``processor_b``:
-.. doctest::
+.. code-block:: python
>>> processor_a.go()
Got a signal sent by <Processor a>
@@ -132,7 +137,7 @@ Sending and Receiving Data Through Signals
Additional keyword arguments can be passed to :meth:`~Signal.send`.
These will in turn be passed to the connected functions:
-.. doctest::
+.. code-block:: python
>>> send_data = signal('send-data')
>>> @send_data.connect
@@ -147,7 +152,7 @@ The return value of :meth:`~Signal.send` collects the return values of
each connected function as a list of (``receiver function``, ``return
value``) pairs:
-.. doctest::
+.. code-block:: python
>>> result
[(<function receive_data at 0x...>, 'received!')]
@@ -161,7 +166,7 @@ unique signal each time it is invoked. For example, an alternative
implementation of the Processor from above might provide the
processing signals as class attributes:
-.. doctest::
+.. code-block:: python
>>> from blinker import Signal
>>> class AltProcessor:
@@ -187,7 +192,7 @@ You may have noticed the return value of :meth:`~Signal.connect` in
the console output in the sections above. This allows ``connect`` to
be used as a decorator on functions:
-.. doctest::
+.. code-block:: python
>>> apc = AltProcessor('c')
>>> @apc.on_complete.connect
@@ -202,7 +207,7 @@ While convenient, this form unfortunately does not allow the
``sender`` or ``weak`` arguments to be customized for the connected
function. For this, :meth:`~Signal.connect_via` can be used:
-.. doctest::
+.. code-block:: python
>>> dice_roll = signal('dice_roll')
>>> @dice_roll.connect_via(1)
@@ -224,7 +229,7 @@ expensive to compute, it can be more efficient to check to see if any
receivers are connected first by testing the :attr:`~Signal.receivers`
property:
-.. doctest::
+.. code-block:: python
>>> bool(signal('ready').receivers)
True
@@ -236,7 +241,7 @@ property:
Checking for a receiver listening for a particular sender is also
possible:
-.. doctest::
+.. code-block:: python
>>> signal('ready').has_receivers_for(processor_a)
True
@@ -298,5 +303,13 @@ Named Signals
:members: signal
-.. include:: ../../CHANGES
+Changes
+=======
+
+.. include:: ../CHANGES.rst
+
+
+MIT License
+===========
+.. include:: ../LICENSE.rst
diff --git a/docs/make.bat b/docs/make.bat
new file mode 100644
index 0000000..954237b
--- /dev/null
+++ b/docs/make.bat
@@ -0,0 +1,35 @@
+@ECHO OFF
+
+pushd %~dp0
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set SOURCEDIR=.
+set BUILDDIR=_build
+
+%SPHINXBUILD% >NUL 2>NUL
+if errorlevel 9009 (
+ echo.
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
+ echo.installed, then set the SPHINXBUILD environment variable to point
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
+ echo.may add the Sphinx directory to PATH.
+ echo.
+ echo.If you don't have Sphinx installed, grab it from
+ echo.https://www.sphinx-doc.org/
+ exit /b 1
+)
+
+if "%1" == "" goto help
+
+%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+goto end
+
+:help
+%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+
+:end
+popd
diff --git a/docs/requirements.in b/docs/requirements.in
new file mode 100644
index 0000000..6bb1491
--- /dev/null
+++ b/docs/requirements.in
@@ -0,0 +1,2 @@
+Sphinx
+Pallets-Sphinx-Themes
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..ab73fb8
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,58 @@
+#
+# This file is autogenerated by pip-compile with python 3.10
+# To update, run:
+#
+# pip-compile docs/requirements.in
+#
+alabaster==0.7.12
+ # via sphinx
+babel==2.10.3
+ # via sphinx
+certifi==2022.6.15
+ # via requests
+charset-normalizer==2.1.0
+ # via requests
+docutils==0.18.1
+ # via sphinx
+idna==3.3
+ # via requests
+imagesize==1.4.1
+ # via sphinx
+jinja2==3.1.2
+ # via sphinx
+markupsafe==2.1.1
+ # via jinja2
+packaging==21.3
+ # via
+ # pallets-sphinx-themes
+ # sphinx
+pallets-sphinx-themes==2.0.2
+ # via -r docs/requirements.in
+pygments==2.12.0
+ # via sphinx
+pyparsing==3.0.9
+ # via packaging
+pytz==2022.1
+ # via babel
+requests==2.28.1
+ # via sphinx
+snowballstemmer==2.2.0
+ # via sphinx
+sphinx==5.0.2
+ # via
+ # -r docs/requirements.in
+ # pallets-sphinx-themes
+sphinxcontrib-applehelp==1.0.2
+ # via sphinx
+sphinxcontrib-devhelp==1.0.2
+ # via sphinx
+sphinxcontrib-htmlhelp==2.0.0
+ # via sphinx
+sphinxcontrib-jsmath==1.0.1
+ # via sphinx
+sphinxcontrib-qthelp==1.0.3
+ # via sphinx
+sphinxcontrib-serializinghtml==1.1.5
+ # via sphinx
+urllib3==1.26.10
+ # via requests
diff --git a/docs/source/Makefile b/docs/source/Makefile
deleted file mode 100644
index 57b9bfe..0000000
--- a/docs/source/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-VERSION ?= tip
-RELEASE ?= $(VERSION)
-
-# Internal variables.
-ALLSPHINXOPTS = -D version=$(VERSION) -D release=$(RELEASE) \
- -d ../doctrees $(SPHINXOPTS) .
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " text to make standalone text files"
- @echo " sdist to build documentation for release"
- @echo " doctest to run doctests"
- @echo " pickles to build pickles"
- @echo " clean to remove generated artifacts"
-
-sdist: clean text html
-
-clean:
- for i in doctrees html text doctest pickles website; do \
- rm -rf ../$$i; \
- done
-
-html:
- mkdir -p ../html ../doctrees _static _template
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) ../html
- @echo
- @echo "Build finished. The HTML pages are in ../html."
-
-text:
- mkdir -p ../text ../doctrees
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) ../text
- @echo
- @echo "Build finished. The text pages are in ../text."
-
-doctest:
- mkdir -p ../doctrees ../doctest
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) ../doctest
-
-pickles:
- mkdir -p ../pickles ../doctest
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) ../pickles
-
-website:
- mkdir -p ../website ../doctrees
- $(SPHINXBUILD) -b discorporate \
- -D html_theme=discorporate \
- $(ALLSPHINXOPTS) ../website
diff --git a/docs/source/_themes b/docs/source/_themes
deleted file mode 160000
-Subproject 0269f3d188eaff07c44a800f35f7351f9e0aefb
diff --git a/docs/source/conf.py b/docs/source/conf.py
deleted file mode 100644
index ae1bcad..0000000
--- a/docs/source/conf.py
+++ /dev/null
@@ -1,146 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Blinker documentation build configuration file, created by
-# sphinx-quickstart on Mon Feb 15 10:54:13 2010.
-#
-# This file is execfile()d with the current directory set to its containing
-# dir.
-
-import os
-from os import path
-import sys
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-
-sys.path.append(os.path.abspath('../../'))
-sys.path.append(os.path.abspath('_themes'))
-
-# -- General configuration -----------------------------------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc',
- 'sphinx.ext.doctest',
- 'sphinx.ext.coverage']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'Blinker'
-copyright = u'2010, Jason Kirtland'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = 'tip'
-# The full version, including alpha/beta/rc tags.
-release = 'tip'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = []
-
-autoclass_content = "both"
-autodoc_member_order = "groupwise"
-import sphinx.ext.autodoc
-sphinx.ext.autodoc.AttributeDocumenter.member_order = 25
-sphinx.ext.autodoc.InstanceAttributeDocumenter.member_order = 26
-
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-html_static_path = ['_static']
-
-html_theme_path = ['_themes']
-
-html_theme = 'flask_small'
-
-html_theme_options = {
- 'index_logo': 'blinker-named.png',
- 'github_fork': 'jek/blinker'
-}
-
-html_title = 'Blinker'
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'Blinkerdoc'
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
- ('index', 'Blinker.tex', u'Blinker Documentation',
- u'Jason Kirtland', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_use_modindex = True
diff --git a/setup.cfg b/setup.cfg
index d47317b..01aaea5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,7 @@
-[upload_docs]
-upload-dir = docs/html
-
[bdist_wheel]
universal = 1
+
+[tool:pytest]
+testpaths = tests
+filterwarnings =
+ error
diff --git a/setup.py b/setup.py
index 3e63963..7699c5f 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ try:
except ImportError:
from distutils.core import setup
-readme = open('README.md').read()
+readme = open('README.rst').read()
import blinker
version = blinker.__version__
@@ -16,9 +16,9 @@ setup(name="blinker",
keywords='signal emit events broadcast',
long_description=readme,
license='MIT License',
- url='https://pythonhosted.org/blinker/',
+ url='https://blinker.readthedocs.io',
project_urls={
- 'Source': 'https://github.com/jek/blinker',
+ 'Source': 'https://github.com/pallets-eco/blinker',
},
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
classifiers=[
@@ -27,14 +27,6 @@ setup(name="blinker",
'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 :: Software Development :: Libraries',
- 'Topic :: Utilities',
],
)
diff --git a/tests/requirements.in b/tests/requirements.in
new file mode 100644
index 0000000..e079f8a
--- /dev/null
+++ b/tests/requirements.in
@@ -0,0 +1 @@
+pytest
diff --git a/tests/requirements.txt b/tests/requirements.txt
new file mode 100644
index 0000000..07ddd98
--- /dev/null
+++ b/tests/requirements.txt
@@ -0,0 +1,22 @@
+#
+# This file is autogenerated by pip-compile with python 3.10
+# To update, run:
+#
+# pip-compile tests/requirements.in
+#
+attrs==21.4.0
+ # via pytest
+iniconfig==1.1.1
+ # via pytest
+packaging==21.3
+ # via pytest
+pluggy==1.0.0
+ # via pytest
+py==1.11.0
+ # via pytest
+pyparsing==3.0.9
+ # via packaging
+pytest==7.1.2
+ # via -r tests/requirements.in
+tomli==2.0.1
+ # via pytest
diff --git a/tox.ini b/tox.ini
index a6e07ae..72fdd8e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,9 @@
[tox]
-envlist = py27,py35,py36,py37,py38,jython
+envlist =
+ py3{11,10,9,8,7}
+ pypy3{9,8,7}
+skip_missing_interpreters = true
[testenv]
-deps=nose
-commands=nosetests
-
+deps = -r tests/requirements.txt
+commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs:tests}