Hello community, here is the log from the commit of package python-flake8 for openSUSE:Factory checked in at 2020-06-05 20:00:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8 (Old) and /work/SRC/openSUSE:Factory/.python-flake8.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8" Fri Jun 5 20:00:10 2020 rev:29 rq:810992 version:3.8.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8/python-flake8.changes 2020-05-28 09:06:13.623502522 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8.new.3606/python-flake8.changes 2020-06-05 20:00:20.651965657 +0200 @@ -1,0 +2,13 @@ +Wed Jun 3 02:23:36 UTC 2020 - Arun Persaud <a...@gmx.de> + +- update to version 3.8.2: + * Improve performance by eliminating unncessary sort (See also + GitLab!429) + * Improve messaging of --jobs argument by utilizing argparse (See + also GitLab!428, GitLab#567) + * Fix file configuration options to be relative to the config passed + on the command line (See also GitLab!431, GitLab#651) + * Fix incorrect handling of --extend-exclude by treating its values + as files (See also GitLab!432, GitLab#653) + +------------------------------------------------------------------- Old: ---- flake8-3.8.1.tar.gz New: ---- flake8-3.8.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8.spec ++++++ --- /var/tmp/diff_new_pack.65vZBU/_old 2020-06-05 20:00:22.227971108 +0200 +++ /var/tmp/diff_new_pack.65vZBU/_new 2020-06-05 20:00:22.231971122 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-flake8 -Version: 3.8.1 +Version: 3.8.2 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT ++++++ flake8-3.8.1.tar.gz -> flake8-3.8.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/PKG-INFO new/flake8-3.8.2/PKG-INFO --- old/flake8-3.8.1/PKG-INFO 2020-05-12 07:35:21.000000000 +0200 +++ new/flake8-3.8.2/PKG-INFO 2020-05-23 00:38:46.682947400 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: flake8 -Version: 3.8.1 +Version: 3.8.2 Summary: the modular source code checker: pep8 pyflakes and co Home-page: https://gitlab.com/pycqa/flake8 Author: Tarek Ziade diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/docs/source/release-notes/3.8.2.rst new/flake8-3.8.2/docs/source/release-notes/3.8.2.rst --- old/flake8-3.8.1/docs/source/release-notes/3.8.2.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-3.8.2/docs/source/release-notes/3.8.2.rst 2020-05-23 00:33:09.000000000 +0200 @@ -0,0 +1,40 @@ +3.8.2 -- 2020-05-22 +------------------- + +You can view the `3.8.2 milestone`_ on GitLab for more details. + +Bugs Fixed +~~~~~~~~~~ + +- Improve performance by eliminating unncessary sort (See also `GitLab!429`_) + +- Improve messaging of ``--jobs`` argument by utilizing ``argparse`` (See also + `GitLab!428`_, `GitLab#567`_) + +- Fix file configuration options to be relative to the config passed on the + command line (See also `GitLab!431`_, `GitLab#651`_) + +- Fix incorrect handling of ``--extend-exclude`` by treating its values as + files (See also `GitLab!432`_, `GitLab#653`_) + +.. all links +.. _3.8.2 milestone: + https://gitlab.com/pycqa/flake8/-/milestones/35 + +.. issue links +.. _GitLab#567: + https://gitlab.com/pycqa/flake8/issues/567 +.. _GitLab#651: + https://gitlab.com/pycqa/flake8/issues/651 +.. _GitLab#653: + https://gitlab.com/pycqa/flake8/issues/653 + +.. merge request links +.. _GitLab!428: + https://gitlab.com/pycqa/flake8/merge_requests/428 +.. _GitLab!429: + https://gitlab.com/pycqa/flake8/merge_requests/429 +.. _GitLab!431: + https://gitlab.com/pycqa/flake8/merge_requests/431 +.. _GitLab!432: + https://gitlab.com/pycqa/flake8/merge_requests/432 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/docs/source/release-notes/index.rst new/flake8-3.8.2/docs/source/release-notes/index.rst --- old/flake8-3.8.1/docs/source/release-notes/index.rst 2020-05-12 07:28:52.000000000 +0200 +++ new/flake8-3.8.2/docs/source/release-notes/index.rst 2020-05-23 00:25:54.000000000 +0200 @@ -9,6 +9,7 @@ ================== .. toctree:: + 3.8.2 3.8.1 3.8.0 3.7.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/src/flake8/__init__.py new/flake8-3.8.2/src/flake8/__init__.py --- old/flake8-3.8.1/src/flake8/__init__.py 2020-05-12 07:29:04.000000000 +0200 +++ new/flake8-3.8.2/src/flake8/__init__.py 2020-05-23 00:26:05.000000000 +0200 @@ -18,7 +18,7 @@ LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) -__version__ = "3.8.1" +__version__ = "3.8.2" __version_info__ = tuple( int(i) for i in __version__.split(".") if i.isdigit() ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/src/flake8/checker.py new/flake8-3.8.2/src/flake8/checker.py --- old/flake8-3.8.1/src/flake8/checker.py 2020-05-12 07:11:15.000000000 +0200 +++ new/flake8-3.8.2/src/flake8/checker.py 2020-05-13 22:51:24.000000000 +0200 @@ -137,19 +137,12 @@ return 0 jobs = self.options.jobs - if jobs != "auto" and not jobs.isdigit(): - LOG.warning( - '"%s" is not a valid parameter to --jobs. Must be one ' - 'of "auto" or a numerical value, e.g., 4.', - jobs, - ) - return 0 # If the value is "auto", we want to let the multiprocessing library # decide the number based on the number of CPUs. However, if that # function is not implemented for this particular value of Python we # default to 1 - if jobs == "auto": + if jobs.is_auto: try: return multiprocessing.cpu_count() except NotImplementedError: @@ -157,7 +150,7 @@ # Otherwise, we know jobs should be an integer and we can just convert # it to an integer - return int(jobs) + return jobs.n_jobs def _handle_results(self, filename, results): style_guide = self.style_guide @@ -307,9 +300,7 @@ for checker in self.checkers: filename = checker.display_name - checker.results = sorted( - final_results[filename], key=lambda tup: (tup[2], tup[2]) - ) + checker.results = final_results[filename] checker.statistics = final_statistics[filename] def run_serial(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/src/flake8/main/options.py new/flake8-3.8.2/src/flake8/main/options.py --- old/flake8-3.8.1/src/flake8/main/options.py 2020-05-12 07:11:15.000000000 +0200 +++ new/flake8-3.8.2/src/flake8/main/options.py 2020-05-23 00:24:08.000000000 +0200 @@ -62,6 +62,27 @@ ) +class JobsArgument: + """Type callback for the --jobs argument.""" + + def __init__(self, arg): # type: (str) -> None + """Parse and validate the --jobs argument. + + :param str arg: + The argument passed by argparse for validation + """ + self.is_auto = False + self.n_jobs = -1 + if arg == "auto": + self.is_auto = True + elif arg.isdigit(): + self.n_jobs = int(arg) + else: + raise argparse.ArgumentTypeError( + "{!r} must be 'auto' or an integer.".format(arg), + ) + + def register_default_options(option_manager): """Register the default options on our OptionManager. @@ -135,6 +156,7 @@ default="", parse_from_config=True, comma_separated_list=True, + normalize_paths=True, help="Comma-separated list of files or directories to add to the list" " of excluded ones.", ) @@ -293,6 +315,7 @@ "--jobs", default="auto", parse_from_config=True, + type=JobsArgument, help="Number of subprocesses to use to run checks in parallel. " 'This is ignored on Windows. The default, "auto", will ' "auto-detect the number of processors available to use." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/src/flake8/options/config.py new/flake8-3.8.2/src/flake8/options/config.py --- old/flake8-3.8.1/src/flake8/options/config.py 2020-05-12 07:11:15.000000000 +0200 +++ new/flake8-3.8.2/src/flake8/options/config.py 2020-05-23 00:35:34.000000000 +0200 @@ -184,10 +184,11 @@ #: Our instance of our :class:`~ConfigFileFinder` self.config_finder = config_finder - def _normalize_value(self, option, value): - final_value = option.normalize( - value, self.config_finder.local_directory - ) + def _normalize_value(self, option, value, parent=None): + if parent is None: + parent = self.config_finder.local_directory + + final_value = option.normalize(value, parent) LOG.debug( '%r has been normalized to %r for option "%s"', value, @@ -196,7 +197,7 @@ ) return final_value - def _parse_config(self, config_parser): + def _parse_config(self, config_parser, parent=None): config_dict = {} for option_name in config_parser.options(self.program_name): if option_name not in self.config_options: @@ -216,7 +217,7 @@ value = method(self.program_name, option_name) LOG.debug('Option "%s" returned value: %r', option_name, value) - final_value = self._normalize_value(option, value) + final_value = self._normalize_value(option, value, parent) config_dict[option.config_name] = final_value return config_dict @@ -262,7 +263,7 @@ return {} LOG.debug("Parsing CLI configuration files.") - return self._parse_config(config) + return self._parse_config(config, os.path.dirname(config_path)) def merge_user_and_local_config(self): """Merge the parsed user and local configuration files. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/src/flake8.egg-info/PKG-INFO new/flake8-3.8.2/src/flake8.egg-info/PKG-INFO --- old/flake8-3.8.1/src/flake8.egg-info/PKG-INFO 2020-05-12 07:35:21.000000000 +0200 +++ new/flake8-3.8.2/src/flake8.egg-info/PKG-INFO 2020-05-23 00:38:46.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: flake8 -Version: 3.8.1 +Version: 3.8.2 Summary: the modular source code checker: pep8 pyflakes and co Home-page: https://gitlab.com/pycqa/flake8 Author: Tarek Ziade diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/src/flake8.egg-info/SOURCES.txt new/flake8-3.8.2/src/flake8.egg-info/SOURCES.txt --- old/flake8-3.8.1/src/flake8.egg-info/SOURCES.txt 2020-05-12 07:35:21.000000000 +0200 +++ new/flake8-3.8.2/src/flake8.egg-info/SOURCES.txt 2020-05-23 00:38:46.000000000 +0200 @@ -90,6 +90,7 @@ docs/source/release-notes/3.7.9.rst docs/source/release-notes/3.8.0.rst docs/source/release-notes/3.8.1.rst +docs/source/release-notes/3.8.2.rst docs/source/release-notes/index.rst docs/source/user/configuration.rst docs/source/user/error-codes.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/tests/integration/test_main.py new/flake8-3.8.2/tests/integration/test_main.py --- old/flake8-3.8.1/tests/integration/test_main.py 2020-05-12 07:25:48.000000000 +0200 +++ new/flake8-3.8.2/tests/integration/test_main.py 2020-05-23 00:24:08.000000000 +0200 @@ -114,7 +114,7 @@ tmpdir.mkdir(d).join('t.py').write('import os\nimport sys\n') with tmpdir.as_cwd(): - _call_main(['--extend-exclude=vendor,legacy'], retv=1) + _call_main(['--extend-exclude=vendor,legacy/'], retv=1) out, err = capsys.readouterr() expected_out = '''\ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/tests/unit/test_checker_manager.py new/flake8-3.8.2/tests/unit/test_checker_manager.py --- old/flake8-3.8.1/tests/unit/test_checker_manager.py 2020-05-12 07:11:15.000000000 +0200 +++ new/flake8-3.8.2/tests/unit/test_checker_manager.py 2020-05-13 22:51:24.000000000 +0200 @@ -5,13 +5,14 @@ import pytest from flake8 import checker +from flake8.main.options import JobsArgument def style_guide_mock(): """Create a mock StyleGuide object.""" return mock.MagicMock(**{ 'options.diff': False, - 'options.jobs': '4', + 'options.jobs': JobsArgument("4"), }) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/tests/unit/test_merged_config_parser.py new/flake8-3.8.2/tests/unit/test_merged_config_parser.py --- old/flake8-3.8.1/tests/unit/test_merged_config_parser.py 2020-05-12 07:11:15.000000000 +0200 +++ new/flake8-3.8.2/tests/unit/test_merged_config_parser.py 2020-05-23 00:24:08.000000000 +0200 @@ -31,15 +31,16 @@ action='count') parser = config.MergedConfigParser(optmanager, config_finder) - parsed_config = parser.parse_cli_config( - 'tests/fixtures/config_files/cli-specified.ini' - ) + config_file = 'tests/fixtures/config_files/cli-specified.ini' + parsed_config = parser.parse_cli_config(config_file) + + config_dir = os.path.dirname(config_file) assert parsed_config == { 'ignore': ['E123', 'W234', 'E111'], 'exclude': [ - os.path.abspath('foo/'), - os.path.abspath('bar/'), - os.path.abspath('bogus/'), + os.path.abspath(os.path.join(config_dir, 'foo/')), + os.path.abspath(os.path.join(config_dir, 'bar/')), + os.path.abspath(os.path.join(config_dir, 'bogus/')), ], 'quiet': 1, } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.1/tests/unit/test_option_manager.py new/flake8-3.8.2/tests/unit/test_option_manager.py --- old/flake8-3.8.1/tests/unit/test_option_manager.py 2020-05-12 07:11:15.000000000 +0200 +++ new/flake8-3.8.2/tests/unit/test_option_manager.py 2020-05-13 22:51:24.000000000 +0200 @@ -6,6 +6,7 @@ import pytest from flake8 import utils +from flake8.main.options import JobsArgument from flake8.options import manager TEST_VERSION = '3.0.0b1' @@ -343,3 +344,32 @@ out, err = capsys.readouterr() output = out + err assert '\ngroupname:\n' in output + + +@pytest.mark.parametrize( + ("s", "is_auto", "n_jobs"), + ( + ("auto", True, -1), + ("4", False, 4), + ), +) +def test_parse_valid_jobs_argument(s, is_auto, n_jobs): + """Test that --jobs properly parses valid arguments.""" + jobs_opt = JobsArgument(s) + assert is_auto == jobs_opt.is_auto + assert n_jobs == jobs_opt.n_jobs + + +def test_parse_invalid_jobs_argument(optmanager, capsys): + """Test that --jobs properly rejects invalid arguments.""" + namespace = argparse.Namespace() + optmanager.add_option("--jobs", type=JobsArgument) + with pytest.raises(SystemExit): + optmanager.parse_args(["--jobs=foo"], namespace) + out, err = capsys.readouterr() + output = out + err + expected = ( + "\nflake8: error: argument --jobs: " + "'foo' must be 'auto' or an integer.\n" + ) + assert expected in output