Skip to content

Commit

Permalink
fix docker images for xbr (#1255)
Browse files Browse the repository at this point in the history
* fix docker images for xbr
* add ethereum bip39/32 helpers
* more asyncio options
* update xbr abi files
* aio fixes
* fix CI deps
* bump version
  • Loading branch information
oberstet committed Nov 7, 2019
1 parent cbf337c commit 24a5d6e
Show file tree
Hide file tree
Showing 32 changed files with 16,513 additions and 18,744 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ install:
-pip uninstall -y pytest_asyncio # remove the broken shit
-pip uninstall -y pytest_cov # remove the broken shit
# enforce use of bundled libsodium
-pip install --force-reinstall git+https://github.com/crossbario/py-eth-sig-utils.git@master#egg=py-eth-sig-utils
AUTOBAHN_USE_NVX=1 SODIUM_INSTALL=bundled pip install -e .[all]

build:
Expand Down Expand Up @@ -69,6 +68,10 @@ spelling:
cd docs && sphinx-build -b spelling . _spelling


test_mnemonic:
# python -m pytest -rsx autobahn/xbr/test/test_mnemonic.py
USE_TWISTED=1 trial autobahn.xbr.test

test_nvx:
python -m pytest -rsx autobahn/nvx/test
USE_TWISTED=1 trial autobahn.nvx.test.test_utf8validator
Expand Down
2 changes: 1 addition & 1 deletion autobahn/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
#
###############################################################################

__version__ = u'19.10.1'
__version__ = u'19.11.1'
35 changes: 20 additions & 15 deletions autobahn/asyncio/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def start(self, loop=None):
return self._start(loop=loop)


def run(components, log_level='info'):
def run(components, start_loop=True, log_level='info'):
"""
High-level API to run a series of components.
Expand All @@ -338,6 +338,10 @@ def run(components, log_level='info'):
:param components: the Component(s) you wish to run
:type components: Component or list of Components
:param start_loop: When ``True`` (the default) this method
start a new asyncio loop.
:type start_loop: bool
:param log_level: a valid log-level (or None to avoid calling start_logging)
:type log_level: string
"""
Expand Down Expand Up @@ -397,17 +401,18 @@ def done_callback(loop, arg):
# returns a future; could run_until_complete() but see below
component._run(loop, components, done_callback)

try:
loop.run_forever()
# this is probably more-correct, but then you always get
# "Event loop stopped before Future completed":
# loop.run_until_complete(f)
except asyncio.CancelledError:
pass
# finally:
# signal.signal(signal.SIGINT, signal.SIG_DFL)
# signal.signal(signal.SIGTERM, signal.SIG_DFL)

# Close the event loop at the end, otherwise an exception is
# thrown. https://bugs.python.org/issue23548
loop.close()
if start_loop:
try:
loop.run_forever()
# this is probably more-correct, but then you always get
# "Event loop stopped before Future completed":
# loop.run_until_complete(f)
except asyncio.CancelledError:
pass
# finally:
# signal.signal(signal.SIGINT, signal.SIG_DFL)
# signal.signal(signal.SIGTERM, signal.SIG_DFL)

# Close the event loop at the end, otherwise an exception is
# thrown. https://bugs.python.org/issue23548
loop.close()
7 changes: 7 additions & 0 deletions autobahn/asyncio/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@

from __future__ import absolute_import

try:
from asyncio import sleep # noqa
except ImportError:
# Trollius >= 0.3 was renamed to asyncio
# noinspection PyUnresolvedReferences
from trollius import sleep # noqa

__all = (
'sleep',
'peer2str',
Expand Down

0 comments on commit 24a5d6e

Please sign in to comment.