[tor-commits] [stem/master] Drop legacy pep8 support

atagar at torproject.org atagar at torproject.org
Mon Feb 10 03:14:50 UTC 2020


commit 4fa9a1fb149ae3694fd82b628a936c6470c39726
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Feb 9 18:08:43 2020 -0800

    Drop legacy pep8 support
    
    The pep8 module renamed itself to pycodestyle at Guido's request a while ago.
    Stem was compatible with both but this was long enough ago that we can drop
    support for the old module.
---
 stem/util/test_tools.py | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py
index 117d273e..5888eb86 100644
--- a/stem/util/test_tools.py
+++ b/stem/util/test_tools.py
@@ -44,7 +44,6 @@ import stem.util.enum
 import stem.util.system
 
 CONFIG = stem.util.conf.config_dict('test', {
-  'pep8.ignore': [],  # TODO: drop with stem 2.x, legacy alias for pycodestyle.ignore
   'pycodestyle.ignore': [],
   'pyflakes.ignore': [],
   'exclude_paths': [],
@@ -345,8 +344,6 @@ def is_pycodestyle_available():
 
   if _module_exists('pycodestyle'):
     import pycodestyle
-  elif _module_exists('pep8'):
-    import pep8 as pycodestyle
   else:
     return False
 
@@ -417,7 +414,7 @@ def stylistic_issues(paths, check_newlines = False, check_exception_keyword = Fa
   ignore_for_file = []
   ignore_all_for_files = []
 
-  for rule in CONFIG['pycodestyle.ignore'] + CONFIG['pep8.ignore']:
+  for rule in CONFIG['pycodestyle.ignore']:
     if '=>' in rule:
       path, rule_entry = rule.split('=>', 1)
 
@@ -441,10 +438,7 @@ def stylistic_issues(paths, check_newlines = False, check_exception_keyword = Fa
     return False
 
   if is_pycodestyle_available():
-    if _module_exists('pep8'):
-      import pep8 as pycodestyle
-    else:
-      import pycodestyle
+    import pycodestyle
 
     class StyleReport(pycodestyle.BaseReport):
       def init_file(self, filename, lines, expected, line_offset):





More information about the tor-commits mailing list