Hello community, here is the log from the commit of package python-flake8 for openSUSE:Factory checked in at 2020-10-29 09:47:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8 (Old) and /work/SRC/openSUSE:Factory/.python-flake8.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8" Thu Oct 29 09:47:17 2020 rev:32 rq:840912 version:3.8.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8/python-flake8.changes 2020-09-04 11:03:55.846778254 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8.new.3463/python-flake8.changes 2020-10-29 09:47:20.856114291 +0100 @@ -1,0 +2,13 @@ +Sat Oct 10 18:37:52 UTC 2020 - Arun Persaud <a...@gmx.de> + +- specfile: + * update patch lines numbers + * removed pytest6.patch (included upstream) + +- update to version 3.8.4: + * Fix multiprocessing errors on platforms without sem_open syscall. + (See also GitLab!448) + * Fix skipping of physical checks on the last line of a file which + does not end in a newline (See also GitLab!451) + +------------------------------------------------------------------- Old: ---- flake8-3.8.3.tar.gz pytest6.patch New: ---- flake8-3.8.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8.spec ++++++ --- /var/tmp/diff_new_pack.CVdkYm/_old 2020-10-29 09:47:21.736115122 +0100 +++ /var/tmp/diff_new_pack.CVdkYm/_new 2020-10-29 09:47:21.740115126 +0100 @@ -19,14 +19,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-flake8 -Version: 3.8.3 +Version: 3.8.4 Release: 0 Summary: Modular source code checker: pep8, pyflakes and co License: MIT URL: https://gitlab.com/pycqa/flake8 Source: https://files.pythonhosted.org/packages/source/f/flake8/flake8-%{version}.tar.gz Patch0: fix-mock-patch-with-python3.4.patch -Patch1: pytest6.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros ++++++ fix-mock-patch-with-python3.4.patch ++++++ --- /var/tmp/diff_new_pack.CVdkYm/_old 2020-10-29 09:47:21.756115141 +0100 +++ /var/tmp/diff_new_pack.CVdkYm/_new 2020-10-29 09:47:21.756115141 +0100 @@ -5,7 +5,7 @@ builtins in a module, but in python 3.4 the argument is still needed. --- a/tests/unit/test_debug.py +++ b/tests/unit/test_debug.py -@@ -70,7 +70,7 @@ def test_information(system, pyversion, +@@ -64,7 +64,7 @@ def test_information(system, pyversion, system.assert_called_once_with() @@ -14,7 +14,7 @@ @mock.patch('flake8.main.debug.information', return_value={}) @mock.patch('json.dumps', return_value='{}') def test_print_information_no_plugins(dumps, information, print_mock): -@@ -84,7 +84,7 @@ def test_print_information_no_plugins(du +@@ -79,7 +79,7 @@ def test_print_information_no_plugins(du assert print_mock.called is False @@ -25,7 +25,7 @@ def test_print_information(dumps, information, print_mock): --- a/tests/unit/test_base_formatter.py +++ b/tests/unit/test_base_formatter.py -@@ -23,7 +23,7 @@ def test_start(filename): +@@ -20,7 +20,7 @@ def test_start(filename): """Verify we open a new file in the start method.""" mock_open = mock.mock_open() formatter = base.BaseFormatter(options(output_file=filename)) @@ -34,7 +34,7 @@ formatter.start() if filename is None: -@@ -93,7 +93,7 @@ def test_write_uses_an_output_file(tee): +@@ -100,7 +100,7 @@ def test_write_uses_an_output_file(tee): formatter = base.BaseFormatter(options(tee=tee)) formatter.output_fd = filemock @@ -43,7 +43,7 @@ formatter.write(line, source) if tee: assert print_func.called -@@ -112,7 +112,7 @@ def test_write_uses_an_output_file(tee): +@@ -119,7 +119,7 @@ def test_write_uses_an_output_file(tee): ] ++++++ flake8-3.8.3.tar.gz -> flake8-3.8.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/PKG-INFO new/flake8-3.8.4/PKG-INFO --- old/flake8-3.8.3/PKG-INFO 2020-06-08 21:30:20.849549300 +0200 +++ new/flake8-3.8.4/PKG-INFO 2020-10-03 01:33:47.247389600 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: flake8 -Version: 3.8.3 +Version: 3.8.4 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.3/docs/source/internal/checker.rst new/flake8-3.8.4/docs/source/internal/checker.rst --- old/flake8-3.8.3/docs/source/internal/checker.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/internal/checker.rst 2020-10-03 01:13:01.000000000 +0200 @@ -5,7 +5,7 @@ In |Flake8| 2.x, |Flake8| delegated check running to pep8. In 3.0 |Flake8| takes on that responsibility. This has allowed for simpler handling of the ``--jobs`` parameter (using :mod:`multiprocessing`) and -simplified our fallback if something goes awry with concurency. +simplified our fallback if something goes awry with concurrency. At the lowest level we have a |FileChecker|. Instances of |FileChecker| are created for *each* file to be analyzed by |Flake8|. Each instance, has a copy of all of the plugins registered with setuptools in the ``flake8.extension`` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/internal/index.rst new/flake8-3.8.4/docs/source/internal/index.rst --- old/flake8-3.8.3/docs/source/internal/index.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/internal/index.rst 2020-10-03 01:13:01.000000000 +0200 @@ -4,7 +4,7 @@ While writing |Flake8| 3.0, the developers attempted to capture some reasoning and decision information in internal documentation meant for future developers -and maintaners. Most of this information is unnecessary for users and plugin +and maintainers. Most of this information is unnecessary for users and plugin developers. Some of it, however, is linked to from the plugin development documentation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/plugin-development/index.rst new/flake8-3.8.4/docs/source/plugin-development/index.rst --- old/flake8-3.8.3/docs/source/plugin-development/index.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/plugin-development/index.rst 2020-10-03 01:13:01.000000000 +0200 @@ -42,6 +42,19 @@ - How to write your check plugin so that it works with |Flake8| 2.x and 3.x + +Video Tutorial +============== + +Here's a tutorial which goes over building an ast checking plugin from scratch: + +.. raw:: html + + <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; margin-bottom: 1em;"> + <iframe src="https://www.youtube.com/embed/ot5Z4KQPBL8" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe> + </div> + + .. toctree:: :caption: Plugin Developer Documentation :maxdepth: 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/plugin-development/registering-plugins.rst new/flake8-3.8.4/docs/source/plugin-development/registering-plugins.rst --- old/flake8-3.8.3/docs/source/plugin-development/registering-plugins.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/plugin-development/registering-plugins.rst 2020-10-03 01:13:01.000000000 +0200 @@ -82,7 +82,7 @@ We tell setuptools to register our entry point ``X`` inside the specific grouping of entry-points that flake8 should look in. -|Flake8| presently looks at three groups: +|Flake8| presently looks at two groups: - ``flake8.extension`` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/release-notes/3.7.7.rst new/flake8-3.8.4/docs/source/release-notes/3.7.7.rst --- old/flake8-3.8.3/docs/source/release-notes/3.7.7.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/release-notes/3.7.7.rst 2020-10-03 01:13:01.000000000 +0200 @@ -6,8 +6,8 @@ Bugs Fixed ~~~~~~~~~~ -- Fix crahes in plugins causing ``flake8`` to hang while unpickling errors (See - also `GitLab!308`_, `GitLab#505`_) +- Fix crashes in plugins causing ``flake8`` to hang while unpickling errors + (See also `GitLab!308`_, `GitLab#505`_) .. all links diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/release-notes/3.8.2.rst new/flake8-3.8.4/docs/source/release-notes/3.8.2.rst --- old/flake8-3.8.3/docs/source/release-notes/3.8.2.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/release-notes/3.8.2.rst 2020-10-03 01:13:01.000000000 +0200 @@ -6,7 +6,7 @@ Bugs Fixed ~~~~~~~~~~ -- Improve performance by eliminating unncessary sort (See also `GitLab!429`_) +- Improve performance by eliminating unnecessary sort (See also `GitLab!429`_) - Improve messaging of ``--jobs`` argument by utilizing ``argparse`` (See also `GitLab!428`_, `GitLab#567`_) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/release-notes/3.8.4.rst new/flake8-3.8.4/docs/source/release-notes/3.8.4.rst --- old/flake8-3.8.3/docs/source/release-notes/3.8.4.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/flake8-3.8.4/docs/source/release-notes/3.8.4.rst 2020-10-03 01:28:28.000000000 +0200 @@ -0,0 +1,23 @@ +3.8.4 -- 2020-10-02 +------------------- + +You can view the `3.8.4 milestone`_ on GitLab for more details. + +Bugs Fixed +~~~~~~~~~~ + +- Fix multiprocessing errors on platforms without ``sem_open`` syscall. (See + also `GitLab!448`_) + +- Fix skipping of physical checks on the last line of a file which does not + end in a newline (See also `GitLab!451`_) + +.. all links +.. _3.8.4 milestone: + https://gitlab.com/pycqa/flake8/-/milestones/37 + +.. merge request links +.. _GitLab!448: + https://gitlab.com/pycqa/flake8/merge_requests/448 +.. _GitLab!451: + https://gitlab.com/pycqa/flake8/merge_requests/451 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/release-notes/index.rst new/flake8-3.8.4/docs/source/release-notes/index.rst --- old/flake8-3.8.3/docs/source/release-notes/index.rst 2020-06-08 21:19:16.000000000 +0200 +++ new/flake8-3.8.4/docs/source/release-notes/index.rst 2020-10-03 01:28:47.000000000 +0200 @@ -9,6 +9,7 @@ ================== .. toctree:: + 3.8.4 3.8.3 3.8.2 3.8.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/user/configuration.rst new/flake8-3.8.4/docs/source/user/configuration.rst --- old/flake8-3.8.3/docs/source/user/configuration.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/user/configuration.rst 2020-10-03 01:13:01.000000000 +0200 @@ -141,7 +141,7 @@ dist max-complexity = 10 -This would allow us to add comments for why we're excluding items, e.g., +This allows us to add comments for why we're excluding items, e.g. .. code-block:: ini @@ -164,6 +164,29 @@ .. note:: + Following the recommended settings for + `Python's configparser <https://docs.python.org/3/library/configparser.html#customizing-parser-behaviour>`_, + |Flake8| does not support inline comments for any of the keys. So while + this is fine: + + .. code-block:: ini + + [flake8] + per-file-ignores = + # imported but unused + __init__.py: F401 + + this is not: + + .. code-block:: ini + + [flake8] + per-file-ignores = + __init__.py: F401 # imported but unused + + +.. note:: + If you're using Python 2, you will notice that we download the :mod:`configparser` backport from PyPI. That backport enables us to support this behaviour on all supported versions of Python. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/user/options.rst new/flake8-3.8.4/docs/source/user/options.rst --- old/flake8-3.8.3/docs/source/user/options.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/user/options.rst 2020-10-03 01:13:01.000000000 +0200 @@ -223,7 +223,7 @@ Provide a comma-separated list of glob patterns to exclude from checks. - This defaults to: ``.svn,CVS,.bzr,.hg,.git,__pycache__,.tox`` + This defaults to: ``.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg`` Example patterns: @@ -532,7 +532,7 @@ 'http://...' ) - This defaults to: 79 + This defaults to: ``79`` Command-line example: @@ -580,7 +580,7 @@ that start with that string. For example, you can use ``E``, ``E4``, ``E43``, and ``E431``. - This defaults to: E,F,W,C + This defaults to: ``E,F,W,C90`` Command-line example: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/user/python-api.rst new/flake8-3.8.4/docs/source/user/python-api.rst --- old/flake8-3.8.3/docs/source/user/python-api.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/user/python-api.rst 2020-10-03 01:13:01.000000000 +0200 @@ -82,7 +82,7 @@ .. automethod:: flake8.api.legacy.Report.get_statistics Most usage of this method that we noted was as documented above. Keep in mind, -however, that it provides a list of strings and not anything more maleable. +however, that it provides a list of strings and not anything more malleable. Autogenerated Legacy Documentation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/docs/source/user/violations.rst new/flake8-3.8.4/docs/source/user/violations.rst --- old/flake8-3.8.3/docs/source/user/violations.rst 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/docs/source/user/violations.rst 2020-10-03 01:13:01.000000000 +0200 @@ -196,7 +196,7 @@ example.py:4:9: E131 continuation line unaligned for hanging indent example.py:5:9: E121 continuation line under-indented for hanging indent -Suddenly we now have far more erors that are reported to us. Using +Suddenly we now have far more errors that are reported to us. Using ``--select`` alone will override the default ``--ignore`` list. In these cases, the user is telling us that they want all ``E`` violations and so we ignore our list of violations that we ignore by default. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/__init__.py new/flake8-3.8.4/src/flake8/__init__.py --- old/flake8-3.8.3/src/flake8/__init__.py 2020-06-08 21:19:20.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/__init__.py 2020-10-03 01:28:54.000000000 +0200 @@ -18,7 +18,7 @@ LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) -__version__ = "3.8.3" +__version__ = "3.8.4" __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.3/src/flake8/api/legacy.py new/flake8-3.8.4/src/flake8/api/legacy.py --- old/flake8-3.8.3/src/flake8/api/legacy.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/api/legacy.py 2020-10-03 01:13:01.000000000 +0200 @@ -41,7 +41,8 @@ application.find_plugins(config_finder) application.register_plugin_options() application.parse_configuration_and_cli( - config_finder, remaining_args, + config_finder, + remaining_args, ) # We basically want application.initialize to be called but with these # options set instead before we make our formatter, notifier, internal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/checker.py new/flake8-3.8.4/src/flake8/checker.py --- old/flake8-3.8.3/src/flake8/checker.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/checker.py 2020-10-03 01:13:01.000000000 +0200 @@ -9,7 +9,7 @@ from typing import Dict, List, Optional, Tuple try: - import multiprocessing + import multiprocessing.pool except ImportError: multiprocessing = None # type: ignore @@ -109,7 +109,7 @@ # First we walk through all of our error cases: # - multiprocessing library is not present # - we're running on windows in which case we know we have significant - # implemenation issues + # implementation issues # - the user provided stdin and that's not something we can handle # well # - we're processing a diff, which again does not work well with @@ -262,18 +262,16 @@ results_found += len(results) return (results_found, results_reported) - def run_parallel(self): + def run_parallel(self): # type: () -> None """Run the checkers in parallel.""" # fmt: off final_results = collections.defaultdict(list) # type: Dict[str, List[Tuple[str, int, int, str, Optional[str]]]] # noqa: E501 - final_statistics = collections.defaultdict(dict) # type: Dict[str, Dict[str, None]] # noqa: E501 + final_statistics = collections.defaultdict(dict) # type: Dict[str, Dict[str, int]] # noqa: E501 # fmt: on - try: - pool = multiprocessing.Pool(self.jobs, _pool_init) - except OSError as oserr: - if oserr.errno not in SERIAL_RETRY_ERRNOS: - raise + pool = _try_initialize_processpool(self.jobs) + + if pool is None: self.run_serial() return @@ -303,12 +301,12 @@ checker.results = final_results[filename] checker.statistics = final_statistics[filename] - def run_serial(self): + def run_serial(self): # type: () -> None """Run the checkers in serial.""" for checker in self.checkers: checker.run_checks() - def run(self): + def run(self): # type: () -> None """Run all the checkers. This will intelligently decide whether to run the checks in parallel @@ -566,9 +564,10 @@ parens = 0 statistics = self.statistics file_processor = self.processor + prev_physical = "" for token in file_processor.generate_tokens(): statistics["tokens"] += 1 - self.check_physical_eol(token) + self.check_physical_eol(token, prev_physical) token_type, text = token[0:2] processor.log_token(LOG, token) if token_type == tokenize.OP: @@ -576,6 +575,7 @@ elif parens == 0: if processor.token_is_newline(token): self.handle_newline(token_type) + prev_physical = token[4] if file_processor.tokens: # If any tokens are left over, process them @@ -611,11 +611,18 @@ else: self.run_logical_checks() - def check_physical_eol(self, token): + def check_physical_eol(self, token, prev_physical): + # type: (processor._Token, str) -> None """Run physical checks if and only if it is at the end of the line.""" + # a newline token ends a single physical line. if processor.is_eol_token(token): - # Obviously, a newline token ends a single physical line. - self.run_physical_checks(token[4]) + # if the file does not end with a newline, the NEWLINE + # token is inserted by the parser, but it does not contain + # the previous physical line in `token[4]` + if token[4] == "": + self.run_physical_checks(prev_physical) + else: + self.run_physical_checks(token[4]) elif processor.is_multiline_string(token): # Less obviously, a string that contains newlines is a # multiline string, either triple-quoted or with internal @@ -634,11 +641,25 @@ self.run_physical_checks(line + "\n") -def _pool_init(): +def _pool_init(): # type: () -> None """Ensure correct signaling of ^C using multiprocessing.Pool.""" signal.signal(signal.SIGINT, signal.SIG_IGN) +def _try_initialize_processpool(job_count): + # type: (int) -> Optional[multiprocessing.pool.Pool] + """Return a new process pool instance if we are able to create one.""" + try: + return multiprocessing.Pool(job_count, _pool_init) + except OSError as err: + if err.errno not in SERIAL_RETRY_ERRNOS: + raise + except ImportError: + pass + + return None + + def calculate_pool_chunksize(num_checkers, num_jobs): """Determine the chunksize for the multiprocessing Pool. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/defaults.py new/flake8-3.8.4/src/flake8/defaults.py --- old/flake8-3.8.3/src/flake8/defaults.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/defaults.py 2020-10-03 01:13:01.000000000 +0200 @@ -35,7 +35,7 @@ # We do not want to capture the ``: `` that follows ``noqa`` # We do not care about the casing of ``noqa`` # We want a comma-separated list of errors - # https://regex101.com/r/4XUuax/2 full explenation of the regex + # https://regex101.com/r/4XUuax/2 full explanation of the regex r"# noqa(?::[\s]?(?P<codes>([A-Z]+[0-9]+(?:[,\s]+)?)+))?", re.IGNORECASE, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/main/application.py new/flake8-3.8.4/src/flake8/main/application.py --- old/flake8-3.8.3/src/flake8/main/application.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/main/application.py 2020-10-03 01:13:01.000000000 +0200 @@ -180,7 +180,9 @@ Command-line arguments passed in directly. """ self.options, self.args = aggregator.aggregate_options( - self.option_manager, config_finder, argv, + self.option_manager, + config_finder, + argv, ) self.running_against_diff = self.options.diff @@ -328,7 +330,8 @@ self.find_plugins(config_finder) self.register_plugin_options() self.parse_configuration_and_cli( - config_finder, remaining_args, + config_finder, + remaining_args, ) self.make_formatter() self.make_guide() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/main/mercurial.py new/flake8-3.8.4/src/flake8/main/mercurial.py --- old/flake8-3.8.3/src/flake8/main/mercurial.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/main/mercurial.py 2020-10-03 01:13:01.000000000 +0200 @@ -21,7 +21,7 @@ around Hooks: https://www.mercurial-scm.org/wiki/Hook. We avoid using the ``ui`` attribute because it can cause issues with - the GPL license tha Mercurial is under. We don't import it, but we + the GPL license that Mercurial is under. We don't import it, but we avoid using it all the same. """ from flake8.main import application diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/main/vcs.py new/flake8-3.8.4/src/flake8/main/vcs.py --- old/flake8-3.8.3/src/flake8/main/vcs.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/main/vcs.py 2020-10-03 01:13:01.000000000 +0200 @@ -12,7 +12,7 @@ # NOTE(sigmavirus24): In the future, we may allow for VCS hooks to be defined # as plugins, e.g., adding a flake8.vcs entry-point. In that case, this # dictionary should disappear, and this module might contain more code for -# managing those bits (in conjuntion with flake8.plugins.manager). +# managing those bits (in conjunction with flake8.plugins.manager). _INSTALLERS = {"git": git.install, "mercurial": mercurial.install} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/options/config.py new/flake8-3.8.4/src/flake8/options/config.py --- old/flake8-3.8.3/src/flake8/options/config.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/options/config.py 2020-10-03 01:13:01.000000000 +0200 @@ -30,7 +30,7 @@ :param list extra_config_files: Extra configuration files specified by the user to read. :param str config_file: - Configuration file override to only read configuraiton from. + Configuration file override to only read configuration from. :param bool ignore_config_files: Determine whether to ignore configuration files or not. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/options/manager.py new/flake8-3.8.4/src/flake8/options/manager.py --- old/flake8-3.8.3/src/flake8/options/manager.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/options/manager.py 2020-10-03 01:13:01.000000000 +0200 @@ -132,7 +132,7 @@ Number of arguments to parse for this option. :param const: Constant value to store on a common destination. Usually used in - conjuntion with ``action="store_const"``. + conjunction with ``action="store_const"``. :param iterable choices: Possible values for the option. :param str help: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8/utils.py new/flake8-3.8.4/src/flake8/utils.py --- old/flake8-3.8.3/src/flake8/utils.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/src/flake8/utils.py 2020-10-03 01:13:01.000000000 +0200 @@ -79,7 +79,7 @@ def parse_files_to_codes_mapping(value_): # noqa: C901 # type: (Union[Sequence[str], str]) -> List[Tuple[str, List[str]]] - """Parse a files-to-codes maping. + """Parse a files-to-codes mapping. A files-to-codes mapping a sequence of values specified as `filenames list:codes list ...`. Each of the lists may be separated by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/src/flake8.egg-info/PKG-INFO new/flake8-3.8.4/src/flake8.egg-info/PKG-INFO --- old/flake8-3.8.3/src/flake8.egg-info/PKG-INFO 2020-06-08 21:30:20.000000000 +0200 +++ new/flake8-3.8.4/src/flake8.egg-info/PKG-INFO 2020-10-03 01:33:47.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: flake8 -Version: 3.8.3 +Version: 3.8.4 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.3/src/flake8.egg-info/SOURCES.txt new/flake8-3.8.4/src/flake8.egg-info/SOURCES.txt --- old/flake8-3.8.3/src/flake8.egg-info/SOURCES.txt 2020-06-08 21:30:20.000000000 +0200 +++ new/flake8-3.8.4/src/flake8.egg-info/SOURCES.txt 2020-10-03 01:33:47.000000000 +0200 @@ -92,6 +92,7 @@ docs/source/release-notes/3.8.1.rst docs/source/release-notes/3.8.2.rst docs/source/release-notes/3.8.3.rst +docs/source/release-notes/3.8.4.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.3/tests/integration/test_checker.py new/flake8-3.8.4/tests/integration/test_checker.py --- old/flake8-3.8.3/tests/integration/test_checker.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/tests/integration/test_checker.py 2020-10-03 01:13:01.000000000 +0200 @@ -100,6 +100,7 @@ entry_point = mock.Mock(spec=['load']) entry_point.name = plugin_target.name entry_point.load.return_value = plugin_target + entry_point.value = 'mocked:value' # Load the checker plugins using the entry point mock with mock.patch.object( @@ -245,3 +246,38 @@ with mock.patch.object(manager, '_handle_results', handler): assert manager.report() == (len(results), len(results)) handler.assert_called_once_with('placeholder', expected_results) + + +def test_acquire_when_multiprocessing_pool_can_initialize(): + """Verify successful importing of hardware semaphore support. + + Mock the behaviour of a platform that has a hardware sem_open + implementation, and then attempt to initialize a multiprocessing + Pool object. + + This simulates the behaviour on most common platforms. + """ + with mock.patch("multiprocessing.Pool") as pool: + result = checker._try_initialize_processpool(2) + + pool.assert_called_once_with(2, checker._pool_init) + assert result is pool.return_value + + +def test_acquire_when_multiprocessing_pool_can_not_initialize(): + """Verify unsuccessful importing of hardware semaphore support. + + Mock the behaviour of a platform that has not got a hardware sem_open + implementation, and then attempt to initialize a multiprocessing + Pool object. + + This scenario will occur on platforms such as Termux and on some + more exotic devices. + + https://github.com/python/cpython/blob/4e02981de0952f54bf87967f8e10d169d6946b40/Lib/multiprocessing/synchronize.py#L30-L33 + """ + with mock.patch("multiprocessing.Pool", side_effect=ImportError) as pool: + result = checker._try_initialize_processpool(2) + + pool.assert_called_once_with(2, checker._pool_init) + assert result is None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/tests/integration/test_main.py new/flake8-3.8.4/tests/integration/test_main.py --- old/flake8-3.8.3/tests/integration/test_main.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/tests/integration/test_main.py 2020-10-03 01:13:01.000000000 +0200 @@ -212,6 +212,37 @@ assert out == err == '' +def test_physical_line_file_not_ending_in_newline(tmpdir, capsys): + """See https://github.com/PyCQA/pycodestyle/issues/960.""" + t_py_src = 'def f():\n\tpass' + + with tmpdir.as_cwd(): + tmpdir.join('t.py').write(t_py_src) + _call_main(['t.py'], retv=1) + + out, err = capsys.readouterr() + assert out == '''\ +t.py:2:1: W191 indentation contains tabs +t.py:2:6: W292 no newline at end of file +''' + + +@pytest.mark.xfail(strict=True) # currently awaiting fix in pycodestyle +def test_physical_line_file_not_ending_in_newline_trailing_ws(tmpdir, capsys): + """See https://github.com/PyCQA/pycodestyle/issues/960.""" + t_py_src = 'x = 1 ' + + with tmpdir.as_cwd(): + tmpdir.join('t.py').write(t_py_src) + _call_main(['t.py'], retv=1) + + out, err = capsys.readouterr() + assert out == '''\ +t.py:1:6: W291 trailing whitespace +t.py:1:10: W292 no newline at end of file +''' + + def test_obtaining_args_from_sys_argv_when_not_explicity_provided(capsys): """Test that arguments are obtained from 'sys.argv'.""" with mock.patch('sys.argv', ['flake8', '--help']): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/tests/unit/test_file_processor.py new/flake8-3.8.4/tests/unit/test_file_processor.py --- old/flake8-3.8.3/tests/unit/test_file_processor.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/tests/unit/test_file_processor.py 2020-10-03 01:13:01.000000000 +0200 @@ -228,7 +228,7 @@ ('line 1\n\nline 2\n', ['line 1', '', 'line 2']), ]) def test_split_line(unsplit_line, expected_lines, default_options): - """Verify the token line spliting.""" + """Verify the token line splitting.""" file_processor = processor.FileProcessor('-', default_options, lines=[ 'Line 1', ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/tests/unit/test_legacy_api.py new/flake8-3.8.4/tests/unit/test_legacy_api.py --- old/flake8-3.8.3/tests/unit/test_legacy_api.py 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/tests/unit/test_legacy_api.py 2020-10-03 01:13:01.000000000 +0200 @@ -42,7 +42,7 @@ def test_styleguide_options(): - """Show tha we proxy the StyleGuide.options attribute.""" + """Show that we proxy the StyleGuide.options attribute.""" app = mock.Mock() app.options = 'options' style_guide = api.StyleGuide(app) @@ -50,7 +50,7 @@ def test_styleguide_paths(): - """Show tha we proxy the StyleGuide.paths attribute.""" + """Show that we proxy the StyleGuide.paths attribute.""" app = mock.Mock() app.paths = 'paths' style_guide = api.StyleGuide(app) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-3.8.3/tox.ini new/flake8-3.8.4/tox.ini --- old/flake8-3.8.3/tox.ini 2020-06-08 21:15:48.000000000 +0200 +++ new/flake8-3.8.4/tox.ini 2020-10-03 01:13:01.000000000 +0200 @@ -32,15 +32,6 @@ flake8 --version flake8 src/flake8/ tests/ setup.py -# Autoformatter -[testenv:black] -basepython = python3 -skip_install = true -deps = - black>=19.3b0 -commands = - black --line-length 78 src/ - # Linters [testenv:flake8] basepython = python3 @@ -93,14 +84,12 @@ basepython = python3 skip_install = true deps = - {[testenv:black]deps} {[testenv:flake8]deps} {[testenv:pylint]deps} {[testenv:doc8]deps} {[testenv:readme]deps} {[testenv:bandit]deps} commands = - {[testenv:black]commands} {[testenv:flake8]commands} {[testenv:pylint]commands} {[testenv:doc8]commands}