Skip to content

Commit bdbcce9

Browse files
committed
upgrade deps, run tests on more live snakes
1 parent ba32395 commit bdbcce9

File tree

5 files changed

+36
-32
lines changed

5 files changed

+36
-32
lines changed

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ language: python
33
python: "3.5"
44
env:
55
- TOX_ENV=py27
6-
- TOX_ENV=py33
76
- TOX_ENV=py34
87
- TOX_ENV=py35
9-
- TOX_ENV=lint
108
matrix:
119
include:
1210
- python: 3.6
1311
env: TOX_ENV=py36
12+
include:
13+
- python: 3.7
14+
env: TOX_ENV=py37
15+
include:
16+
- python: 3.7
17+
env: TOX_ENV=lint
18+
include:
19+
- python: 2.7
20+
env: TOX_ENV=lint
1421
addons:
1522
apt:
1623
packages:

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@
3939
"Programming Language :: Python :: 2",
4040
"Programming Language :: Python :: 2.7",
4141
"Programming Language :: Python :: 3",
42-
"Programming Language :: Python :: 3.3",
4342
"Programming Language :: Python :: 3.4",
4443
"Programming Language :: Python :: 3.5",
45-
"Programming Language :: Python :: 3.6"
44+
"Programming Language :: Python :: 3.6",
45+
"Programming Language :: Python :: 3.7",
4646
],
4747
)
48-

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{27,33,34,35,36}, lint
2+
envlist = py{27,34,35,36,37}, lint
33

44
[testenv]
55
commands = nosetests --with-doctest --doctest-extension=rst {posargs}
@@ -8,5 +8,5 @@ deps =
88

99
[testenv:lint]
1010
deps =
11-
flake8==3.3.0
12-
commands=flake8 whatthepatch tests
11+
flake8==3.7.7
12+
commands=flake8 whatthepatch tests setup.py

whatthepatch/apply.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,15 @@ def apply_diff(diff, text, reverse=False, use_patch=False):
101101
if old is not None and line is not None:
102102
if old > n_lines:
103103
raise exceptions.HunkApplyException(
104-
'context line {n}, "{l}" does not exist in source'.format(
105-
n=old,
106-
l=line,
107-
),
104+
'context line {n}, "{line}" does not exist in source'
105+
.format(n=old, line=line),
108106
hunk=hunk,
109107
)
110108
if lines[old-1] != line:
111109
raise exceptions.HunkApplyException(
112-
'context line {n}, "{l}" does not match "{sl}"'.format(
110+
'context line {n}, "{line}" does not match "{sl}"'.format(
113111
n=old,
114-
l=line,
112+
line=line,
115113
sl=lines[old-1]
116114
),
117115
hunk=hunk,

whatthepatch/patch.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@
2020
# general diff regex
2121
diffcmd_header = re.compile('^diff.* (.+) (.+)$')
2222
unified_header_index = re.compile('^Index: (.+)$')
23-
unified_header_old_line = re.compile('^--- ' + file_timestamp_str + '$')
24-
unified_header_new_line = re.compile('^\+\+\+ ' + file_timestamp_str + '$')
25-
unified_hunk_start = re.compile('^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@(.*)$')
23+
unified_header_old_line = re.compile(r'^--- ' + file_timestamp_str + '$')
24+
unified_header_new_line = re.compile(r'^\+\+\+ ' + file_timestamp_str + '$')
25+
unified_hunk_start = re.compile(r'^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@(.*)$')
2626
unified_change = re.compile('^([-+ ])(.*)$')
2727

28-
context_header_old_line = re.compile('^\*\*\* ' + file_timestamp_str + '$')
28+
context_header_old_line = re.compile(r'^\*\*\* ' + file_timestamp_str + '$')
2929
context_header_new_line = re.compile('^--- ' + file_timestamp_str + '$')
30-
context_hunk_start = re.compile('^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$')
31-
context_hunk_old = re.compile('^\*\*\* (\d+),?(\d*) \*\*\*\*$')
32-
context_hunk_new = re.compile('^--- (\d+),?(\d*) ----$')
30+
context_hunk_start = re.compile(r'^\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*$')
31+
context_hunk_old = re.compile(r'^\*\*\* (\d+),?(\d*) \*\*\*\*$')
32+
context_hunk_new = re.compile(r'^--- (\d+),?(\d*) ----$')
3333
context_change = re.compile('^([-+ !]) (.*)$')
3434

35-
ed_hunk_start = re.compile('^(\d+),?(\d*)([acd])$')
35+
ed_hunk_start = re.compile(r'^(\d+),?(\d*)([acd])$')
3636
ed_hunk_end = re.compile('^.$')
3737
# much like forward ed, but no 'c' type
38-
rcs_ed_hunk_start = re.compile('^([ad])(\d+) ?(\d*)$')
38+
rcs_ed_hunk_start = re.compile(r'^([ad])(\d+) ?(\d*)$')
3939

40-
default_hunk_start = re.compile('^(\d+),?(\d*)([acd])(\d+),?(\d*)$')
40+
default_hunk_start = re.compile(r'^(\d+),?(\d*)([acd])(\d+),?(\d*)$')
4141
default_hunk_mid = re.compile('^---$')
4242
default_change = re.compile('^([><]) (.*)$')
4343

4444
# Headers
4545

4646
# git has a special index header and no end part
4747
git_diffcmd_header = re.compile('^diff --git a/(.+) b/(.+)$')
48-
git_header_index = re.compile('^index ([a-f0-9]+)..([a-f0-9]+) ?(\d*)$')
48+
git_header_index = re.compile(r'^index ([a-f0-9]+)..([a-f0-9]+) ?(\d*)$')
4949
git_header_old_line = re.compile('^--- (.+)$')
50-
git_header_new_line = re.compile('^\+\+\+ (.+)$')
51-
git_header_file_mode = re.compile('^(new|deleted) file mode \d{6}$')
50+
git_header_new_line = re.compile(r'^\+\+\+ (.+)$')
51+
git_header_file_mode = re.compile(r'^(new|deleted) file mode \d{6}$')
5252
git_header_binary_file = re.compile('^Binary files (.+) and (.+) differ')
5353

5454
bzr_header_index = re.compile("=== (.+)")
@@ -57,14 +57,14 @@
5757

5858
svn_header_index = unified_header_index
5959
svn_header_timestamp_version = re.compile(
60-
'\((?:working copy|revision (\d+))\)'
60+
r'\((?:working copy|revision (\d+))\)'
6161
)
62-
svn_header_timestamp = re.compile('.*(\(.*\))$')
62+
svn_header_timestamp = re.compile(r'.*(\(.*\))$')
6363

6464
cvs_header_index = unified_header_index
65-
cvs_header_rcs = re.compile('^RCS file: (.+)(?:,\w{1}$|$)')
66-
cvs_header_timestamp = re.compile('(.+)\t([\d.]+)')
67-
cvs_header_timestamp_colon = re.compile(':([\d.]+)\t(.+)')
65+
cvs_header_rcs = re.compile(r'^RCS file: (.+)(?:,\w{1}$|$)')
66+
cvs_header_timestamp = re.compile(r'(.+)\t([\d.]+)')
67+
cvs_header_timestamp_colon = re.compile(r':([\d.]+)\t(.+)')
6868
old_cvs_diffcmd_header = re.compile('^diff.* (.+):(.*) (.+):(.*)$')
6969

7070

0 commit comments

Comments
 (0)