mirror of
https://github.com/PyCQA/flake8.git
synced 2026-03-29 10:36:53 +00:00
Rely on Python 3.4 backport of configparser
Python 2.7's ConfigParser module does not allow for the behaviour we have documented for config files in Flake8 3.0. To compensate for that, we add a dependency on the configparser backport on PyPI for Python 2.7
This commit is contained in:
parent
e9ddf7533b
commit
33f982b446
6 changed files with 13 additions and 11 deletions
|
|
@ -155,6 +155,14 @@ This would allow us to add comments for why we're excluding items, e.g.,
|
|||
dist
|
||||
max-complexity = 10
|
||||
|
||||
.. note::
|
||||
|
||||
If you're using Python 2, you will notice that we download the
|
||||
:mod:`configparser` backport from PyPI. That backport enables us to
|
||||
support this behaviour on all supported versions of Python.
|
||||
|
||||
Please do **not** open issues about this dependency.
|
||||
|
||||
.. note::
|
||||
|
||||
You can also specify ``--max-complexity`` as ``max_complexity = 10``.
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
"""Config handling logic for Flake8."""
|
||||
import configparser
|
||||
import logging
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
import ConfigParser as configparser
|
||||
else:
|
||||
import configparser
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
__all__ = ('ConfigFileFinder', 'MergedConfigParser')
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ universal=1
|
|||
[metadata]
|
||||
requires-dist =
|
||||
enum34; python_version<"3.4"
|
||||
configparser; python_version<"3.2"
|
||||
|
||||
[pytest]
|
||||
norecursedirs = .git .* *.egg* old docs dist build
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -31,7 +31,7 @@ if mock is None:
|
|||
requires = [
|
||||
"pyflakes >= 0.8.1, < 1.1",
|
||||
"pep8 >= 1.5.7, != 1.6.0, != 1.6.1, != 1.6.2",
|
||||
# "mccabe >= 0.2.1, < 0.4",
|
||||
"mccabe >= 0.2.1, < 0.4",
|
||||
]
|
||||
|
||||
if sys.version_info < (3, 4):
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
"""Tests for the ConfigFileFinder."""
|
||||
try:
|
||||
import ConfigParser as configparser
|
||||
except ImportError:
|
||||
import configparser
|
||||
|
||||
import configparser
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
|
|||
1
tox.ini
1
tox.ini
|
|
@ -6,6 +6,7 @@ envlist = py27,py33,py34,py35,flake8
|
|||
deps =
|
||||
mock
|
||||
pytest
|
||||
py27: configparser
|
||||
commands =
|
||||
py.test {posargs}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue