Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #1441

Merged
merged 20 commits into from Dec 19, 2020
40 changes: 27 additions & 13 deletions .github/workflows/main.yml
Expand Up @@ -18,7 +18,7 @@ on:

jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

Expand All @@ -44,9 +44,10 @@ jobs:
# since we use --parallel-mode to coverage inside Tox we use
# "coverage combine" so the filename is always ".coverage"
- name: Run Coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
tox -c tox.ini -e coverage
coverage combine && codecov

test:
env:
Expand All @@ -56,11 +57,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-20.04]
# os: [ubuntu-20.04, macos-latest, windows-latest]

# https://github.com/actions/setup-python#specifying-a-pypy-version
python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy-3.6', 'pypy-3.7']
# python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy-3.6', 'pypy-3.7']
# framework: ['asyncio', 'tw189', 'tw1910', 'tw203', 'twtrunk']
python-version: ['3.6', '3.9', 'pypy-3.7']
framework: ['asyncio', 'tw203', 'twtrunk']

# https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
Expand All @@ -71,9 +75,11 @@ jobs:
- uses: actions/checkout@v2

# Install OS packages, as we install Python packages from source:
# libenchant-dev: needed for pyenchant, needed for sphinx-spellcheck
# libbz2-dev, libsnappy-dev: needed for compression
# libunwind-dev: needed for vmprof
#
# libenchant-dev needed for pyenchant, needed for sphinx-spellcheck
# libbz2-dev, libsnappy-dev needed for compression
# libunwind-dev needed for vmprof
#
- name: Install OS package dependencies
run: |
sudo apt update
Expand All @@ -95,14 +101,18 @@ jobs:

- name: Install this package
run: |
pip install .
make abi_files
pip install .[all]

- name: Run unit tests (PyTest)
run: |
tox -c tox.ini
python -c "import autobahn; print(autobahn.__version__)"
python -c "from autobahn import xbr; print(xbr.HAS_XBR)"
python -c "from autobahn.testutil import FakeTransport; print(FakeTransport)"
tox -c tox.ini -e ${{ matrix.framework }}

docs:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

Expand All @@ -122,6 +132,11 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements-dev.txt

- name: Install this package
run: |
make abi_files
pip install .[all]

- name: Run Sphinx
run: tox -c tox.ini -e sphinx

Expand All @@ -139,15 +154,14 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
WAMP_PRIVATE_KEY: ${{ secrets.WAMP_PRIVATE_KEY }}

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
- name: Set environment
run: |
echo "${HOME}/.local/bin" >> $GITHUB_PATH
echo BUILD_DATE=`date -u +"%Y-%m-%d"` >> $GITHUB_ENV
echo AUTOBAHN_VCS_REF=`git rev-parse --short ${GITHUB_SHA}` >> $GITHUB_ENV
echo AUTOBAHN_BUILD_ID=$(date --utc +%Y%m%d)-$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV
Expand Down
35 changes: 18 additions & 17 deletions README.rst
Expand Up @@ -8,25 +8,25 @@ WebSocket & WAMP for Python on Twisted and asyncio.
--------------

| **Quick Links**: `Source Code <https://github.com/crossbario/autobahn-python>`__ - `Documentation <https://autobahn.readthedocs.io/en/latest/>`__ - `WebSocket Examples <https://autobahn.readthedocs.io/en/latest/websocket/examples.html>`__ - `WAMP Examples <https://autobahn.readthedocs.io/en/latest/wamp/examples.html>`__
| **Community**: `Mailing list <http://groups.google.com/group/autobahnws>`__ - `StackOverflow <http://stackoverflow.com/questions/tagged/autobahn>`__ - `Twitter <https://twitter.com/autobahnws>`__ - `IRC #autobahn/chat.freenode.net <https://webchat.freenode.net/>`__
| **Companion Projects**: `Autobahn|JS <https://github.com/crossbario/autobahn-js/>`__ - `Autobahn|Cpp <https://github.com/crossbario/autobahn-cpp>`__ - `Autobahn|Testsuite <https://github.com/crossbario/autobahn-testsuite>`__ - `Crossbar.io <http://crossbar.io>`__ - `WAMP <http://wamp-proto.org>`__
| **Community**: `Forum <https://gitter.im/crossbario/public>`__ - `StackOverflow <https://stackoverflow.com/questions/tagged/autobahn>`__ - `Twitter <https://twitter.com/autobahnws>`__ - `IRC #autobahn/chat.freenode.net <https://webchat.freenode.net/>`__
| **Companion Projects**: `Autobahn|JS <https://github.com/crossbario/autobahn-js/>`__ - `Autobahn|Cpp <https://github.com/crossbario/autobahn-cpp>`__ - `Autobahn|Testsuite <https://github.com/crossbario/autobahn-testsuite>`__ - `Crossbar.io <https://crossbar.io>`__ - `WAMP <https://wamp-proto.org>`__

Introduction
------------

**Autobahn\|Python** is a subproject of `Autobahn <http://crossbar.io/autobahn>`__ and provides open-source
**Autobahn\|Python** is a subproject of `Autobahn <https://crossbar.io/autobahn>`__ and provides open-source
implementations of

