pfnet / pfio

IO library to access various filesystems with unified API
https://pfio.readthedocs.io/
MIT License
52 stars 20 forks source link

Flake8 skip for Python 3.7 #295

Closed kuenishi closed 1 year ago

kuenishi commented 1 year ago

Master CI is failing like this:

py37: commands[1]> flake8 pfio
/repo/.tox/py37/lib/python3.7/site-packages/pep8.py:110: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
pfio/cache/__init__.py:65:1: F401 'MultiprocessSparseFileCache' imported but unused
Traceback (most recent call last):
  File "/repo/.tox/py37/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/repo/.tox/py37/lib/python3.7/site-packages/flake8/main.py", line 36, in main
    report = flake8_style.check_files()
  File "/repo/.tox/py37/lib/python3.7/site-packages/flake8/engine.py", line 181, in check_files
    return self._retry_serial(self._styleguide.check_files, paths=paths)
  File "/repo/.tox/py37/lib/python3.7/site-packages/flake8/engine.py", line 172, in _retry_serial
    return func(*args, **kwargs)                                                                             [9/1808]
  File "/repo/.tox/py37/lib/python3.7/site-packages/pep8.py", line 1841, in check_files
    self.input_dir(path)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pep8.py", line 1877, in input_dir
    runner(os.path.join(root, filename))
  File "/repo/.tox/py37/lib/python3.7/site-packages/flake8/engine.py", line 126, in input_file
    return fchecker.check_all(expected=expected, line_offset=line_offset)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pep8.py", line 1575, in check_all
    self.check_ast()
  File "/repo/.tox/py37/lib/python3.7/site-packages/pep8.py", line 1521, in check_ast
    checker = cls(tree, self.filename)
  File "/repo/.tox/py37/lib/python3.7/site-packages/flake8/_pyflakes.py", line 62, in __init__
    withDoctest=withDoctest)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pyflakes/checker.py", line 294, in __init__
    self.handleChildren(tree)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pyflakes/checker.py", line 567, in handleChildren
    self.handleNode(node, tree)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pyflakes/checker.py", line 609, in handleNode
    handler(node)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pyflakes/checker.py", line 867, in CLASSDEF
    self.handleNode(stmt, node)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pyflakes/checker.py", line 608, in handleNode
    handler = self.getNodeHandler(node.__class__)
  File "/repo/.tox/py37/lib/python3.7/site-packages/pyflakes/checker.py", line 462, in getNodeHandler
    self._nodeHandlers[node_class] = handler = getattr(self, nodeType)
AttributeError: 'FlakesChecker' object has no attribute 'ANNASSIGN'

In the tox venv, flake8==2.5.5 is installed (reported by @y1r ) and somehow old version is installed even though the latest version of flake8 is now 5 (or 6 depending on the env). The root cause isn't identified yet ( it seems that something is old in the dependency chain ), for now, we're skipping flake8 test only for Python 3.7. It's EoL will be next June ( see: https://peps.python.org/pep-0537/ ), it won't last so long.

Also, this patch includes several environment updates including: