PyCQA / flake8-import-order

Flake8 plugin that checks import order against various Python Style Guides
GNU Lesser General Public License v3.0
278 stars 72 forks source link

Crash when run with flake8 3.0 #79

Closed alex closed 8 years ago

alex commented 8 years ago
(cryptography) ~/p/cryptography (master) $ flake8
Traceback (most recent call last):
  File "/Users/alex_gaynor/.virtualenvs/cryptography/bin/flake8", line 11, in <module>
    sys.exit(main())
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/main/cli.py", line 16, in main
    app.run(argv)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/main/application.py", line 299, in run
    self._run(argv)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/main/application.py", line 285, in _run
    self.initialize(argv)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/main/application.py", line 276, in initialize
    self.register_plugin_options()
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/main/application.py", line 150, in register_plugin_options
    self.check_plugins.register_options(self.option_manager)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/plugins/manager.py", line 451, in register_options
    list(self.manager.map(register_and_enable))
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/plugins/manager.py", line 261, in map
    yield func(self.plugins[name], *args, **kwargs)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/plugins/manager.py", line 447, in register_and_enable
    call_register_options(plugin)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/plugins/manager.py", line 357, in generated_function
    return method(optmanager, *args, **kwargs)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8/plugins/manager.py", line 207, in register_options
    add_options(optmanager)
  File "/Users/alex_gaynor/.virtualenvs/cryptography/site-packages/flake8_import_order/flake8_linter.py", line 32, in add_options
    parser.config_options.append("application-import-names")
AttributeError: 'OptionManager' object has no attribute 'config_options'
alex commented 8 years ago
(cryptography) ~/p/cryptography (master) $ pip freeze | grep flake8
flake8==3.0.0
flake8-import-order==0.8
pgjones commented 8 years ago

This is fixed in master and will be in the next release. I'll look to release this week.

alex commented 8 years ago

Great, thanks.

fxfitz commented 8 years ago

Seeing this in our projects too. Waiting for latest release.

pgjones commented 8 years ago

I have just released 0.9, which should solve this issue.

sigmavirus24 commented 8 years ago

Thank you @pgjones!

fxfitz commented 8 years ago

You're a gentleman and a scholar.

shibasisp commented 7 years ago

I got the same error. I am using flake8==3.3.0 flake8-pep257==1.0.5

pgjones commented 7 years ago

@shibasisp I think your error is most likely related to flake8-pep257 which looks to be abandoned now https://github.com/Robpol86/flake8-pydocstyle. I would change to use https://gitlab.com/pycqa/flake8-docstrings as it recommends instead.

shibasisp commented 7 years ago

Oo Thanks @pgjones. It's working now!