Skip to content

Commit 5dabb18

Browse files
pyup-botsamuelcolvin
authored andcommitted
Scheduled monthly dependency update for December (#27)
* Update pygments from 2.2.0 to 2.3.0 * Update pygments from 2.2.0 to 2.3.0 * Update sphinx from 1.6.5 to 1.8.2 * Update sphinxcontrib-websupport from 1.0.1 to 1.1.0 * Update coverage from 4.4.1 to 4.5.2 * Update flake8 from 3.5.0 to 3.6.0 * Update isort from 4.2.15 to 4.3.4 * Update pycodestyle from 2.3.1 to 2.4.0 * Update pyflakes from 1.6.0 to 2.0.0 * Update pytest from 3.2.3 to 4.0.1 * Update pytest-cov from 2.5.1 to 2.6.0 * Update pytest-isort from 0.1.0 to 0.2.1 * Update pytest-mock from 1.6.3 to 1.10.0 * Update pytest-sugar from 0.9.0 to 0.9.2 * Update pytest-toolbox from 0.2 to 0.4 * fixing tests and regexes * fix python version checks * travis faffing
1 parent a348d95 commit 5dabb18

File tree

11 files changed

+70
-58
lines changed

11 files changed

+70
-58
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
env/
33
env35/
44
env36/
5+
env37/
56
*.py[cod]
67
*.egg-info/
78
build/

.travis.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ language: python
22

33
cache: pip
44

5-
python:
6-
- '3.5'
7-
- '3.6'
8-
- 'nightly' # currently 3.7
9-
105
matrix:
6+
include:
7+
- python: '3.5'
8+
- python: '3.6'
9+
- python: '3.7'
10+
dist: xenial
11+
sudo: required
12+
- python: '3.8-dev'
13+
dist: xenial
14+
sudo: required
15+
1116
allow_failures:
12-
- python: 'nightly'
17+
- python: '3.8-dev'
1318

1419
install:
1520
- make install-test

devtools/ansi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Any
55

66
_ansi_template = '\033[{}m'
7-
_ansi_re = re.compile('\033\[((?:\d|;)*)([a-zA-Z])')
7+
_ansi_re = re.compile('\033\\[((?:\\d|;)*)([a-zA-Z])')
88

99
__all__ = 'sformat', 'sprint'
1010

@@ -68,7 +68,7 @@ class Style(IntEnum):
6868
# this is a meta value used for the "Style" instance which is the "style" function
6969
function = -1
7070

71-
def __call__(self, input: Any, *styles, reset: bool=True, apply: bool=True):
71+
def __call__(self, input: Any, *styles, reset: bool = True, apply: bool = True):
7272
"""
7373
Styles text with ANSI styles and returns the new string.
7474

devtools/debug.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ class Debug:
9393
)
9494

9595
def __init__(self, *,
96-
warnings: Optional[bool]=None,
97-
highlight: Optional[bool]=None,
98-
frame_context_length: int=50):
96+
warnings: Optional[bool] = None,
97+
highlight: Optional[bool] = None,
98+
frame_context_length: int = 50):
9999
self._show_warnings = self._env_bool(warnings, 'PY_DEVTOOLS_WARNINGS', True)
100100
self._highlight = self._env_bool(highlight, 'PY_DEVTOOLS_HIGHLIGHT', None)
101101
# 50 lines should be enough to make sure we always get the entire function definition
@@ -271,7 +271,7 @@ def _get_offsets(func_ast):
271271
for kw in func_ast.keywords:
272272
yield kw.value.lineno - 2, kw.value.col_offset - len(kw.arg) - 2
273273

274-
def _warn(self, msg, category: Type[Warning]=RuntimeWarning):
274+
def _warn(self, msg, category: Type[Warning] = RuntimeWarning):
275275
if self._show_warnings:
276276
warnings.warn(msg, category)
277277

devtools/prettier.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import collections
21
import io
32
import os
43
import textwrap
5-
from typing import Any, Generator, Union
4+
from collections import OrderedDict
5+
from collections.abc import Generator
6+
from typing import Any, Union
67

78
from .ansi import isatty
89

@@ -53,10 +54,10 @@ def __init__(self,
5354
(bytes, self._format_bytes),
5455
(tuple, self._format_tuples),
5556
((list, set, frozenset), self._format_list_like),
56-
(collections.Generator, self._format_generators),
57+
(Generator, self._format_generators),
5758
]
5859

59-
def __call__(self, value: Any, *, indent: int=0, indent_first: bool=False, highlight: bool=False):
60+
def __call__(self, value: Any, *, indent: int = 0, indent_first: bool = False, highlight: bool = False):
6061
self._stream = io.StringIO()
6162
self._format(value, indent_current=indent, indent_first=indent_first)
6263
s = self._stream.getvalue()
@@ -70,7 +71,7 @@ def _format(self, value: Any, indent_current: int, indent_first: bool):
7071
self._stream.write(indent_current * self._c)
7172

7273
value_repr = repr(value)
73-
if len(value_repr) <= self._simple_cutoff and not isinstance(value, collections.Generator):
74+
if len(value_repr) <= self._simple_cutoff and not isinstance(value, Generator):
7475
self._stream.write(value_repr)
7576
else:
7677
indent_new = indent_current + self._indent_step
@@ -82,7 +83,7 @@ def _format(self, value: Any, indent_current: int, indent_first: bool):
8283

8384
def _format_dict(self, value: dict, value_repr: str, indent_current: int, indent_new: int):
8485
open_, before_, split_, after_, close_ = '{\n', indent_new * self._c, ': ', ',\n', '}'
85-
if isinstance(value, collections.OrderedDict):
86+
if isinstance(value, OrderedDict):
8687
open_, split_, after_, close_ = 'OrderedDict([\n', ', ', '),\n', '])'
8788
before_ += '('
8889
self._stream.write(open_)

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ansi2html # pyup: ignore
2-
Pygments==2.2.0
3-
Sphinx==1.6.5
4-
sphinxcontrib-websupport==1.0.1
2+
Pygments==2.3.0
3+
Sphinx==1.8.2
4+
sphinxcontrib-websupport==1.1.0

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
3+
4+
def pytest_sessionstart(session):
5+
os.environ.pop('PY_DEVTOOLS_HIGHLIGHT', None)

tests/requirements.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
coverage==4.4.1
1+
coverage==4.5.2
22
docutils==0.14
3-
flake8==3.5.0
4-
isort==4.2.15
5-
pycodestyle==2.3.1
6-
pyflakes==1.6.0
7-
Pygments==2.2.0
8-
pytest==3.2.3
9-
pytest-cov==2.5.1
10-
pytest-isort==0.1.0
11-
pytest-mock==1.6.3
12-
pytest-sugar==0.9.0
13-
pytest-toolbox==0.2
3+
flake8==3.6.0
4+
isort==4.3.4
5+
pycodestyle==2.4.0
6+
pyflakes==2.0.0
7+
Pygments==2.3.0
8+
pytest==4.0.1
9+
pytest-cov==2.6.0
10+
pytest-isort==0.2.1
11+
pytest-mock==1.10.0
12+
pytest-sugar==0.9.2
13+
pytest-toolbox==0.4
1414
numpy # pyup: ignore

tests/test_expr_render.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def foobar(a, b, c):
1414
def test_simple():
1515
a = [1, 2, 3]
1616
v = debug.format(len(a))
17-
s = re.sub(':\d{2,}', ':<line no>', str(v))
17+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
1818
# print(s)
1919
assert (
2020
'tests/test_expr_render.py:<line no> test_simple\n'
@@ -25,7 +25,7 @@ def test_simple():
2525
def test_subscription():
2626
a = {1: 2}
2727
v = debug.format(a[1])
28-
s = re.sub(':\d{2,}', ':<line no>', str(v))
28+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
2929
assert (
3030
'tests/test_expr_render.py:<line no> test_subscription\n'
3131
' a[1]: 2 (int)'
@@ -76,7 +76,7 @@ def test_exotic_types():
7676
def test_newline():
7777
v = debug.format(
7878
foobar(1, 2, 3))
79-
s = re.sub(':\d{2,}', ':<line no>', str(v))
79+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
8080
# print(s)
8181
assert (
8282
'tests/test_expr_render.py:<line no> test_newline\n'
@@ -88,7 +88,7 @@ def test_trailing_bracket():
8888
v = debug.format(
8989
foobar(1, 2, 3)
9090
)
91-
s = re.sub(':\d{2,}', ':<line no>', str(v))
91+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
9292
# print(s)
9393
assert (
9494
'tests/test_expr_render.py:<line no> test_trailing_bracket\n'
@@ -102,7 +102,7 @@ def test_multiline():
102102
2,
103103
3)
104104
)
105-
s = re.sub(':\d{2,}', ':<line no>', str(v))
105+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
106106
# print(s)
107107
assert (
108108
'tests/test_expr_render.py:<line no> test_multiline\n'
@@ -114,7 +114,7 @@ def test_multiline_trailing_bracket():
114114
v = debug.format(
115115
foobar(1, 2, 3
116116
))
117-
s = re.sub(':\d{2,}', ':<line no>', str(v))
117+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
118118
# print(s)
119119
assert (
120120
'tests/test_expr_render.py:<line no> test_multiline_trailing_bracket\n'
@@ -129,7 +129,7 @@ def test_kwargs():
129129
a=6,
130130
b=7
131131
)
132-
s = re.sub(':\d{2,}', ':<line no>', str(v))
132+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
133133
assert (
134134
'tests/test_expr_render.py:<line no> test_kwargs\n'
135135
' foobar(1, 2, 3): 6 (int)\n'
@@ -146,7 +146,7 @@ def test_kwargs_multiline():
146146
a=6,
147147
b=7
148148
)
149-
s = re.sub(':\d{2,}', ':<line no>', str(v))
149+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
150150
assert (
151151
'tests/test_expr_render.py:<line no> test_kwargs_multiline\n'
152152
' foobar(1, 2, 3): 6 (int)\n'
@@ -161,7 +161,7 @@ def test_multiple_trailing_lines():
161161
1, 2, 3
162162
),
163163
)
164-
s = re.sub(':\d{2,}', ':<line no>', str(v))
164+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
165165
assert (
166166
'tests/test_expr_render.py:<line no> test_multiple_trailing_lines\n foobar( 1, 2, 3 ): 6 (int)'
167167
) == s
@@ -187,7 +187,7 @@ def test_syntax_warning():
187187
assert 'Error: unexpected EOF while parsing (test_expr_render.py' in str(warning.message)
188188
# check only the original code is included in the warning
189189
assert '-1\n"' in str(warning.message)
190-
s = re.sub(':\d{2,}', ':<line no>', str(v))
190+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
191191
assert (
192192
'tests/test_expr_render.py:<line no> test_syntax_warning\n 1 (int)'
193193
) == s
@@ -221,7 +221,7 @@ async def bar():
221221

222222
loop = asyncio.get_event_loop()
223223
v = loop.run_until_complete(bar())
224-
s = re.sub(':\d{2,}', ':<line no>', str(v))
224+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
225225
assert (
226226
'tests/test_expr_render.py:<line no> bar\n'
227227
' 1 (int)'

tests/test_main.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_print(capsys):
1515
debug(a, b)
1616
stdout, stderr = capsys.readouterr()
1717
print(stdout)
18-
assert re.sub(':\d{2,}', ':<line no>', stdout) == (
18+
assert re.sub(r':\d{2,}', ':<line no>', stdout) == (
1919
'tests/test_main.py:<line no> test_print\n'
2020
' a: 1 (int)\n'
2121
' b: 2 (int)\n'
@@ -27,7 +27,7 @@ def test_format():
2727
a = b'i might bite'
2828
b = "hello this is a test"
2929
v = debug.format(a, b)
30-
s = re.sub(':\d{2,}', ':<line no>', str(v))
30+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
3131
print(repr(s))
3232
assert s == (
3333
"tests/test_main.py:<line no> test_format\n"
@@ -70,7 +70,7 @@ def test_odd_path(mocker):
7070
mocked_relative_to = mocker.patch('pathlib.Path.relative_to')
7171
mocked_relative_to.side_effect = ValueError()
7272
v = debug.format('test')
73-
assert re.search("/.*?/test_main.py:\d{2,} test_odd_path\n 'test' \(str\) len=4", str(v)), v
73+
assert re.search(r"/.*?/test_main.py:\d{2,} test_odd_path\n 'test' \(str\) len=4", str(v)), v
7474

7575

7676
def test_small_call_frame():
@@ -80,7 +80,7 @@ def test_small_call_frame():
8080
2,
8181
3,
8282
)
83-
assert re.sub(':\d{2,}', ':<line no>', str(v)) == (
83+
assert re.sub(r':\d{2,}', ':<line no>', str(v)) == (
8484
'tests/test_main.py:<line no> test_small_call_frame\n'
8585
' 1 (int)\n'
8686
' 2 (int)\n'
@@ -96,7 +96,7 @@ def test_small_call_frame_warning():
9696
2,
9797
3,
9898
)
99-
assert re.sub(':\d{2,}', ':<line no>', str(v)) == (
99+
assert re.sub(r':\d{2,}', ':<line no>', str(v)) == (
100100
'tests/test_main.py:<line no> test_small_call_frame_warning\n'
101101
' 1 (int)\n'
102102
' 2 (int)\n'
@@ -108,7 +108,7 @@ def test_small_call_frame_warning():
108108
def test_kwargs():
109109
a = 'variable'
110110
v = debug.format(first=a, second='literal')
111-
s = re.sub(':\d{2,}', ':<line no>', str(v))
111+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
112112
print(s)
113113
assert s == (
114114
"tests/test_main.py:<line no> test_kwargs\n"
@@ -121,7 +121,7 @@ def test_kwargs_orderless():
121121
# for python3.5
122122
a = 'variable'
123123
v = debug.format(first=a, second='literal')
124-
s = re.sub(':\d{2,}', ':<line no>', str(v))
124+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
125125
assert set(s.split('\n')) == {
126126
"tests/test_main.py:<line no> test_kwargs_orderless",
127127
" first: 'variable' (str) len=8 variable=a",
@@ -131,14 +131,14 @@ def test_kwargs_orderless():
131131

132132
def test_simple_vars():
133133
v = debug.format('test', 1, 2)
134-
s = re.sub(':\d{2,}', ':<line no>', str(v))
134+
s = re.sub(r':\d{2,}', ':<line no>', str(v))
135135
assert s == (
136136
"tests/test_main.py:<line no> test_simple_vars\n"
137137
" 'test' (str) len=4\n"
138138
" 1 (int)\n"
139139
" 2 (int)"
140140
)
141-
r = re.sub(':\d{2,}', ':<line no>', repr(v))
141+
r = re.sub(r':\d{2,}', ':<line no>', repr(v))
142142
assert r == (
143143
"<DebugOutput tests/test_main.py:<line no> test_simple_vars arguments: 'test' (str) len=4 1 (int) 2 (int)>"
144144
)
@@ -203,7 +203,7 @@ def test_exec(capsys):
203203

204204
def test_colours():
205205
v = debug.format(range(6))
206-
s = re.sub(':\d{2,}', ':<line no>', v.str(True))
206+
s = re.sub(r':\d{2,}', ':<line no>', v.str(True))
207207
assert s.startswith('\x1b[35mtests'), repr(s)
208208
s2 = strip_ansi(s)
209209
assert s2 == v.str(), repr(s2)

0 commit comments

Comments
 (0)