Hello community, here is the log from the commit of package python-flake8-docstrings for openSUSE:Factory checked in at 2019-09-13 15:02:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-flake8-docstrings (Old) and /work/SRC/openSUSE:Factory/.python-flake8-docstrings.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-flake8-docstrings" Fri Sep 13 15:02:40 2019 rev:5 rq:730531 version:1.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-flake8-docstrings/python-flake8-docstrings.changes 2019-08-05 10:42:25.995291577 +0200 +++ /work/SRC/openSUSE:Factory/.python-flake8-docstrings.new.7948/python-flake8-docstrings.changes 2019-09-13 15:04:15.141270333 +0200 @@ -1,0 +2,14 @@ +Fri Sep 13 07:26:58 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 1.4.0: + * Add --docstring-convention option which allows selection of conventions + besides the default pep257. Available options are based on those + available from pydocstyle and are currently pep257, google, and + numpy. flake8-docstrings also adds a special all docstring + convention which will enable all rules from pydocstyle. Note that + pydocstyle defines some conflicting rules so you'll want to use + ignore / extend-ignore when selecting docstring-convention = all + * Bump minimum flake8 version to 3 + * Fix proper handling of stdin via --stdin-display-name + +------------------------------------------------------------------- Old: ---- flake8-docstrings-1.3.1.tar.gz New: ---- flake8-docstrings-1.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-flake8-docstrings.spec ++++++ --- /var/tmp/diff_new_pack.MlqnY3/_old 2019-09-13 15:04:16.005270149 +0200 +++ /var/tmp/diff_new_pack.MlqnY3/_new 2019-09-13 15:04:16.009270149 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-flake8-docstrings -Version: 1.3.1 +Version: 1.4.0 Release: 0 Summary: Extension for flake8 which uses pydocstyle to check docstrings License: MIT @@ -28,7 +28,7 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-flake8 +Requires: python-flake8 >= 3 Requires: python-flake8-polyfill Requires: python-pydocstyle >= 2.1.0 BuildArch: noarch ++++++ flake8-docstrings-1.3.1.tar.gz -> flake8-docstrings-1.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/HISTORY.rst new/flake8-docstrings-1.4.0/HISTORY.rst --- old/flake8-docstrings-1.3.1/HISTORY.rst 2019-08-02 17:29:13.000000000 +0200 +++ new/flake8-docstrings-1.4.0/HISTORY.rst 2019-08-26 18:33:14.000000000 +0200 @@ -1,6 +1,21 @@ History/Changelog ================= +1.4.0 +----- + +- Add ``--docstring-convention`` option which allows selection of conventions + besides the default ``pep257``. Available options are based on those + available from ``pydocstyle`` and are currently ``pep257``, ``google``, and + ``numpy``. ``flake8-docstrings`` also adds a special ``all`` docstring + convention which will enable all rules from ``pydocstyle``. Note that + ``pydocstyle`` defines some conflicting rules so you'll want to use + ``ignore`` / ``extend-ignore`` when selecting ``docstring-convention = all`` + +- Bump minimum flake8 version to 3 + +- Fix proper handling of ``stdin`` via ``--stdin-display-name`` + 1.3.1 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/PKG-INFO new/flake8-docstrings-1.4.0/PKG-INFO --- old/flake8-docstrings-1.3.1/PKG-INFO 2019-08-02 17:31:21.000000000 +0200 +++ new/flake8-docstrings-1.4.0/PKG-INFO 2019-08-26 18:35:25.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: flake8-docstrings -Version: 1.3.1 +Version: 1.4.0 Summary: Extension for flake8 which uses pydocstyle to check docstrings Home-page: https://gitlab.com/pycqa/flake8-docstrings Author: Simon ANDRÉ @@ -20,16 +20,41 @@ and run flake8. + You can set the pydocstyle convention_ at the command line using:: + + $ flake8 --docstring-convention numpy ... + + Or, adding ``docstring-convention=numpy`` to your flake8 configuration file. + The available set of conventions depends on the version of pydocstyle installed. + The default is ``pep257``, pydocstyle v2.0.0 added ``numpy`` (for the numpydoc + standard), while pydocstyle v4.0.0 added ``google``. + Report any issues on our `bug tracker`_. .. _pydocstyle: https://github.com/pycqa/pydocstyle .. _flake8: https://gitlab.com/pycqa/flake8 + .. _convention: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions .. _bug tracker: https://gitlab.com/pycqa/flake8-docstrings/issues History/Changelog ================= + 1.4.0 + ----- + + - Add ``--docstring-convention`` option which allows selection of conventions + besides the default ``pep257``. Available options are based on those + available from ``pydocstyle`` and are currently ``pep257``, ``google``, and + ``numpy``. ``flake8-docstrings`` also adds a special ``all`` docstring + convention which will enable all rules from ``pydocstyle``. Note that + ``pydocstyle`` defines some conflicting rules so you'll want to use + ``ignore`` / ``extend-ignore`` when selecting ``docstring-convention = all`` + + - Bump minimum flake8 version to 3 + + - Fix proper handling of ``stdin`` via ``--stdin-display-name`` + 1.3.1 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/README.rst new/flake8-docstrings-1.4.0/README.rst --- old/flake8-docstrings-1.3.1/README.rst 2019-08-02 17:27:24.000000000 +0200 +++ new/flake8-docstrings-1.4.0/README.rst 2019-08-26 18:28:09.000000000 +0200 @@ -10,8 +10,18 @@ and run flake8. +You can set the pydocstyle convention_ at the command line using:: + + $ flake8 --docstring-convention numpy ... + +Or, adding ``docstring-convention=numpy`` to your flake8 configuration file. +The available set of conventions depends on the version of pydocstyle installed. +The default is ``pep257``, pydocstyle v2.0.0 added ``numpy`` (for the numpydoc +standard), while pydocstyle v4.0.0 added ``google``. + Report any issues on our `bug tracker`_. .. _pydocstyle: https://github.com/pycqa/pydocstyle .. _flake8: https://gitlab.com/pycqa/flake8 +.. _convention: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions .. _bug tracker: https://gitlab.com/pycqa/flake8-docstrings/issues diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/flake8_docstrings.egg-info/PKG-INFO new/flake8-docstrings-1.4.0/flake8_docstrings.egg-info/PKG-INFO --- old/flake8-docstrings-1.3.1/flake8_docstrings.egg-info/PKG-INFO 2019-08-02 17:31:21.000000000 +0200 +++ new/flake8-docstrings-1.4.0/flake8_docstrings.egg-info/PKG-INFO 2019-08-26 18:35:25.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: flake8-docstrings -Version: 1.3.1 +Version: 1.4.0 Summary: Extension for flake8 which uses pydocstyle to check docstrings Home-page: https://gitlab.com/pycqa/flake8-docstrings Author: Simon ANDRÉ @@ -20,16 +20,41 @@ and run flake8. + You can set the pydocstyle convention_ at the command line using:: + + $ flake8 --docstring-convention numpy ... + + Or, adding ``docstring-convention=numpy`` to your flake8 configuration file. + The available set of conventions depends on the version of pydocstyle installed. + The default is ``pep257``, pydocstyle v2.0.0 added ``numpy`` (for the numpydoc + standard), while pydocstyle v4.0.0 added ``google``. + Report any issues on our `bug tracker`_. .. _pydocstyle: https://github.com/pycqa/pydocstyle .. _flake8: https://gitlab.com/pycqa/flake8 + .. _convention: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions .. _bug tracker: https://gitlab.com/pycqa/flake8-docstrings/issues History/Changelog ================= + 1.4.0 + ----- + + - Add ``--docstring-convention`` option which allows selection of conventions + besides the default ``pep257``. Available options are based on those + available from ``pydocstyle`` and are currently ``pep257``, ``google``, and + ``numpy``. ``flake8-docstrings`` also adds a special ``all`` docstring + convention which will enable all rules from ``pydocstyle``. Note that + ``pydocstyle`` defines some conflicting rules so you'll want to use + ``ignore`` / ``extend-ignore`` when selecting ``docstring-convention = all`` + + - Bump minimum flake8 version to 3 + + - Fix proper handling of ``stdin`` via ``--stdin-display-name`` + 1.3.1 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/flake8_docstrings.egg-info/requires.txt new/flake8-docstrings-1.4.0/flake8_docstrings.egg-info/requires.txt --- old/flake8-docstrings-1.3.1/flake8_docstrings.egg-info/requires.txt 2019-08-02 17:31:21.000000000 +0200 +++ new/flake8-docstrings-1.4.0/flake8_docstrings.egg-info/requires.txt 2019-08-26 18:35:25.000000000 +0200 @@ -1,3 +1,2 @@ -flake8 +flake8>=3 pydocstyle>=2.1 -flake8-polyfill diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/flake8_docstrings.py new/flake8-docstrings-1.4.0/flake8_docstrings.py --- old/flake8-docstrings-1.3.1/flake8_docstrings.py 2019-08-02 17:29:17.000000000 +0200 +++ new/flake8-docstrings-1.4.0/flake8_docstrings.py 2019-08-26 18:32:50.000000000 +0200 @@ -6,8 +6,6 @@ """ import sys -from flake8_polyfill import stdin -import pycodestyle try: import pydocstyle as pep257 module_name = 'pydocstyle' @@ -20,10 +18,13 @@ else: tokenize_open = open -__version__ = '1.3.1' +__version__ = '1.4.0' __all__ = ('pep257Checker',) -stdin.monkey_patch('pycodestyle') + +class _ContainsAll(object): + def __contains__(self, code): # type: (str) -> bool + return True class EnvironError(pep257.Error): @@ -60,18 +61,33 @@ """Flake8 needs a class to check python file.""" name = 'flake8-docstrings' - version = __version__ + ', {0}: {1}'.format( - module_name, pep257.__version__ - ) - - STDIN_NAMES = set(['stdin', '-', '(none)', None]) + version = '{}, {}: {}'.format(__version__, module_name, pep257.__version__) - def __init__(self, tree, filename='(none)'): + def __init__(self, tree, filename, lines): """Placeholder.""" self.tree = tree self.filename = filename self.checker = pep257.ConventionChecker() - self.load_source() + self.source = ''.join(lines) + + @classmethod + def add_options(cls, parser): + """Add plugin configuration option to flake8.""" + parser.add_option( + '--docstring-convention', action='store', parse_from_config=True, + default="pep257", choices=sorted(pep257.conventions) + ['all'], + help=( + "pydocstyle docstring convention, default 'pep257'. " + "Use the special value 'all' to enable all codes (note: " + "some codes are conflicting so you'll need to then exclude " + "those)." + ) + ) + + @classmethod + def parse_options(cls, options): + """Parse the configuration options given to flake8.""" + cls.convention = options.docstring_convention def _check_source(self): try: @@ -91,18 +107,14 @@ def run(self): """Use directly check() api from pydocstyle.""" - checked_codes = pep257.conventions.pep257 | {'D998', 'D999'} + if self.convention == 'all': + checked_codes = _ContainsAll() + else: + checked_codes = ( + pep257.conventions[self.convention] | {'D998', 'D999'} + ) for error in self._check_source(): if isinstance(error, pep257.Error) and error.code in checked_codes: # NOTE(sigmavirus24): Fixes GitLab#3 message = '%s %s' % (error.code, error.short_desc) yield (error.line, 0, message, type(self)) - - def load_source(self): - """Load the source for the specified file.""" - if self.filename in self.STDIN_NAMES: - self.filename = 'stdin' - self.source = pycodestyle.stdin_get_value() - else: - with tokenize_open(self.filename) as fd: - self.source = fd.read() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/flake8-docstrings-1.3.1/setup.py new/flake8-docstrings-1.4.0/setup.py --- old/flake8-docstrings-1.3.1/setup.py 2019-08-02 17:27:24.000000000 +0200 +++ new/flake8-docstrings-1.4.0/setup.py 2019-08-26 18:28:09.000000000 +0200 @@ -44,7 +44,7 @@ 'D = flake8_docstrings:pep257Checker', ], }, - install_requires=['flake8', 'pydocstyle >= 2.1', 'flake8-polyfill'], + install_requires=['flake8 >= 3', 'pydocstyle >= 2.1'], provides=['flake8_docstrings'], py_modules=['flake8_docstrings'], )