Skip to content

Commit

Permalink
Merge pull request #134 from aio-libs/fixtravis
Browse files Browse the repository at this point in the history
Attempt to fix Travis build
  • Loading branch information
JelleZijlstra committed Jun 16, 2018
2 parents 5ab1d97 + 492d916 commit 5f93b0e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python

python:
- "3.3"
- "3.4"
- "3.5"

Expand All @@ -14,13 +13,13 @@ install:
- python setup.py install
- test $USE_MSGPACK == 1 && pip install msgpack-python || true
- pip install pyflakes
- pip install pep8
- pip install pycodestyle
- pip install docutils
- pip install codecov

script:
- python -c "import zmq; print('ZMQ version:', zmq.zmq_version())"
- pep8 aiozmq examples tests benchmarks
- pycodestyle aiozmq examples tests benchmarks
- pyflakes .
- python setup.py check -rm
- if python -c "import sys; sys.exit(sys.version_info < (3,5))"; then
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ doc:
echo "open file://`pwd`/docs/_build/html/index.html"

pep:
pep8 aiozmq examples tests
pycodestyle aiozmq examples tests

flake:
$(PYFLAKES) .
Expand Down
2 changes: 1 addition & 1 deletion aiozmq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

def _parse_version(ver):
RE = (r'^(?P<major>\d+)\.(?P<minor>\d+)\.'
'(?P<micro>\d+)((?P<releaselevel>[a-z]+)(?P<serial>\d+)?)?$')
r'(?P<micro>\d+)((?P<releaselevel>[a-z]+)(?P<serial>\d+)?)?$')
match = re.match(RE, ver)
try:
major = int(match.group('major'))
Expand Down
1 change: 1 addition & 0 deletions aiozmq/_test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def _is_ipv6_enabled(): # pragma: no cover
sock.close()
return False


IPV6_ENABLED = _is_ipv6_enabled()


Expand Down
2 changes: 1 addition & 1 deletion aiozmq/cli/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def serve_proxy(options):
zmq.proxy(front, back, monitor)
else:
zmq.proxy(front, back)
except:
except Exception:
return
finally:
front.close()
Expand Down
2 changes: 1 addition & 1 deletion aiozmq/rpc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if hasattr(asyncio, 'ensure_future'):
ensure_future = asyncio.ensure_future
else: # Deprecated since Python version 3.4.4.
ensure_future = asyncio.async
ensure_future = getattr(asyncio, 'async')


class Error(Exception):
Expand Down
2 changes: 1 addition & 1 deletion aiozmq/rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def msg_received(self, data):
name = bname.decode('utf-8')
args = self.packer.unpackb(bargs)
kwargs = self.packer.unpackb(bkwargs)
except Exception as exc:
except Exception:
logger.critical("Cannot unpack %r", data, exc_info=sys.exc_info())
return
try:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
msgpack-python>=0.4.2
pep8>=1.5.6
pycodestyle>=2.4.0
pyflakes>=0.8.1
pyzmq>=14.2.0
wheel>=0.23.0
Expand Down
6 changes: 3 additions & 3 deletions tests/rpc_func_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def custom_annotation(self, arg: my_checker):

@aiozmq.rpc.method
@asyncio.coroutine
def ret_annotation(self, arg: int=1) -> float:
def ret_annotation(self, arg: int = 1) -> float:
return float(arg)
yield

Expand All @@ -48,7 +48,7 @@ def bad_return(self, arg) -> int:
yield

@aiozmq.rpc.method
def has_default(self, arg: int=None):
def has_default(self, arg: int = None):
return arg


Expand Down Expand Up @@ -88,7 +88,7 @@ def test(good_arg: int, bad_arg: 0):
msg = "Expected return annotation to be callable"
with self.assertRaisesRegex(ValueError, msg):
@aiozmq.rpc.method
def test2() -> 'bad annotation':
def test2() -> 'int':
pass

def test_no_params(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/rpc_pipeline_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def func(self, arg):

@asyncio.coroutine
@aiozmq.rpc.method
def add(self, arg: int=1):
def add(self, arg: int = 1):
yield from self.queue.put(arg + 1)

@aiozmq.rpc.method
Expand Down
10 changes: 5 additions & 5 deletions tests/selectors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
socketpair = socket.socketpair
else:
def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
with socket.socket(family, type, proto) as l:
l.bind(('127.0.0.1', 0))
l.listen(3)
with socket.socket(family, type, proto) as server:
server.bind(('127.0.0.1', 0))
server.listen(3)
c = socket.socket(family, type, proto)
try:
c.connect(l.getsockname())
c.connect(server.getsockname())
caddr = c.getsockname()
while True:
a, addr = l.accept()
a, addr = server.accept()
# check that we've got the correct client
if addr == caddr:
return c, a
Expand Down

0 comments on commit 5f93b0e

Please sign in to comment.