From e9300ff308439dde5f8e23cb2b553adce39c913d Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:11 +0000 Subject: [PATCH 01/15] Update aiohttp from 3.3.2 to 3.4.4 --- demo/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/requirements.txt b/demo/requirements.txt index 6e68e196..13a52024 100644 --- a/demo/requirements.txt +++ b/demo/requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.3.2 +aiohttp==3.4.4 aiohttp-session==2.5.1 chevron==0.12.1 uvloop==0.10.2 From b63be63dd5efab7df81be3b91843e142807baff1 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:13 +0000 Subject: [PATCH 02/15] Update aiohttp-session from 2.5.1 to 2.7.0 --- demo/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/requirements.txt b/demo/requirements.txt index 13a52024..4af91006 100644 --- a/demo/requirements.txt +++ b/demo/requirements.txt @@ -1,4 +1,4 @@ aiohttp==3.4.4 -aiohttp-session==2.5.1 +aiohttp-session==2.7.0 chevron==0.12.1 uvloop==0.10.2 From 02fdd345e013a3b82eabf74074148bc77f1c26f9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:15 +0000 Subject: [PATCH 03/15] Update chevron from 0.12.1 to 0.13.1 --- demo/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/requirements.txt b/demo/requirements.txt index 4af91006..a0167790 100644 --- a/demo/requirements.txt +++ b/demo/requirements.txt @@ -1,4 +1,4 @@ aiohttp==3.4.4 aiohttp-session==2.7.0 -chevron==0.12.1 +chevron==0.13.1 uvloop==0.10.2 From cc391027944bd087dc6e967824e40f9f84527cf6 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:16 +0000 Subject: [PATCH 04/15] Update uvloop from 0.10.2 to 0.11.3 --- demo/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/requirements.txt b/demo/requirements.txt index a0167790..8705171e 100644 --- a/demo/requirements.txt +++ b/demo/requirements.txt @@ -1,4 +1,4 @@ aiohttp==3.4.4 aiohttp-session==2.7.0 chevron==0.13.1 -uvloop==0.10.2 +uvloop==0.11.3 From 1c4df0c8238933ff9a47380fa6d4635a22330c4e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:18 +0000 Subject: [PATCH 05/15] Update sphinx from 1.7.5 to 1.8.1 --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 44055550..3e85d58e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ docutils==0.14 Pygments==2.2.0 -Sphinx==1.7.5 +Sphinx==1.8.1 sphinxcontrib-websupport==1.1.0 From 8832bc4f94475add3e27999fad62bdd95d61aced Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:19 +0000 Subject: [PATCH 06/15] Update flake8 from 3.5.0 to 3.6.0 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index b552815a..d85ebd35 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,6 +1,6 @@ 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 From 02f862b90ed462f2971dc0c37a985c7d967f43db Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:21 +0000 Subject: [PATCH 07/15] Update mypy from 0.610 to 0.641 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index d85ebd35..5fb2da2d 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,7 +2,7 @@ coverage==4.5.1 docutils==0.14 flake8==3.6.0 isort==4.3.4 -mypy==0.610 +mypy==0.641 pycodestyle==2.3.1 pyflakes==2.0.0 pytest==3.6.2 From e166f8fdc9a49d999b9e127a32adfe419d0b2fa3 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:22 +0000 Subject: [PATCH 08/15] Update pycodestyle from 2.3.1 to 2.4.0 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 5fb2da2d..6e631771 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,7 +3,7 @@ docutils==0.14 flake8==3.6.0 isort==4.3.4 mypy==0.641 -pycodestyle==2.3.1 +pycodestyle==2.4.0 pyflakes==2.0.0 pytest==3.6.2 pytest-aiohttp==0.3.0 From a9786c6c6b5720b1b27fa543faa7ae16352918a9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:24 +0000 Subject: [PATCH 09/15] Update pytest from 3.6.2 to 3.9.3 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 6e631771..123fb988 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,7 +5,7 @@ isort==4.3.4 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 From 848bda759773c2b60fd1108184493ebbe033d1ad Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:26 +0000 Subject: [PATCH 10/15] Update pytest-cov from 2.5.1 to 2.6.0 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 123fb988..51548b3b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -7,7 +7,7 @@ pycodestyle==2.4.0 pyflakes==2.0.0 pytest==3.9.3 pytest-aiohttp==0.3.0 -pytest-cov==2.5.1 +pytest-cov==2.6.0 pytest-isort==0.2.0 pytest-mock==1.10.0 pytest-sugar==0.9.1 From 28017b83c599cdeabb8d7812fb6d53fb12cd9b38 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:28 +0000 Subject: [PATCH 11/15] Update pytest-isort from 0.2.0 to 0.2.1 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 51548b3b..bf8ddfd8 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -8,7 +8,7 @@ pyflakes==2.0.0 pytest==3.9.3 pytest-aiohttp==0.3.0 pytest-cov==2.6.0 -pytest-isort==0.2.0 +pytest-isort==0.2.1 pytest-mock==1.10.0 pytest-sugar==0.9.1 pytest-timeout==1.3.0 From cd039726cb0d77d3b05776d25ca850ab7d16822a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:29 +0000 Subject: [PATCH 12/15] Update pytest-timeout from 1.3.0 to 1.3.2 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index bf8ddfd8..e1eccef0 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -11,6 +11,6 @@ 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-timeout==1.3.2 pytest-toolbox==0.4 pytz==2018.5 From e5063fc256994f455df7dc40ff87ca55416aedc2 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Thu, 1 Nov 2018 17:15:31 +0000 Subject: [PATCH 13/15] Update pytz from 2018.5 to 2018.7 --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index e1eccef0..04cb86f3 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -13,4 +13,4 @@ pytest-mock==1.10.0 pytest-sugar==0.9.1 pytest-timeout==1.3.2 pytest-toolbox==0.4 -pytz==2018.5 +pytz==2018.7 From df0f8d774de492b1f230954c2b3c9f10eb28ec91 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 15 Nov 2018 10:44:12 +0000 Subject: [PATCH 14/15] fix linting --- arq/worker.py | 2 +- setup.cfg | 3 +++ tests/requirements.txt | 2 +- tests/test_cli.py | 4 ++-- tests/test_customisation.py | 2 +- tests/test_main.py | 14 +++++++------- tests/test_worker.py | 10 +++++----- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/arq/worker.py b/arq/worker.py index 046595ee..6f4351ae 100644 --- a/arq/worker.py +++ b/arq/worker.py @@ -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 diff --git a/setup.cfg b/setup.cfg index c5e2f665..fa2aa8ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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+ diff --git a/tests/requirements.txt b/tests/requirements.txt index 04cb86f3..8dcfd70d 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -10,7 +10,7 @@ pytest-aiohttp==0.3.0 pytest-cov==2.6.0 pytest-isort==0.2.1 pytest-mock==1.10.0 -pytest-sugar==0.9.1 +pytest-sugar==0.9.2 pytest-timeout==1.3.2 pytest-toolbox==0.4 pytz==2018.7 diff --git a/tests/test_cli.py b/tests/test_cli.py index 824bbb77..828d3588 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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') @@ -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 diff --git a/tests/test_customisation.py b/tests/test_customisation.py index 01f7538a..9e020fc7 100644 --- a/tests/test_customisation.py +++ b/tests/test_customisation.py @@ -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 == (" has a different " "list of queues to the first shadow: ('dft', 'foobar') != ('high', 'dft', 'low')") await worker.close() diff --git a/tests/test_main.py b/tests/test_main.py index 45de7b7b..0e555046 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -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-", log) + log = re.sub(r'0.0\d\ds', '0.0XXs', caplog.log) + log = re.sub(r"arq:quit-.*", "arq:quit-", log) log = re.sub(r'\d{4}-\d+-\d+ \d+:\d+:\d+', '', log) log = re.sub(r'\w{3}-\d+ \d+:\d+:\d+', '', log) print(log) @@ -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 ,', 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 ,', 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+', '', log) log = re.sub(r'\w{3}-\d+ \d+:\d+:\d+', '', log) print(log) @@ -144,7 +144,7 @@ class BadActor(Actor): async def test_custom_name(loop, caplog): actor = FoobarActor(loop=loop) - assert re.match('^$', str(actor)) + assert re.match(r'^$', str(actor)) await actor.concat('123', '456') worker = MockRedisWorker(burst=True, loop=actor.loop, shadows=[FoobarActor]) worker.mock_data = actor.mock_data @@ -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 diff --git a/tests/test_worker.py b/tests/test_worker.py index cfb0f221..4b51d2f6 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -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 @@ -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 ● " @@ -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): @@ -67,7 +67,7 @@ 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): @@ -75,7 +75,7 @@ async def test_separate_log_levels(mock_actor_worker, caplog): 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' From fd46b916f5b263d0d96c99f0470f86937afc6440 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 15 Nov 2018 11:33:42 +0000 Subject: [PATCH 15/15] remove 'coverage combine' --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1e82c6e0..4b2b4df6 100644 --- a/Makefile +++ b/Makefile @@ -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