Skip to content

Commit

Permalink
Merge pull request #225 from ploxiln/flake8_3.6
Browse files Browse the repository at this point in the history
tests: explicitly install flake8 3.6.0 on travis-ci
  • Loading branch information
mreiferson authored Oct 31, 2018
2 parents 1afef71 + 5320e20 commit 916ef47
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/nsq_to_nsq.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _on_message_response(self, conn, data, nsq_message, writer):
assert tornado.options.options.destination_nsqd_tcp_address
assert tornado.options.options.channel

destination_topic = str(tornado.options.options.destination_topic or
destination_topic = str(tornado.options.options.destination_topic or # noqa: W504
tornado.options.options.topic)
lookupd_http_addresses = map(lambda addr: 'http://' + addr,
tornado.options.options.lookupd_http_address)
Expand Down
4 changes: 2 additions & 2 deletions nsq/legacy_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class LegacyReader(object):
from nsq import LegacyReader as Reader
"""
def __init__(self, *args, **kwargs):
warnings.warn('LegacyReader is a deprecated wrapper and will be removed in a future' +
' release. Use (multiple) Reader(s) each with their own' +
warnings.warn('LegacyReader is a deprecated wrapper and will be removed in a future'
' release. Use (multiple) Reader(s) each with their own'
' message handler.', DeprecationWarning)

old_params = {}
Expand Down
4 changes: 2 additions & 2 deletions nsq/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


class Reader(Client):
"""
r"""
Reader provides high-level functionality for building robust NSQ consumers in Python
on top of the async module.
Expand Down Expand Up @@ -733,7 +733,7 @@ def cast(x):

if self.disabled.__code__ != Reader.disabled.__code__ and \
semver(data['version']) >= semver('0.3'):
warnings.warn('disabled() is deprecated and will be removed in a future release, ' +
warnings.warn('disabled() is deprecated and will be removed in a future release, '
'use set_max_in_flight(0) instead', DeprecationWarning)
return super(Reader, self)._on_connection_identify_response(conn, data, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion nsq/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


class Writer(Client):
"""
r"""
A high-level producer class built on top of the `Tornado IOLoop <http://tornadoweb.org>`_
supporting async publishing (``PUB`` & ``MPUB`` & ``DPUB``) of messages
to ``nsqd`` over the TCP protocol.
Expand Down
8 changes: 4 additions & 4 deletions tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
@pytest.mark.parametrize(['cmd_method', 'kwargs', 'result'], [
pytest.param(protocol.identify,
{'data': identify_dict_ascii},
b'IDENTIFY\n' + struct_l.pack(len(identify_body_ascii)) +
to_bytes(identify_body_ascii),
b'IDENTIFY\n' + struct_l.pack(len(identify_body_ascii))
+ to_bytes(identify_body_ascii), # noqa: W503
id="identify-ascii"),
pytest.param(protocol.identify,
{'data': identify_dict_unicode},
b'IDENTIFY\n' + struct_l.pack(len(identify_body_unicode)) +
to_bytes(identify_body_unicode),
b'IDENTIFY\n' + struct_l.pack(len(identify_body_unicode))
+ to_bytes(identify_body_unicode), # noqa: W503
id="identify-unicode"),
pytest.param(protocol.subscribe,
{'topic': 'test_topic', 'channel': 'test_channel'},
Expand Down
15 changes: 5 additions & 10 deletions travis_test.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/bin/sh
set -eu

install_nsq () {
wget "http://bitly-downloads.s3.amazonaws.com/nsq/$NSQ_DOWNLOAD.tar.gz"
tar zxvf "$NSQ_DOWNLOAD.tar.gz"
}

install_snappy () {
# install snappy from source so we can compile with `-fPIC` witout having to sudo install stuff
git clone https://github.com/google/snappy.git
Expand All @@ -18,19 +13,19 @@ install_snappy () {
}

echo "travis_fold:start:install.nsq"
install_nsq
wget "http://bitly-downloads.s3.amazonaws.com/nsq/$NSQ_DOWNLOAD.tar.gz"
tar zxvf "$NSQ_DOWNLOAD.tar.gz"
echo "travis_fold:end:install.nsq"

echo "travis_fold:start:install.snappy"
install_snappy
echo "travis_fold:end:install.snappy"

echo "travis_fold:start:install.pythondeps"
pip install flake8
pip install pytest==3.6.3
pip install certifi
pip install tornado=="$TORNADO_VERSION"
pip install pytest==3.6.3 flake8==3.6.0 certifi
PYCURL_SSL_LIBRARY=openssl pip install pycurl
CPPFLAGS="-I$HOME/usr/local/include -L$HOME/usr/local/lib -fPIC" pip install python-snappy
pip install tornado=="$TORNADO_VERSION"
echo "travis_fold:end:install.pythondeps"

# Finally, run some tests!
Expand Down

0 comments on commit 916ef47

Please sign in to comment.