Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ Install by using:

## Development

The targets are `python2.7`, `python3.6` and up.
The targets are `python3.6` and up. `python 2.7` support was dropped in version `3.0.20211103`. For 2.7 support use:

The development environment requires `python3.6` as the `crossbar.io` based test server is unable to run in `python2.7`.
```
# For Python 2.7 support
pip install swampyer=2.20210513
```

Tox is used to automate the testing between the various python versions.

Expand Down
8 changes: 8 additions & 0 deletions VERSIONS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,11 @@
* Upgrade to simplejson for latest bugfixes, falling back on json
* Teach json serializer how to do memoryview and bytes
* Correct typo in extra_requires

2.20210513 - Thu May 13 14:46:32 UTC 2021
* Fix serializer discovery bug (was invoking available() on name, not object)

3.0.20211103 - Wed Nov 3 23:41:39 UTC 2021
* Drop Python 2.7 support
* Allow newer versions of libraries (don't restrict them so tightly for the sake of 2.7 support)

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[tool.poetry]
name = "swampyer"
description = "Simple WAMP library with minimal external dependencies"
version = '2.20210512'
version = '3.0.20211103'
authors = ["Aki Mimoto <aki@zaber.com>"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.dependencies]
python = ">=2.7,<3.0.0 || >=3.5.0,<4.0"
websocket-client = "^0.59.0"
certifi = "^2020.12.5"
python = ">=3.6.0,<4.0"
websocket-client = ">=0.59.0"
certifi = ">=2020.12.5"
six = "^1.16.0"
cbor = { version = "^1.0.0", optional = true }
msgpack = { version = "^1.0.2", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions swampyer/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ def available_serializers():
"""
serializers = []

for serializer in SERIALIZER_REGISTRY.keys():
if serializer in SERIALIZERS_BLACKLIST:
for serializer_name, serializer in SERIALIZER_REGISTRY.items():
if serializer_name in SERIALIZERS_BLACKLIST:
continue
try:
serializer.available()
serializers.append(serializer)
serializers.append(serializer_name)
except Exception:
pass

Expand Down
7 changes: 5 additions & 2 deletions tests/common.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ def get_password():

def connect_service(
url='ws://localhost:18080/ws',
serializer_code='json',
serializer_code=None,
concurrency_max=None,
concurrency_class=None,
concurrency_configs=None,
timeout=None
):
password = get_password()
serializers = None
if serializer_code:
serializers = [ serializer_code ]
client = swampyer.WAMPClientTicket(
url=url,
username=u"test",
password=six.u(password),
realm=u"realm1",
uri_base="",
timeout=timeout,
serializers=[serializer_code],
serializers=serializers,
auto_reconnect=False,
concurrency_max=concurrency_max,
concurrency_class=concurrency_class,
Expand Down
6 changes: 4 additions & 2 deletions tests/test_01_imports.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/python
#!/usr/bin/env python

def test_can_import():

ex = None
try:
import swampyer
except Exception as ex:
print("Error:", ex)
pass
assert ex == None


if __name__ == '__main__':
test_can_import()
7 changes: 5 additions & 2 deletions tests/test_02_connect.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from common import *
import logging
import sys
import time

import swampyer

Expand All @@ -13,7 +14,9 @@
#logging.basicConfig(stream=sys.stdout, level=1)

def test_connection():
connect_service()
cli = connect_service()
time.sleep(1)
return cli

if __name__ == '__main__':
print(connect_service())
print(test_connection())
2 changes: 1 addition & 1 deletion tests/test_03_websockets.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
from __future__ import print_function

from common import *
Expand Down
Empty file modified tests/test_04_tcp_sockets.py
100644 → 100755
Empty file.
Empty file modified tests/test_05_unix_sockets.py
100644 → 100755
Empty file.
Empty file modified tests/test_06_protocols.py
100644 → 100755
Empty file.
Empty file modified tests/test_07_concurrency.py
100644 → 100755
Empty file.
Empty file modified tests/test_08_concurrency_events.py
100644 → 100755
Empty file.
Empty file modified tests/test_09_windows_socket_error_10054.py
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = pypy3,py27,py36,py38,py39
envlist = pypy3,py36,py38,py39
isolated_build = True

[tox:.package]
Expand Down