Skip to content

Commit 2178351

Browse files
committed
Added pycodestyle entry_point
Converted pep8 entry point to emit a deprecation warning for users
1 parent c98b72f commit 2178351

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

pep8.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2181,5 +2181,20 @@ def _main():
21812181
sys.stderr.write(str(report.total_errors) + '\n')
21822182
sys.exit(1)
21832183

2184+
2185+
def _main_pep8():
2186+
"""Entrypoint for pep8 commandline tool.
2187+
2188+
Warn of deprecation and advise users to switch to pycodestyle.
2189+
"""
2190+
print(
2191+
'Deprecation Warning:\n'
2192+
'pep8 has been renamed to pycodestyle and the use of the pep8 '
2193+
'executable will be removed in a future release. Please use '
2194+
'`pycodestyle` instead.\n'
2195+
)
2196+
_main()
2197+
2198+
21842199
if __name__ == '__main__':
21852200
_main()

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def get_long_description():
3838
],
3939
entry_points={
4040
'console_scripts': [
41-
'pep8 = pep8:_main',
41+
'pycodestyle = pep8:_main',
42+
'pep8 = pep8:_main_pep8',
4243
],
4344
},
4445
classifiers=[

0 commit comments

Comments
 (0)