setup: Configure flake8 extension as a local plugin

We don't want to install this as a system plugin. Now that flake8 3.5.0
is in the wild, we can use this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: #4492
This commit is contained in:
Stephen Finucane 2018-01-26 09:41:50 +00:00
parent 376b6a597d
commit f3074d1747
2 changed files with 7 additions and 10 deletions

View File

@ -34,6 +34,10 @@ max-line-length = 95
ignore = E116,E241,E251,E741 ignore = E116,E241,E251,E741
exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,sphinx/pycode/pgen2/*,doc/ext/example*.py
[flake8:local-plugins]
extension =
X101 = utils.checks:sphinx_has_header
[mypy] [mypy]
python_version = 2.7 python_version = 2.7
show_column_numbers = True show_column_numbers = True

View File

@ -15,7 +15,7 @@ if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 4):
print('ERROR: Sphinx requires at least Python 2.7 or 3.4 to run.') print('ERROR: Sphinx requires at least Python 2.7 or 3.4 to run.')
sys.exit(1) sys.exit(1)
requires = [ install_requires = [
'six>=1.5', 'six>=1.5',
'Jinja2>=2.3', 'Jinja2>=2.3',
'Pygments>=2.0', 'Pygments>=2.0',
@ -47,7 +47,7 @@ extras_require = {
'pytest', 'pytest',
'pytest-cov', 'pytest-cov',
'html5lib', 'html5lib',
'flake8', 'flake8>=3.5.0',
], ],
'test:python_version<"3"': [ 'test:python_version<"3"': [
'enum34', 'enum34',
@ -226,15 +226,8 @@ setup(
'distutils.commands': [ 'distutils.commands': [
'build_sphinx = sphinx.setup_command:BuildDoc', 'build_sphinx = sphinx.setup_command:BuildDoc',
], ],
# consider moving this to 'flake8:local-plugins' once flake8 3.5.0 is
# in the wild:
# http://flake8.pycqa.org/en/latest/user/configuration.html\
# #using-local-plugins
'flake8.extension': [
'X101 = utils.checks:sphinx_has_header',
],
}, },
install_requires=requires, install_requires=install_requires,
extras_require=extras_require, extras_require=extras_require,
cmdclass=cmdclass, cmdclass=cmdclass,
) )