Fix the setuptools command to read the project configuration; closes #144 and #145

This commit is contained in:
Florent Xicluna 2014-04-26 23:30:32 +02:00
parent 5772f274aa
commit eb6025ebff
2 changed files with 9 additions and 3 deletions

View file

@ -8,6 +8,8 @@ CHANGES
- Fix Git and Mercurial hooks, issues #88 and #133
- Fix crashes with Python 3.4 by upgrading dependencies
- Fix traceback when running tests with Python 2.6
- Fix the setuptools command ``python setup.py flake8`` to read
the project configuration
2.1.0 - 2013-10-26
@ -88,7 +90,7 @@ CHANGES
- make sure mccabe catches the syntax errors as warnings
- pep8 upgrade
- added max_line_length default value
- added Flake8Command and entry points is setuptools is around
- added Flake8Command and entry points if setuptools is around
- using the setuptools console wrapper when available

View file

@ -122,9 +122,13 @@ class Flake8Command(setuptools.Command):
yield "%s.py" % filename
def run(self):
# Prepare
paths = list(self.distribution_files())
flake8_style = get_style_guide(config_file=DEFAULT_CONFIG,
paths=paths,
**self.options_dict)
paths = self.distribution_files()
report = flake8_style.check_files(paths)
# Run the checkers
report = flake8_style.check_files()
exit_code = print_report(report, flake8_style)
raise SystemExit(exit_code > 0)