Hello community, here is the log from the commit of package python-flake8 for openSUSE:Factory checked in at 2014-07-11 06:46:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8 (Old) and /work/SRC/openSUSE:Factory/.python-flake8.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-flake8" Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8/python-flake8.changes 2014-07-02 15:05:15.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8.new/python-flake8.changes 2014-07-11 06:46:52.000000000 +0200 @@ -1,0 +2,10 @@ +Thu Jul 10 12:26:59 UTC 2014 - toddrme2178@gmail.com + +- Update to 2.2.2 + - Re-enable multiprocessing by default while fixing the issue + Windows users were seeing. +- Update to 2.2.1 + - Turn off multiple jobs by default. To enable automatic use + of all CPUs, use --jobs=auto. Fixes #155 and #154. + +------------------------------------------------------------------- Old: ---- flake8-2.2.0.tar.gz New: ---- flake8-2.2.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8.spec ++++++ --- /var/tmp/diff_new_pack.DusJCn/_old 2014-07-11 06:46:52.000000000 +0200 +++ /var/tmp/diff_new_pack.DusJCn/_new 2014-07-11 06:46:52.000000000 +0200 @@ -17,7 +17,7 @@ Name: python-flake8 -Version: 2.2.0 +Version: 2.2.2 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT ++++++ flake8-2.2.0.tar.gz -> flake8-2.2.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/CHANGES.rst new/flake8-2.2.2/CHANGES.rst --- old/flake8-2.2.0/CHANGES.rst 2014-06-23 04:08:31.000000000 +0200 +++ new/flake8-2.2.2/CHANGES.rst 2014-07-05 04:50:28.000000000 +0200 @@ -1,6 +1,18 @@ CHANGES ======= +2.2.2 - 2014-07-04 +------------------ + +- Re-enable multiprocessing by default while fixing the issue Windows users + were seeing. + +2.2.1 - 2014-06-30 +------------------ + +- Turn off multiple jobs by default. To enable automatic use of all CPUs, use + ``--jobs=auto``. Fixes #155 and #154. + 2.2.0 - 2014-06-22 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/PKG-INFO new/flake8-2.2.2/PKG-INFO --- old/flake8-2.2.0/PKG-INFO 2014-06-23 04:22:27.000000000 +0200 +++ new/flake8-2.2.2/PKG-INFO 2014-07-05 04:53:51.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: flake8 -Version: 2.2.0 +Version: 2.2.2 Summary: the modular source code checker: pep8, pyflakes and co Home-page: http://bitbucket.org/tarek/flake8 Author: Ian Cordasco @@ -86,6 +86,18 @@ CHANGES ======= + 2.2.2 - 2014-07-04 + ------------------ + + - Re-enable multiprocessing by default while fixing the issue Windows users + were seeing. + + 2.2.1 - 2014-06-30 + ------------------ + + - Turn off multiple jobs by default. To enable automatic use of all CPUs, use + ``--jobs=auto``. Fixes #155 and #154. + 2.2.0 - 2014-06-22 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8/__init__.py new/flake8-2.2.2/flake8/__init__.py --- old/flake8-2.2.0/flake8/__init__.py 2014-06-23 04:08:43.000000000 +0200 +++ new/flake8-2.2.2/flake8/__init__.py 2014-07-05 04:51:20.000000000 +0200 @@ -1 +1 @@ -__version__ = '2.2.0' +__version__ = '2.2.2' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8/engine.py new/flake8-2.2.2/flake8/engine.py --- old/flake8-2.2.0/flake8/engine.py 2014-06-23 04:06:14.000000000 +0200 +++ new/flake8-2.2.2/flake8/engine.py 2014-06-27 14:53:50.000000000 +0200 @@ -55,8 +55,9 @@ except NotImplementedError: auto = 1 parser.config_options.append('jobs') - parser.add_option('-j', '--jobs', type='int', default=auto, - help="number of jobs to run simultaneously") + parser.add_option('-j', '--jobs', type='string', default='', + help="number of jobs to run simultaneously, " + "or 'auto'") parser.add_option('--exit-zero', action='store_true', help="exit with code 0 even if there are errors") @@ -91,11 +92,20 @@ for options_hook in options_hooks: options_hook(options) - if multiprocessing and options.jobs > 1: - reporter = BaseQReport if options.quiet else QueueReport - report = styleguide.init_report(reporter) - report.input_file = styleguide.input_file - styleguide.runner = report.task_queue.put + if multiprocessing and options.jobs: + if options.jobs.isdigit(): + n_jobs = int(options.jobs) + else: + try: + n_jobs = multiprocessing.cpu_count() + except NotImplementedError: + n_jobs = 1 + if n_jobs > 1: + options.jobs = n_jobs + reporter = BaseQReport if options.quiet else QueueReport + report = styleguide.init_report(reporter) + report.input_file = styleguide.input_file + styleguide.runner = report.task_queue.put return styleguide diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8/engine.py.orig new/flake8-2.2.2/flake8/engine.py.orig --- old/flake8-2.2.0/flake8/engine.py.orig 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-2.2.2/flake8/engine.py.orig 2014-06-27 14:55:46.000000000 +0200 @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +import re +import platform + +import pep8 + +from flake8 import __version__ +from flake8.reporter import multiprocessing, BaseQReport, QueueReport +from flake8.util import OrderedSet + +_flake8_noqa = re.compile(r'flake8[:=]\s*noqa', re.I).search + + +def _register_extensions(): + """Register all the extensions.""" + extensions = OrderedSet() + extensions.add(('pep8', pep8.__version__)) + parser_hooks = [] + options_hooks = [] + try: + from pkg_resources import iter_entry_points + except ImportError: + pass + else: + for entry in iter_entry_points('flake8.extension'): + checker = entry.load() + pep8.register_check(checker, codes=[entry.name]) + extensions.add((checker.name, checker.version)) + if hasattr(checker, 'add_options'): + parser_hooks.append(checker.add_options) + if hasattr(checker, 'parse_options'): + options_hooks.append(checker.parse_options) + return extensions, parser_hooks, options_hooks + + +def get_parser(): + """This returns an instance of optparse.OptionParser with all the + extensions registered and options set. This wraps ``pep8.get_parser``. + """ + (extensions, parser_hooks, options_hooks) = _register_extensions() + details = ', '.join(['%s: %s' % ext for ext in extensions]) + python_version = get_python_version() + parser = pep8.get_parser('flake8', '%s (%s) %s' % ( + __version__, details, python_version + )) + for opt in ('--repeat', '--testsuite', '--doctest'): + try: + parser.remove_option(opt) + except ValueError: + pass + + if multiprocessing: + try: + auto = multiprocessing.cpu_count() or 1 + except NotImplementedError: + auto = 1 + parser.config_options.append('jobs') + parser.add_option('-j', '--jobs', type='string', default='', + help="number of jobs to run simultaneously, " + "or 'auto'") + + parser.add_option('--exit-zero', action='store_true', + help="exit with code 0 even if there are errors") + for parser_hook in parser_hooks: + parser_hook(parser) + parser.add_option('--install-hook', default=False, action='store_true', + help='Install the appropriate hook for this ' + 'repository.', dest='install_hook') + return parser, options_hooks + + +class StyleGuide(pep8.StyleGuide): + + def input_file(self, filename, lines=None, expected=None, line_offset=0): + """Run all checks on a Python source file.""" + if self.options.verbose: + print('checking %s' % filename) + fchecker = self.checker_class( + filename, lines=lines, options=self.options) + # Any "# flake8: noqa" line? + if any(_flake8_noqa(line) for line in fchecker.lines): + return 0 + return fchecker.check_all(expected=expected, line_offset=line_offset) + + +def get_style_guide(**kwargs): + """Parse the options and configure the checker. This returns a sub-class + of ``pep8.StyleGuide``.""" + kwargs['parser'], options_hooks = get_parser() + styleguide = StyleGuide(**kwargs) + options = styleguide.options + for options_hook in options_hooks: + options_hook(options) + + if multiprocessing and options.jobs: + if options.jobs.isdigit(): + n_jobs = int(options.jobs) + else: + try: + n_jobs = multiprocessing.cpu_count() + except NotImplementedError: + n_jobs = 1 + if n_jobs > 1: + options.jobs = n_jobs + reporter = BaseQReport if options.quiet else QueueReport + report = styleguide.init_report(reporter) + report.input_file = styleguide.input_file + styleguide.runner = report.task_queue.put + + return styleguide + + +def get_python_version(): + # The implementation isn't all that important. + try: + impl = platform.python_implementation() + " " + except AttributeError: # Python 2.5 + impl = '' + return '%s%s on %s' % (impl, platform.python_version(), platform.system()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8/reporter.py new/flake8-2.2.2/flake8/reporter.py --- old/flake8-2.2.0/flake8/reporter.py 2014-05-23 02:55:54.000000000 +0200 +++ new/flake8-2.2.2/flake8/reporter.py 2014-07-05 04:52:13.000000000 +0200 @@ -2,6 +2,7 @@ # Adapted from a contribution of Johan Dahlin import collections +import sys try: import multiprocessing except ImportError: # Python 2.5 @@ -14,6 +15,7 @@ class BaseQReport(pep8.BaseReport): """Base Queue Report.""" + _loaded = False # Windows support def __init__(self, options): assert options.jobs > 0 @@ -24,9 +26,13 @@ # init queues self.task_queue = multiprocessing.Queue() self.result_queue = multiprocessing.Queue() + if sys.platform == 'win32': + # Work around http://bugs.python.org/issue10845 + sys.modules['__main__'].__file__ = __file__ def start(self): super(BaseQReport, self).start() + self.__class__._loaded = True # spawn processes for i in range(self.n_jobs): p = multiprocessing.Process(target=self.process_main) @@ -40,6 +46,10 @@ super(BaseQReport, self).stop() def process_main(self): + if not self._loaded: + # Windows needs to parse again the configuration + from flake8.main import get_style_guide, DEFAULT_CONFIG + get_style_guide(parse_argv=True, config_file=DEFAULT_CONFIG) for filename in iter(self.task_queue.get, 'DONE'): self.input_file(filename) self.result_queue.put(self.get_state()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8/tests/test_engine.py new/flake8-2.2.2/flake8/tests/test_engine.py --- old/flake8-2.2.0/flake8/tests/test_engine.py 2014-05-23 02:55:54.000000000 +0200 +++ new/flake8-2.2.2/flake8/tests/test_engine.py 2014-06-27 14:54:08.000000000 +0200 @@ -34,7 +34,7 @@ m = mock.Mock() with mock.patch('flake8.engine.StyleGuide') as StyleGuide: with mock.patch('flake8.engine.get_parser') as get_parser: - StyleGuide.return_value.options.jobs = 42 + StyleGuide.return_value.options.jobs = '42' get_parser.return_value = (m, []) engine.get_style_guide(foo='bar') get_parser.assert_called_once_with() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8.egg-info/PKG-INFO new/flake8-2.2.2/flake8.egg-info/PKG-INFO --- old/flake8-2.2.0/flake8.egg-info/PKG-INFO 2014-06-23 04:22:27.000000000 +0200 +++ new/flake8-2.2.2/flake8.egg-info/PKG-INFO 2014-07-05 04:53:51.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: flake8 -Version: 2.2.0 +Version: 2.2.2 Summary: the modular source code checker: pep8, pyflakes and co Home-page: http://bitbucket.org/tarek/flake8 Author: Ian Cordasco @@ -86,6 +86,18 @@ CHANGES ======= + 2.2.2 - 2014-07-04 + ------------------ + + - Re-enable multiprocessing by default while fixing the issue Windows users + were seeing. + + 2.2.1 - 2014-06-30 + ------------------ + + - Turn off multiple jobs by default. To enable automatic use of all CPUs, use + ``--jobs=auto``. Fixes #155 and #154. + 2.2.0 - 2014-06-22 ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-2.2.0/flake8.egg-info/SOURCES.txt new/flake8-2.2.2/flake8.egg-info/SOURCES.txt --- old/flake8-2.2.0/flake8.egg-info/SOURCES.txt 2014-06-23 04:22:27.000000000 +0200 +++ new/flake8-2.2.2/flake8.egg-info/SOURCES.txt 2014-07-05 04:53:51.000000000 +0200 @@ -11,6 +11,7 @@ flake8/_pyflakes.py flake8/_pyflakes.pyc flake8/engine.py +flake8/engine.py.orig flake8/engine.pyc flake8/hooks.py flake8/main.py -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org