- `The WebSocket Protocol <http://tools.ietf.org/html/rfc6455>`__
- `The Web Application Messaging Protocol (WAMP) <http://wamp-proto.org/>`__
- `The WebSocket Protocol <https://tools.ietf.org/html/rfc6455>`__
- `The Web Application Messaging Protocol (WAMP) <https://wamp-proto.org/>`__

for Python 3.6+ and running on `Twisted <http://twistedmatrix.com/>`__ and `asyncio <http://docs.python.org/3.4/library/asyncio.html>`__.
for Python 3.6+ and running on `Twisted <https://twistedmatrix.com/>`__ and `asyncio <https://docs.python.org/3/library/asyncio.html>`__.

You can use **Autobahn\|Python** to create clients and servers in Python speaking just plain WebSocket or WAMP.

**WebSocket** allows `bidirectional real-time messaging on the Web <http://crossbario.com/blog/post/websocket-why-what-can-i-use-it/>`__ and beyond, while `WAMP <http://wamp-proto.org/>`__ adds real-time application communication on top of WebSocket.
**WebSocket** allows `bidirectional real-time messaging on the Web <https://crossbario.com/blog/post/websocket-why-what-can-i-use-it/>`__ and beyond, while `WAMP <https://wamp-proto.org/>`__ adds real-time application communication on top of WebSocket.

**WAMP** provides asynchronous **Remote Procedure Calls** and **Publish & Subscribe** for applications in *one* protocol running over `WebSocket <http://tools.ietf.org/html/rfc6455>`__. WAMP is a *routed* protocol, so you need a **WAMP Router** to connect your **Autobahn\|Python** based clients. We provide `Crossbar.io <http://crossbar.io>`__, but there are `other options <https://wamp-proto.org/implementations.html#routers>`__ as well.
**WAMP** provides asynchronous **Remote Procedure Calls** and **Publish & Subscribe** for applications in *one* protocol running over `WebSocket <https://tools.ietf.org/html/rfc6455>`__. WAMP is a *routed* protocol, so you need a **WAMP Router** to connect your **Autobahn\|Python** based clients. We provide `Crossbar.io <https://crossbar.io>`__, but there are `other options <https://wamp-proto.org/implementations.html#routers>`__ as well.

.. note::

Expand All @@ -35,14 +35,14 @@ You can use **Autobahn\|Python** to create clients and servers in Python speakin
Features
--------

- framework for `WebSocket <http://tools.ietf.org/html/rfc6455>`__ and `WAMP <http://wamp-proto.org/>`__ clients and servers
- runs on `CPython <http://python.org/>`__, `PyPy <http://pypy.org/>`__ and `Jython <http://jython.org/>`__
- runs under `Twisted <http://twistedmatrix.com/>`__ and `asyncio <http://docs.python.org/3.4/library/asyncio.html>`__ - implements WebSocket
`RFC6455 <http://tools.ietf.org/html/rfc6455>`__ and Draft Hybi-10+
- implements `WebSocket compression <http://tools.ietf.org/html/draft-ietf-hybi-permessage-compression>`__
- implements `WAMP <http://wamp-proto.org/>`__, the Web Application Messaging Protocol
- framework for `WebSocket <https://tools.ietf.org/html/rfc6455>`__ and `WAMP <https://wamp-proto.org/>`__ clients and servers
- runs on `CPython <https://python.org/>`__ and `PyPy <https://pypy.org/>`
- runs under `Twisted <https://twistedmatrix.com/>`__ and `asyncio <https://docs.python.org/3/library/asyncio.html>`__ - implements WebSocket
`RFC6455 <https://tools.ietf.org/html/rfc6455>`__ and Draft Hybi-10+
- implements `WebSocket compression <https://tools.ietf.org/html/draft-ietf-hybi-permessage-compression>`__
- implements `WAMP <https://wamp-proto.org/>`__, the Web Application Messaging Protocol
- high-performance, fully asynchronous implementation
- best-in-class standards conformance (100% strict passes with `Autobahn Testsuite <http://crossbar.io/autobahn#testsuite>`__: `Client <http://autobahn.ws/testsuite/reports/clients/index.html>`__ `Server <http://autobahn.ws/testsuite/reports/servers/index.html>`__)
- best-in-class standards conformance (100% strict passes with `Autobahn Testsuite <https://crossbar.io/autobahn#testsuite>`__: `Client <https://autobahn.ws/testsuite/reports/clients/index.html>`__ `Server <https://autobahn.ws/testsuite/reports/servers/index.html>`__)
- message-, frame- and streaming-APIs for WebSocket
- supports TLS (secure WebSocket) and proxies
- Open-source (`MIT license <https://github.com/crossbario/autobahn-python/blob/master/LICENSE>`__)
Expand Down Expand Up @@ -268,8 +268,9 @@ implementation, set the environment variable:
.. |Master Branch| image:: https://img.shields.io/badge/branch-master-orange.svg
:target: https://travis-ci.com/crossbario/autobahn-python.svg?branch=master

