From 1db863e60a4693d702ad918afeb905d4ed119f20 Mon Sep 17 00:00:00 2001 From: Ian Lee Date: Tue, 31 May 2016 11:02:09 -0700 Subject: [PATCH 1/2] Updated package to use pycodestyle This change was originally triggered by @gvanrossum requeesting that pep8 (the tool) be renamed to avoid confusion with PEP-8 the document. This request is tracked at: https://github.com/PyCQA/pycodestyle/issues/466 --- dev-requirements.txt | 2 +- docs/conf.py | 2 +- flake8/_pyflakes.py | 2 +- flake8/engine.py | 4 ++-- flake8/hooks.py | 2 +- flake8/main.py | 2 +- flake8/reporter.py | 2 +- flake8/tests/test_engine.py | 2 +- setup.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 1908775..99a2340 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -pep8 +pycodestyle pyflakes mccabe mock diff --git a/docs/conf.py b/docs/conf.py index 247e44b..0bcaa6f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -232,7 +232,7 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ ('index', 'flake8', u'flake8 Documentation', u'Tarek Ziade', - 'flake8', 'Code checking using pep8, pyflakes and mccabe', + 'flake8', 'Code checking using pycodestyle, pyflakes and mccabe', 'Miscellaneous'), ] diff --git a/flake8/_pyflakes.py b/flake8/_pyflakes.py index 976b2ab..0db784b 100644 --- a/flake8/_pyflakes.py +++ b/flake8/_pyflakes.py @@ -8,7 +8,7 @@ else: demandimport.disable() import os -import pep8 +import pycodestyle as pep8 import pyflakes import pyflakes.checker diff --git a/flake8/engine.py b/flake8/engine.py index 816f1ee..129c338 100644 --- a/flake8/engine.py +++ b/flake8/engine.py @@ -6,7 +6,7 @@ import re import sys import warnings -import pep8 +import pycodestyle as pep8 from flake8 import __version__ from flake8 import callbacks @@ -44,7 +44,7 @@ def _load_entry_point(entry_point, verify_requirements): def _register_extensions(): """Register all the extensions.""" extensions = util.OrderedSet() - extensions.add(('pep8', pep8.__version__)) + extensions.add(('pycodestyle', pep8.__version__)) parser_hooks = [] options_hooks = [] ignored_hooks = [] diff --git a/flake8/hooks.py b/flake8/hooks.py index a3a5497..40cbf97 100644 --- a/flake8/hooks.py +++ b/flake8/hooks.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import with_statement import os -import pep8 +import pycodestyle as pep8 import sys import stat from subprocess import Popen, PIPE diff --git a/flake8/main.py b/flake8/main.py index 63bf199..9b1b0a6 100644 --- a/flake8/main.py +++ b/flake8/main.py @@ -3,7 +3,7 @@ import os import re import sys -import pep8 +import pycodestyle as pep8 import setuptools from flake8.engine import get_parser, get_style_guide diff --git a/flake8/reporter.py b/flake8/reporter.py index 1df3d9e..962d6cf 100644 --- a/flake8/reporter.py +++ b/flake8/reporter.py @@ -10,7 +10,7 @@ try: except ImportError: # Python 2.5 multiprocessing = None -import pep8 +import pycodestyle as pep8 __all__ = ['multiprocessing', 'BaseQReport', 'QueueReport'] diff --git a/flake8/tests/test_engine.py b/flake8/tests/test_engine.py index 82ba0dd..3ccd098 100644 --- a/flake8/tests/test_engine.py +++ b/flake8/tests/test_engine.py @@ -8,7 +8,7 @@ except ImportError: import mock # < PY33 from flake8 import engine, util, __version__, reporter -import pep8 +import pycodestyle as pep8 class TestEngine(unittest.TestCase): diff --git a/setup.py b/setup.py index fab5e86..be39d85 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ setup( packages=["flake8", "flake8.tests"], install_requires=[ "pyflakes >= 0.8.1, < 1.1", - "pep8 >= 1.5.7, != 1.6.0, != 1.6.1, != 1.6.2", + "pycodestyle >= 2.0", "mccabe >= 0.2.1, < 0.5", ], entry_points={ From 25503452b02c1582cf3ed21d9177058f110f3206 Mon Sep 17 00:00:00 2001 From: Ian Lee Date: Tue, 31 May 2016 11:08:25 -0700 Subject: [PATCH 2/2] Updated documentation references to pep8 (now pycodestyle) --- docs/config.rst | 4 ++-- docs/index.rst | 6 +++--- docs/warnings.rst | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index c0a1b70..de7ba2c 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -42,8 +42,8 @@ Settings -------- This is a (likely incomplete) list of settings that can be used in your config -file. In general, any settings that pep8 supports we also support and we add -the ability to set ``max-complexity`` as well. +file. In general, any settings that ``pycodestyle`` supports we also support and +we add the ability to set ``max-complexity`` as well. - ``exclude``: comma-separated filename and glob patterns default: ``.svn,CVS,.bzr,.hg,.git,__pycache__`` diff --git a/docs/index.rst b/docs/index.rst index e2dc514..dcd2501 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,9 +18,9 @@ Documentation Original Projects ================= -Flake8 is just a glue project, all the merits go to the creators of the original -projects: +Flake8 is just a glue project, all the merits go to the creators and maintainers +of the original projects: -- pep8: https://github.com/jcrocholl/pep8 +- pycodestyle: https://github.com/pycqa/pycodestyle - PyFlakes: https://launchpad.net/pyflakes - McCabe: http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html diff --git a/docs/warnings.rst b/docs/warnings.rst index b4b7fb1..73b9eb6 100644 --- a/docs/warnings.rst +++ b/docs/warnings.rst @@ -4,15 +4,15 @@ Warning / Error codes ===================== The convention of Flake8 is to assign a code to each error or warning, like -the ``pep8`` tool. These codes are used to configure the list of errors +the ``pycodestyle`` tool. These codes are used to configure the list of errors which are selected or ignored. Each code consists of an upper case ASCII letter followed by three digits. The recommendation is to use a different prefix for each plugin. A list of the known prefixes is published below: -- ``E***``/``W***``: `pep8 errors and warnings - `_ +- ``E***``/``W***``: `pycodestyle errors and warnings + `_ - ``F***``: PyFlakes codes (see below) - ``C9**``: McCabe complexity plugin `mccabe `_