savoirfairelinux / flake8-copyright

Adds copyright checks to flake8
GNU Lesser General Public License v3.0
15 stars 15 forks source link

No support for flake8 3.0 #7

Closed The-Compiler closed 8 years ago

The-Compiler commented 8 years ago

I just tried using this with flake8 3.0.0b1 and got:

Traceback (most recent call last):
  File "/usr/lib64/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/__main__.py", line 4, in <module>
    cli.main()
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/main/cli.py", line 16, in main
    app.run(argv)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 292, in run
    self._run(argv)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 278, in _run
    self.initialize(argv)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 269, in initialize
    self.register_plugin_options()
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/main/application.py", line 149, in register_plugin_options
    self.check_plugins.register_options(self.option_manager)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/plugins/manager.py", line 378, in register_options
    list(self.manager.map(call_register_options))
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/plugins/manager.py", line 252, in map
    yield func(self.plugins[name], *args, **kwargs)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/plugins/manager.py", line 348, in generated_function
    return method(optmanager, *args, **kwargs)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8/plugins/manager.py", line 198, in register_options
    add_options(optmanager)
  File "/home/florian/proj/qutebrowser/git/.tox/flake8/lib/python3.5/site-packages/flake8_copyright.py", line 39, in add_options
    parser.config_options.append('copyright-check')
AttributeError: 'OptionManager' object has no attribute 'config_options'

flake8 documentation about the change: http://flake8.pycqa.org/en/latest/plugin-development/cross-compatibility.html#option-handling-on-flake8-2-and-3

Related fixes in pep8-naming:

https://github.com/PyCQA/pep8-naming/commit/b4c3ebd4884bac27fae56aa45c6f9e7c5b5ea5a0 https://github.com/PyCQA/pep8-naming/commit/dd623fcd76db58922a511578ff5d14ce741f9636

sigmavirus24 commented 8 years ago

See also https://gitlab.com/pycqa/flake8/issues/149

sigmavirus24 commented 8 years ago

:sparkles: :cake: :sparkles: Thanks @hsoft!

ghost commented 8 years ago

Thanks for the heads up @The-Compiler and @sigmavirus24 . I followed the instructions from the documentation.

The-Compiler commented 8 years ago

Awesome, thanks for the quick fix and release! :tada:

dreki commented 7 years ago

Note to those using Python3 finding this on Google: You must be running Python 2.7 or 3.4 for this package to work correctly. 3.5 isn't supported as of the latest release.

sigmavirus24 commented 7 years ago

@dreki this issue is unrelated.