Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit d0d5bec

Browse files
authored
Merge pull request #217 from Nurdok/drop_py26_support
Drop support for Python 2.6.
2 parents d20c1e7 + c443c80 commit d0d5bec

File tree

13 files changed

+60
-58
lines changed

13 files changed

+60
-58
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ install: pip install tox
99
script: tox
1010
matrix:
1111
include:
12-
- python: 2.6
13-
env: TOXENV=py26
1412
- python: 2.7
1513
env: TOXENV=py27
1614
- python: 3.3

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ docstring conventions.
1010
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
1111
should not be considered a reference implementation.
1212

13-
**pydocstyle** supports Python 2.6, 2.7, 3.3, 3.4, 3.5, pypy and pypy3.
13+
**pydocstyle** supports Python 2.7, 3.3, 3.4, 3.5, pypy and pypy3.
1414

1515
Quick Start
1616
-----------

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
pydocstyle's documentation
22
==========================
33

4-
(formerly pep257)
5-
64
**pydocstyle** is a static analysis tool for checking compliance with Python
75
docstring conventions.
86

97
**pydocstyle** supports most of
108
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
119
should not be considered a reference implementation.
1210

11+
**pydocstyle** supports Python 2.7, 3.3, 3.4, 3.5, pypy and pypy3.
12+
1313

1414
.. include:: quickstart.rst
1515

docs/release_notes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Release Notes
44
**pydocstyle** version numbers follow the
55
`Semantic Versioning <http://semver.org/>`_ specification.
66

7+
Current Development Version
8+
---------------------------
9+
10+
Major Updates
11+
12+
* Support for Python 2.6 has been dropped (#206, #217).
13+
714
1.1.1 - October 4th, 2016
815
-------------------------
916

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.2rc
2+
current_version = 2.0.0rc
33
commit = True
44
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>.*))?
55
serialize =

src/pydocstyle/config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def _read_configuration_file(self, path):
260260
continue
261261

262262
if opt.replace('_', '-') not in self.CONFIG_FILE_OPTIONS:
263-
log.warning("Unknown option '{0}' ignored".format(opt))
263+
log.warning("Unknown option '{}' ignored".format(opt))
264264
continue
265265

266266
normalized_opt = opt.replace('-', '_')
@@ -279,7 +279,7 @@ def _read_configuration_file(self, path):
279279

280280
if options is not None:
281281
if not self._validate_options(options):
282-
raise IllegalConfiguration('in file: {0}'.format(path))
282+
raise IllegalConfiguration('in file: {}'.format(path))
283283

284284
return options, should_inherit
285285

@@ -413,12 +413,12 @@ def _validate_options(cls, options):
413413
for opt1, opt2 in \
414414
itertools.permutations(cls.BASE_ERROR_SELECTION_OPTIONS, 2):
415415
if getattr(options, opt1) and getattr(options, opt2):
416-
log.error('Cannot pass both {0} and {1}. They are '
416+
log.error('Cannot pass both {} and {}. They are '
417417
'mutually exclusive.'.format(opt1, opt2))
418418
return False
419419

420420
if options.convention and options.convention not in conventions:
421-
log.error("Illegal convention '{0}'. Possible conventions: {1}"
421+
log.error("Illegal convention '{}'. Possible conventions: {}"
422422
.format(options.convention,
423423
', '.join(conventions.keys())))
424424
return False
@@ -442,7 +442,7 @@ def _get_set(value_str):
442442
Removes any occurrences of '' in the set.
443443
444444
"""
445-
return set(value_str.split(',')) - set([''])
445+
return set(value_str.split(',')) - {''}
446446

447447
for opt in optional_set_options:
448448
value = getattr(options, opt)
@@ -497,7 +497,7 @@ def _create_option_parser(cls):
497497
'for example: --ignore=D101,D202')
498498
option('--convention', metavar='<name>', default=None,
499499
help='choose the basic list of checked errors by specifying an '
500-
'existing convention. Possible conventions: {0}'
500+
'existing convention. Possible conventions: {}'
501501
.format(', '.join(conventions)))
502502
option('--add-select', metavar='<codes>', default=None,
503503
help='amend the list of errors to check for by specifying '
@@ -509,12 +509,12 @@ def _create_option_parser(cls):
509509
# Match clauses
510510
option('--match', metavar='<pattern>', default=None,
511511
help=("check only files that exactly match <pattern> regular "
512-
"expression; default is --match='{0}' which matches "
512+
"expression; default is --match='{}' which matches "
513513
"files that don't start with 'test_' but end with "
514514
"'.py'").format(cls.DEFAULT_MATCH_RE))
515515
option('--match-dir', metavar='<pattern>', default=None,
516516
help=("search only dirs that exactly match <pattern> regular "
517-
"expression; default is --match-dir='{0}', which "
517+
"expression; default is --match-dir='{}', which "
518518
"matches all dirs that don't start with "
519519
"a dot").format(cls.DEFAULT_MATCH_DIR_RE))
520520

src/pydocstyle/parser.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Value(object):
4242

4343
def __init__(self, *args):
4444
if len(self._fields) != len(args):
45-
raise ValueError('got {0} arguments for {1} fields for {2}: {3}'
45+
raise ValueError('got {} arguments for {} fields for {}: {}'
4646
.format(len(args), len(self._fields),
4747
self.__class__.__name__, self._fields))
4848
vars(self).update(zip(self._fields, args))
@@ -54,9 +54,9 @@ def __eq__(self, other):
5454
return other and vars(self) == vars(other)
5555

5656
def __repr__(self):
57-
kwargs = ', '.join('{0}={1!r}'.format(field, getattr(self, field))
57+
kwargs = ', '.join('{}={!r}'.format(field, getattr(self, field))
5858
for field in self._fields)
59-
return '{0}({1})'.format(self.__class__.__name__, kwargs)
59+
return '{}({})'.format(self.__class__.__name__, kwargs)
6060

6161

6262
class Definition(Value):
@@ -91,10 +91,9 @@ def is_empty_or_comment(line):
9191
return ''.join(reversed(list(filtered_src)))
9292

9393
def __str__(self):
94-
out = 'in {0} {1} `{2}`'.format(self._publicity, self._human,
95-
self.name)
94+
out = 'in {} {} `{}`'.format(self._publicity, self._human, self.name)
9695
if self.skipped_error_codes:
97-
out += ' (skipping {0})'.format(self.skipped_error_codes)
96+
out += ' (skipping {})'.format(self.skipped_error_codes)
9897
return out
9998

10099

@@ -154,7 +153,7 @@ def is_public(self):
154153
# Check if we are a setter/deleter method, and mark as private if so.
155154
for decorator in self.decorators:
156155
# Given 'foo', match 'foo.bar' but not 'foobar' or 'sfoo'
157-
if re(r"^{0}\.".format(self.name)).match(decorator.name):
156+
if re(r"^{}\.".format(self.name)).match(decorator.name):
158157
return False
159158
name_is_public = (not self.name.startswith('_') or
160159
self.name in VARIADIC_MAGIC_METHODS or
@@ -229,7 +228,7 @@ def __iter__(self):
229228

230229
class TokenKind(int):
231230
def __repr__(self):
232-
return "tk.{0}".format(tk.tok_name[self])
231+
return "tk.{}".format(tk.tok_name[self])
233232

234233

235234
class Token(Value):
@@ -374,7 +373,7 @@ def parse_all(self):
374373
raise AllError('Could not evaluate contents of __all__. ')
375374
if self.current.value == '[':
376375
sys.stderr.write(
377-
"{0} WARNING: __all__ is defined as a list, this means "
376+
"{} WARNING: __all__ is defined as a list, this means "
378377
"pydocstyle cannot reliably detect contents of the __all__ "
379378
"variable, because it can be mutated. Change __all__ to be "
380379
"an (immutable) tuple, to remove this warning. Note, "
@@ -395,7 +394,7 @@ def parse_all(self):
395394
self.current.value == ','):
396395
all_content += self.current.value
397396
else:
398-
raise AllError('Unexpected token kind in __all__: {0!r}. '
397+
raise AllError('Unexpected token kind in __all__: {!r}. '
399398
.format(self.current.kind))
400399
self.stream.move()
401400
self.consume(tk.OP)
@@ -404,7 +403,7 @@ def parse_all(self):
404403
self.all = eval(all_content, {})
405404
except BaseException as e:
406405
raise AllError('Could not evaluate contents of __all__.'
407-
'\bThe value was {0}. The exception was:\n{1}'
406+
'\bThe value was {}. The exception was:\n{}'
408407
.format(all_content, e))
409408

410409
def parse_module(self):

src/pydocstyle/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33

44

5-
__version__ = '1.1.2rc'
5+
__version__ = '2.0.0rc'
66
log = logging.getLogger(__name__)
77

88

src/pydocstyle/violations.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def set_context(self, definition, explanation):
4040
@property
4141
def message(self):
4242
"""Return the message to print to the user."""
43-
ret = '{0}: {1}'.format(self.code, self.short_desc)
43+
ret = '{}: {}'.format(self.code, self.short_desc)
4444
if self.context is not None:
4545
ret += ' (' + self.context.format(*self.parameters) + ')'
4646
return ret
@@ -59,7 +59,7 @@ def lines(self):
5959
numbers_width = len(str(numbers_width))
6060
numbers_width = 6
6161
for n, line in enumerate(lines_stripped):
62-
source += '{{0}}{0}: {{1}}'.format(numbers_width).format(
62+
source += '{{}}{}: {{}}'.format(numbers_width).format(
6363
n + offset, line)
6464
source += '%*d: %s' % (numbers_width, n + offset, line)
6565
if n > 5:
@@ -143,7 +143,7 @@ def to_rst(cls):
143143
for group in cls.groups:
144144
table += sep_line
145145
table += blank_line
146-
table += '|' + '**{0}**'.format(group.name).center(78) + '|\n'
146+
table += '|' + '**{}**'.format(group.name).center(78) + '|\n'
147147
table += blank_line
148148
for error in group.errors:
149149
table += sep_line
@@ -212,10 +212,8 @@ class AttrDict(dict):
212212
def __getattr__(self, item):
213213
return self[item]
214214

215+
all_errors = set(ErrorRegistry.get_error_codes())
215216

216217
conventions = AttrDict({
217-
'pep257': set(ErrorRegistry.get_error_codes()) - set(['D203',
218-
'D212',
219-
'D213',
220-
'D404'])
218+
'pep257': all_errors - {'D203', 'D212', 'D213', 'D404'}
221219
})

src/tests/test_cases/expected.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Expectation(object):
22
"""Hold expectation for pep257 violations in tests."""
33

44
def __init__(self):
5-
self.expected = set([])
5+
self.expected = set()
66

77
def expect(self, *args):
88
"""Decorator that expects a certain PEP 257 violation."""

0 commit comments

Comments
 (0)