.. |Build Status| image:: https://travis-ci.com/crossbario/autobahn-python.svg?branch=master
:target: https://travis-ci.com/crossbario/autobahn-python
.. |Build Status| image:: https://github.com/crossbario/autobahn-python/workflows/main/badge.svg
:target: https://github.com/crossbario/autobahn-python/actions?query=workflow%3Amain
:alt: Build Status

.. |Coverage| image:: https://img.shields.io/codecov/c/github/crossbario/autobahn-python/master.svg
:target: https://codecov.io/github/crossbario/autobahn-python
Expand Down
2 changes: 1 addition & 1 deletion autobahn/_version.py
Expand Up @@ -24,4 +24,4 @@
#
###############################################################################

__version__ = '20.12.2'
__version__ = '20.12.3'
4 changes: 2 additions & 2 deletions autobahn/asyncio/wamp.py
Expand Up @@ -57,8 +57,8 @@ class ApplicationSession(protocol.ApplicationSession):
Implements:
* :class:`autobahn.wamp.interfaces.ITransportHandler`
* :class:`autobahn.wamp.interfaces.ISession`
* ``autobahn.wamp.interfaces.ITransportHandler``
* ``autobahn.wamp.interfaces.ISession``
"""

log = txaio.make_logger()
Expand Down
25 changes: 0 additions & 25 deletions autobahn/rawsocket/test/__init__.py

This file was deleted.

File renamed without changes.
25 changes: 0 additions & 25 deletions autobahn/twisted/test/__init__.py

This file was deleted.

Expand Up @@ -32,7 +32,7 @@
from zope.interface import directlyProvides
from autobahn.wamp.message import Welcome, Goodbye, Hello, Abort
from autobahn.wamp.serializer import JsonSerializer
from autobahn.test import FakeTransport
from autobahn.testutil import FakeTransport
from twisted.internet.interfaces import IStreamClientEndpoint
from twisted.internet.defer import inlineCallbacks, succeed, Deferred
from twisted.internet.task import Clock
Expand Down
Expand Up @@ -40,7 +40,7 @@
from twisted.internet.testing import StringTransport
except ImportError:
from twisted.test.proto_helpers import StringTransport
from autobahn.test import FakeTransport
from autobahn.testutil import FakeTransport


class ExceptionHandlingTests(unittest.TestCase):
Expand Down Expand Up @@ -386,7 +386,7 @@ class TestProto(WebSocketClientProtocol):
def onConnecting(self, transport_details):
raise RuntimeError("bad stuff")

from autobahn.test import FakeTransport
from autobahn.testutil import FakeTransport
proto = TestProto()
proto.transport = FakeTransport()
d = proto.startHandshake()
Expand Down
Expand Up @@ -31,7 +31,7 @@
WampRawSocketServerProtocol,
WampRawSocketClientFactory,
WampRawSocketClientProtocol)
from autobahn.test import FakeTransport
from autobahn.testutil import FakeTransport


class RawSocketHandshakeTests(unittest.TestCase):
Expand Down
10 changes: 4 additions & 6 deletions autobahn/wamp/component.py
Expand Up @@ -417,7 +417,7 @@ def __init__(self, main=None, transports=None, config=None, realm='realm1', extr
pass a main() procedure, the session will not be closed
(unless you arrange for .leave() to be called).

:type main: callable taking 2 args: reactor, ISession
:type main: callable taking two args ``reactor`` and ``ISession``

:param transports: Transport configurations for creating
transports. Each transport can be a WAMP URL, or a dict
Expand Down Expand Up @@ -445,25 +445,23 @@ def __init__(self, main=None, transports=None, config=None, realm='realm1', extr
- ``options``: tbd
- ``proxy``: tbd

:type transports: None or unicode or list of dicts
:type transports: None or str or list

:param realm: the realm to join
:type realm: unicode
:type realm: str

:param authentication: configuration of authenticators
:type authentication: dict mapping auth_type to dict
:type authentication: dict

:param session_factory: if None, ``ApplicationSession`` is
used, otherwise a callable taking a single ``config`` argument
that is used to create a new `ApplicationSession` instance.
:type session_factory: callable

:param is_fatal: a callable taking a single argument, an
``Exception`` instance. The callable should return ``True`` if
this error is "fatal", meaning we should not try connecting to
the current transport again. The default behavior (on None) is
to always return ``False``
:type is_fatal: callable taking one arg, or None
"""
self.set_valid_events(
[
Expand Down
4 changes: 2 additions & 2 deletions autobahn/wamp/protocol.py
Expand Up @@ -1775,8 +1775,8 @@ class _SessionShim(ApplicationSession):
ApplicationSession "directly".
**NOTE:** this is not public or intended for use; you should import
either :class:`autobahn.asyncio.wamp.Session` or
:class:`autobahn.twisted.wamp.Session` depending on which async
either autobahn.asyncio.wamp.Session or
autobahn.twisted.wamp.Session depending on which async
framework yo're using.
"""

Expand Down
25 changes: 0 additions & 25 deletions autobahn/wamp/test/__init__.py

This file was deleted.

File renamed without changes.
25 changes: 0 additions & 25 deletions autobahn/websocket/test/__init__.py

This file was deleted.