summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lee <IanLee1521@gmail.com>2016-05-31 09:34:12 -0700
committerIan Lee <IanLee1521@gmail.com>2016-05-31 09:34:12 -0700
commitb6cef1792b6e2d93e67db26b05aeaceb78ddc31e (patch)
treec063f331bc3ee8152c032a1cedcce63b25a9d80a
parent504d8dca1c611405b5800b695a0f3ea656c7b1cf (diff)
downloadpep8-b6cef1792b6e2d93e67db26b05aeaceb78ddc31e.tar.gz
Added pycodestyle entrypoint
-rwxr-xr-xpep8.py17
-rw-r--r--setup.py3
2 files changed, 19 insertions, 1 deletions
diff --git a/pep8.py b/pep8.py
index 3c950d4..8091413 100755
--- a/pep8.py
+++ b/pep8.py
@@ -54,6 +54,7 @@ import time
import inspect
import keyword
import tokenize
+import warnings
from optparse import OptionParser
from fnmatch import fnmatch
try:
@@ -2147,5 +2148,21 @@ def _main():
sys.stderr.write(str(report.total_errors) + '\n')
sys.exit(1)
+
+def _main_pep8():
+ """Entrypoint for pep8 commandline tool.
+
+ Warn of deprecation and advise users to switch to pycodestyle.
+ """
+ print(
+ 'Deprecation Warning:\n'
+ 'Use of the pep8 tool will be removed in a future release.\n'
+ 'Please install and use `pycodestyle` instead.\n'
+ )
+ warnings.warn('pep8 has been renamed to pycodestyle (GitHub issue #466)')
+
+ _main()
+
+
if __name__ == '__main__':
_main()
diff --git a/setup.py b/setup.py
index 421fe03..f755626 100644
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,8 @@ setup(
],
entry_points={
'console_scripts': [
- 'pep8 = pep8:_main',
+ 'pycodestyle = pep8:_main',
+ 'pep8 = pep8:_main_pep8',
],
},
classifiers=[