Skip to content

Commit

Permalink
Scheduled monthly dependency update for November (#104)
Browse files Browse the repository at this point in the history
* Update aiohttp from 3.3.2 to 3.4.4

* Update aiohttp-session from 2.5.1 to 2.7.0

* Update chevron from 0.12.1 to 0.13.1

* Update uvloop from 0.10.2 to 0.11.3

* Update sphinx from 1.7.5 to 1.8.1

* Update flake8 from 3.5.0 to 3.6.0

* Update mypy from 0.610 to 0.641

* Update pycodestyle from 2.3.1 to 2.4.0

* Update pytest from 3.6.2 to 3.9.3

* Update pytest-cov from 2.5.1 to 2.6.0

* Update pytest-isort from 0.2.0 to 0.2.1

* Update pytest-timeout from 1.3.0 to 1.3.2

* Update pytz from 2018.5 to 2018.7

* fix linting

* remove 'coverage combine'
  • Loading branch information
pyup-bot authored and samuelcolvin committed Nov 15, 2018
1 parent fa9c3e8 commit 8f2033b
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ lint:

.PHONY: test
test:
TZ=Asia/Singapore pytest --cov=arq && coverage combine
TZ=Asia/Singapore pytest --cov=arq

.PHONY: testcov
testcov:
TZ=Asia/Singapore pytest --cov=arq && (echo "building coverage html"; coverage combine; coverage html)
TZ=Asia/Singapore pytest --cov=arq && (echo "building coverage html"; coverage html)

.PHONY: all
all: testcov lint
Expand Down
2 changes: 1 addition & 1 deletion arq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(self, *,
self.queues: Optional[List[str]] = queues
self.timeout_seconds = timeout_seconds or self.timeout_seconds

self._shadow_lookup: Dict[str, Actor] = {}
self._shadow_lookup: Dict[str, Actor] = {}
self.start: Optional[float] = None
self.last_health_check = 0
self._last_health_check_log = None
Expand Down
8 changes: 4 additions & 4 deletions demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
aiohttp==3.3.2
aiohttp-session==2.5.1
chevron==0.12.1
uvloop==0.10.2
aiohttp==3.4.4
aiohttp-session==2.7.0
chevron==0.13.1
uvloop==0.11.3
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docutils==0.14
Pygments==2.2.0
Sphinx==1.7.5
Sphinx==1.8.1
sphinxcontrib-websupport==1.1.0
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ timeout = 5
filterwarnings =
error
ignore::DeprecationWarning:isort.settings
ignore::ImportWarning:msgpack

[flake8]
max-complexity = 10
max-line-length = 120
# remove E252 once https://github.com/PyCQA/pycodestyle/issues/753 is released
ignore = E252

[bdist_wheel]
python-tag = py35+
Expand Down
18 changes: 9 additions & 9 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
coverage==4.5.1
docutils==0.14
flake8==3.5.0
flake8==3.6.0
isort==4.3.4
mypy==0.610
pycodestyle==2.3.1
mypy==0.641
pycodestyle==2.4.0
pyflakes==2.0.0
pytest==3.6.2
pytest==3.9.3
pytest-aiohttp==0.3.0
pytest-cov==2.5.1
pytest-isort==0.2.0
pytest-cov==2.6.0
pytest-isort==0.2.1
pytest-mock==1.10.0
pytest-sugar==0.9.1
pytest-timeout==1.3.0
pytest-sugar==0.9.2
pytest-timeout==1.3.2
pytest-toolbox==0.4
pytz==2018.5
pytz==2018.7
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_simple_burst(tmpworkdir, monkeypatch):
runner = CliRunner()
result = runner.invoke(cli, ['--burst', 'test.py'])
assert result.exit_code == 0
output = re.sub('\d+:\d+:\d+', 'TIME', result.output)
output = re.sub(r'\d+:\d+:\d+', 'TIME', result.output)
assert output == ('TIME MainProcess: starting work process "WorkProcess"\n'
'TIME MainProcess: worker process exited ok\n')

Expand All @@ -37,7 +37,7 @@ def test_worker_exited_badly(tmpworkdir, monkeypatch):
runner = CliRunner()
result = runner.invoke(cli, ['--burst', 'test.py'])
assert result.exit_code == 3
output = re.sub('\d+:\d+:\d+', 'TIME', result.output)
output = re.sub(r'\d+:\d+:\d+', 'TIME', result.output)
assert ('TIME MainProcess: starting work process "WorkProcess"\n'
'TIME MainProcess: worker process 123 exited badly with exit code 42\n') == output

Expand Down
2 changes: 1 addition & 1 deletion tests/test_customisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class DifferentQueuesActor(DemoActor):
worker = DatetimeWorker(loop=loop, burst=True, shadows=[DemoActor, DemoActor, DifferentQueuesActor])
with pytest.raises(TypeError) as excinfo:
await worker.run()
msg = re.sub('0x\w+>', '0x123>', excinfo.value.args[0])
msg = re.sub(r'0x\w+>', '0x123>', excinfo.value.args[0])
assert msg == ("<DifferentQueuesActor(DifferentQueuesActor) at 0x123> has a different "
"list of queues to the first shadow: ('dft', 'foobar') != ('high', 'dft', 'low')")
await worker.close()
Expand Down
14 changes: 7 additions & 7 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ async def test_dispatch_work(tmpworkdir, loop, caplog, redis_conn):
assert not tmpworkdir.join('add_numbers').exists()
await worker.run()
assert tmpworkdir.join('add_numbers').read() == '3'
log = re.sub('0.0\d\ds', '0.0XXs', caplog.log)
log = re.sub("arq:quit-.*", "arq:quit-<random>", log)
log = re.sub(r'0.0\d\ds', '0.0XXs', caplog.log)
log = re.sub(r"arq:quit-.*", "arq:quit-<random>", log)
log = re.sub(r'\d{4}-\d+-\d+ \d+:\d+:\d+', '<date time>', log)
log = re.sub(r'\w{3}-\d+ \d+:\d+:\d+', '<date time2>', log)
print(log)
Expand Down Expand Up @@ -102,9 +102,9 @@ async def test_handle_exception(loop, caplog):
worker = MockRedisWorker(burst=True, loop=actor.loop)
worker.mock_data = actor.mock_data
await worker.run()
log = re.sub('0.0\d\ds', '0.0XXs', caplog.log)
log = re.sub(', line \d+,', ', line <no>,', log)
log = re.sub('"/.*?/(\w+/\w+)\.py"', r'"/path/to/\1.py"', log)
log = re.sub(r'0.0\d\ds', '0.0XXs', caplog.log)
log = re.sub(r', line \d+,', ', line <no>,', log)
log = re.sub(r'"/.*?/(\w+/\w+)\.py"', r'"/path/to/\1.py"', log)
log = re.sub(r'\d{4}-\d+-\d+ \d+:\d+:\d+', '<date time>', log)
log = re.sub(r'\w{3}-\d+ \d+:\d+:\d+', '<date time2>', log)
print(log)
Expand Down Expand Up @@ -144,7 +144,7 @@ class BadActor(Actor):

async def test_custom_name(loop, caplog):
actor = FoobarActor(loop=loop)
assert re.match('^<FoobarActor\(foobar\) at 0x[a-f0-9]{12}>$', str(actor))
assert re.match(r'^<FoobarActor\(foobar\) at 0x[a-f0-9]{12}>$', str(actor))
await actor.concat('123', '456')
worker = MockRedisWorker(burst=True, loop=actor.loop, shadows=[FoobarActor])
worker.mock_data = actor.mock_data
Expand All @@ -160,7 +160,7 @@ async def test_call_direct(mock_actor_worker, caplog):
await worker.run()
assert worker.jobs_failed == 0
assert worker.jobs_complete == 1
log = re.sub('0.0\d\ds', '0.0XXs', caplog.log)
log = re.sub(r'0.0\d\ds', '0.0XXs', caplog.log)
assert ('arq.jobs: dft queued 0.0XXs → __id__ MockRedisDemoActor.direct_method(1, 2)\n'
'arq.jobs: dft ran in 0.0XXs ← __id__ MockRedisDemoActor.direct_method ● 3') in log

Expand Down
10 changes: 5 additions & 5 deletions tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def test_long_args(mock_actor_worker, caplog):
v = ','.join(map(str, range(20)))
await actor.concat(a=v, b=v)
await worker.run()
log = caplog(('0.0\d\ds', '0.0XXs'))
log = caplog((r'0.0\d\ds', '0.0XXs'))
print(log)
assert ("dft queued 0.0XXs → __id__ MockRedisDemoActor.concat"
"(a='0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19', b='0,1,2,3,4,5,6,7,8,9,1…)\n") in log
Expand All @@ -45,7 +45,7 @@ async def test_longer_args(mock_actor_worker, caplog):
v = ','.join(map(str, range(20)))
await actor.concat(a=v, b=v)
await worker.run()
log = caplog(('0.0\d\ds', '0.0XXs'))
log = caplog((r'0.0\d\ds', '0.0XXs'))
assert ("dft queued 0.0XXs → __id__ MockRedisDemoActor.concat"
"(a='0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19', b='0,1,2,3,4,5,6,7,8,9,10,11,12,13…)\n") in log
assert ("dft ran in 0.0XXs ← __id__ MockRedisDemoActor.concat ● "
Expand All @@ -58,7 +58,7 @@ async def test_stop_job_normal(mock_actor_worker, caplog):
await actor.stop_job_normal()
await worker.run()
assert ('arq.jobs INFO: dft ran in 0.0XXs ■ __id__ MockRedisDemoActor.stop_job_normal ● Stopped '
'stopping job normally') in caplog(('0.0\d\ds', '0.0XXs'))
'stopping job normally') in caplog((r'0.0\d\ds', '0.0XXs'))


async def test_stop_job_warning(mock_actor_worker, caplog):
Expand All @@ -67,15 +67,15 @@ async def test_stop_job_warning(mock_actor_worker, caplog):
await actor.stop_job_warning()
await worker.run()
assert ('arq.jobs WARNING: dft ran in 0.0XXs ■ __id__ MockRedisDemoActor.stop_job_warning ● Stopped Warning '
'stopping job with warning') in caplog(('0.0\d\ds', '0.0XXs'))
'stopping job with warning') in caplog((r'0.0\d\ds', '0.0XXs'))


async def test_separate_log_levels(mock_actor_worker, caplog):
caplog.set_different_level(**{'arq.work': logging.INFO, 'arq.jobs': logging.WARNING})
actor, worker = mock_actor_worker
await actor.concat(a='1', b='2')
await worker.run()
log = caplog(('0.0\d\ds', '0.0XXs'))
log = caplog((r'0.0\d\ds', '0.0XXs'))
assert ('arq.work: Initialising work manager, burst mode: True, creating shadows...\n'
'arq.work: Running worker with 1 shadow listening to 3 queues\n'
'arq.work: shadows: MockRedisDemoActor | queues: high, dft, low\n'
Expand Down

0 comments on commit 8f2033b

Please sign in to comment.