Hello community, here is the log from the commit of package python-pytest-codestyle for openSUSE:Factory checked in at 2019-11-26 17:00:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytest-codestyle (Old) and /work/SRC/openSUSE:Factory/.python-pytest-codestyle.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-codestyle" Tue Nov 26 17:00:53 2019 rev:4 rq:750690 version:2.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytest-codestyle/python-pytest-codestyle.changes 2019-08-22 15:17:53.106342634 +0200 +++ /work/SRC/openSUSE:Factory/.python-pytest-codestyle.new.26869/python-pytest-codestyle.changes 2019-11-26 17:01:19.180069036 +0100 @@ -1,0 +2,11 @@ +Mon Nov 18 08:07:25 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 2.0.0: + * Read native config of pycodestyle (#58) + * Remove fnmatch (#64) + * Rename 'codestyle' to 'pycodestyle' (#59) + * Rename test_pytest_codestyle.py to test_pytest_pycodestyle.py (#60) + * Update README.md (#62) +- Update the patch fix-super.patch that fixes python2 execution + +------------------------------------------------------------------- Old: ---- pytest-codestyle-1.4.0.tar.gz New: ---- pytest-codestyle-2.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytest-codestyle.spec ++++++ --- /var/tmp/diff_new_pack.lBrO68/_old 2019-11-26 17:01:20.132068722 +0100 +++ /var/tmp/diff_new_pack.lBrO68/_new 2019-11-26 17:01:20.140068719 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pytest-codestyle # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pytest-codestyle -Version: 1.4.0 +Version: 2.0.0 Release: 0 Summary: Pytest plugin to run pycodestyle License: MIT @@ -34,6 +34,7 @@ BuildRequires: python-rpm-macros Requires: python-pycodestyle Requires: python-pytest +Requires: python-setuptools BuildArch: noarch %python_subpackages ++++++ fix-super.patch ++++++ --- /var/tmp/diff_new_pack.lBrO68/_old 2019-11-26 17:01:20.168068710 +0100 +++ /var/tmp/diff_new_pack.lBrO68/_new 2019-11-26 17:01:20.168068710 +0100 @@ -1,13 +1,13 @@ -Index: pytest-pycodestyle-1.3.0/pytest_codestyle.py +Index: pytest-codestyle-2.0.0/pytest_pycodestyle.py =================================================================== ---- pytest-pycodestyle-1.3.0.orig/pytest_codestyle.py -+++ pytest-pycodestyle-1.3.0/pytest_codestyle.py -@@ -34,7 +34,7 @@ class Item(pytest.Item, pytest.File): - CACHE_KEY = 'codestyle/mtimes' +--- pytest-codestyle-2.0.0.orig/pytest_pycodestyle.py ++++ pytest-codestyle-2.0.0/pytest_pycodestyle.py +@@ -27,7 +27,7 @@ class Item(pytest.Item, pytest.File): + CACHE_KEY = 'pycodestyle/mtimes' - def __init__(self, path, parent): + def __init__(self, path, parent, options): - super().__init__(path, parent) + super(Item, self).__init__(path, parent) - self.add_marker('codestyle') - - def setup(self): + self.add_marker('pycodestyle') + self.options = options + # https://github.com/pytest-dev/pytest/blob/92d6a0500b9f528a9adcd6bbcda46ebf9b6baf03/src/_pytest/nodes.py#L380 ++++++ pytest-codestyle-1.4.0.tar.gz -> pytest-codestyle-2.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/LICENSE new/pytest-codestyle-2.0.0/LICENSE --- old/pytest-codestyle-1.4.0/LICENSE 2017-12-09 06:21:08.000000000 +0100 +++ new/pytest-codestyle-2.0.0/LICENSE 2019-11-17 11:51:40.000000000 +0100 @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Tsukasa OMOTO +Copyright (c) 2019 OMOTO Tsukasa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/PKG-INFO new/pytest-codestyle-2.0.0/PKG-INFO --- old/pytest-codestyle-1.4.0/PKG-INFO 2018-12-14 09:23:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/PKG-INFO 2019-11-17 12:20:36.000000000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 2.1 Name: pytest-codestyle -Version: 1.4.0 +Version: 2.0.0 Summary: pytest plugin to run pycodestyle Home-page: https://github.com/henry0312/pytest-codestyle -Author: Tsukasa OMOTO -Author-email: henry0...@gmail.com +Author: OMOTO Tsukasa +Author-email: tsuk...@oomo.to License: MIT Description: # pytest-codestyle @@ -21,28 +21,30 @@ ## Usage ```sh - pytest --codestyle ... + pytest --pycodestyle ... ``` For detail, please see `pytest -h` after installation. ## Configuration - You can configure options of pycodestyle with `setup.cfg` (or `pytest.ini`). - (cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html)) + The behavior can be configured in the same style of pycodestyle. + (cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html) and [Configuration — pycodestyle documentation](https://pycodestyle.readthedocs.io/en/latest/intro.html#configuration)) For example, ``` + [pycodestyle] + max-line-length = 127 + [tool:pytest] - codestyle_max_line_length = 100 - codestyle_ignore = E302 E501 + addopts = --pycodestyle ``` ## Licence The MIT License - Copyright (c) 2017 Tsukasa OMOTO + Copyright (c) 2019 OMOTO Tsukasa ## Acknowledgments @@ -58,6 +60,7 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Requires-Python: ~=3.5 Description-Content-Type: text/markdown Provides-Extra: tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/README new/pytest-codestyle-2.0.0/README --- old/pytest-codestyle-1.4.0/README 2018-04-02 13:17:22.000000000 +0200 +++ new/pytest-codestyle-2.0.0/README 2019-11-17 12:20:34.000000000 +0100 @@ -13,28 +13,30 @@ ## Usage ```sh -pytest --codestyle ... +pytest --pycodestyle ... ``` For detail, please see `pytest -h` after installation. ## Configuration -You can configure options of pycodestyle with `setup.cfg` (or `pytest.ini`). -(cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html)) +The behavior can be configured in the same style of pycodestyle. +(cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html) and [Configuration — pycodestyle documentation](https://pycodestyle.readthedocs.io/en/latest/intro.html#configuration)) For example, ``` +[pycodestyle] +max-line-length = 127 + [tool:pytest] -codestyle_max_line_length = 100 -codestyle_ignore = E302 E501 +addopts = --pycodestyle ``` ## Licence The MIT License -Copyright (c) 2017 Tsukasa OMOTO +Copyright (c) 2019 OMOTO Tsukasa ## Acknowledgments diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/README.md new/pytest-codestyle-2.0.0/README.md --- old/pytest-codestyle-1.4.0/README.md 2018-04-02 13:17:22.000000000 +0200 +++ new/pytest-codestyle-2.0.0/README.md 2019-11-17 12:20:34.000000000 +0100 @@ -13,28 +13,30 @@ ## Usage ```sh -pytest --codestyle ... +pytest --pycodestyle ... ``` For detail, please see `pytest -h` after installation. ## Configuration -You can configure options of pycodestyle with `setup.cfg` (or `pytest.ini`). -(cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html)) +The behavior can be configured in the same style of pycodestyle. +(cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html) and [Configuration — pycodestyle documentation](https://pycodestyle.readthedocs.io/en/latest/intro.html#configuration)) For example, ``` +[pycodestyle] +max-line-length = 127 + [tool:pytest] -codestyle_max_line_length = 100 -codestyle_ignore = E302 E501 +addopts = --pycodestyle ``` ## Licence The MIT License -Copyright (c) 2017 Tsukasa OMOTO +Copyright (c) 2019 OMOTO Tsukasa ## Acknowledgments diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/VERSION new/pytest-codestyle-2.0.0/VERSION --- old/pytest-codestyle-1.4.0/VERSION 2018-12-14 09:11:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/VERSION 2019-11-17 12:18:21.000000000 +0100 @@ -1 +1 @@ -1.4.0 +2.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/PKG-INFO new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/PKG-INFO --- old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/PKG-INFO 2018-12-14 09:23:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/PKG-INFO 2019-11-17 12:20:36.000000000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 2.1 Name: pytest-codestyle -Version: 1.4.0 +Version: 2.0.0 Summary: pytest plugin to run pycodestyle Home-page: https://github.com/henry0312/pytest-codestyle -Author: Tsukasa OMOTO -Author-email: henry0...@gmail.com +Author: OMOTO Tsukasa +Author-email: tsuk...@oomo.to License: MIT Description: # pytest-codestyle @@ -21,28 +21,30 @@ ## Usage ```sh - pytest --codestyle ... + pytest --pycodestyle ... ``` For detail, please see `pytest -h` after installation. ## Configuration - You can configure options of pycodestyle with `setup.cfg` (or `pytest.ini`). - (cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html)) + The behavior can be configured in the same style of pycodestyle. + (cf. [Configuration — pytest documentation](https://docs.pytest.org/en/latest/customize.html) and [Configuration — pycodestyle documentation](https://pycodestyle.readthedocs.io/en/latest/intro.html#configuration)) For example, ``` + [pycodestyle] + max-line-length = 127 + [tool:pytest] - codestyle_max_line_length = 100 - codestyle_ignore = E302 E501 + addopts = --pycodestyle ``` ## Licence The MIT License - Copyright (c) 2017 Tsukasa OMOTO + Copyright (c) 2019 OMOTO Tsukasa ## Acknowledgments @@ -58,6 +60,7 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Requires-Python: ~=3.5 Description-Content-Type: text/markdown Provides-Extra: tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/SOURCES.txt new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/SOURCES.txt --- old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/SOURCES.txt 2018-12-14 09:23:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/SOURCES.txt 2019-11-17 12:20:36.000000000 +0100 @@ -3,7 +3,7 @@ README README.md VERSION -pytest_codestyle.py +pytest_pycodestyle.py setup.cfg setup.py pytest_codestyle.egg-info/PKG-INFO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/entry_points.txt new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/entry_points.txt --- old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/entry_points.txt 2018-12-14 09:23:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/entry_points.txt 2019-11-17 12:20:36.000000000 +0100 @@ -1,3 +1,3 @@ [pytest11] -codestyle = pytest_codestyle +pycodestyle = pytest_pycodestyle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/top_level.txt new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/top_level.txt --- old/pytest-codestyle-1.4.0/pytest_codestyle.egg-info/top_level.txt 2018-12-14 09:23:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/pytest_codestyle.egg-info/top_level.txt 2019-11-17 12:20:36.000000000 +0100 @@ -1 +1 @@ -pytest_codestyle +pytest_pycodestyle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/pytest_codestyle.py new/pytest-codestyle-2.0.0/pytest_codestyle.py --- old/pytest-codestyle-1.4.0/pytest_codestyle.py 2018-12-14 09:11:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/pytest_codestyle.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,84 +0,0 @@ -import fnmatch - -import py.io -import pycodestyle -import pytest - - -def pytest_addoption(parser): - group = parser.getgroup('codestyle') - group.addoption('--codestyle', action='store_true', - default=False, help='run pycodestyle') - - parser.addini('codestyle_max_line_length', default=pycodestyle.MAX_LINE_LENGTH, - help='set maximum allowed line length (default: {max_line_length})'.format( - max_line_length=pycodestyle.MAX_LINE_LENGTH)) - parser.addini('codestyle_select', type='args', - help='select errors and warnings (default: [])') - parser.addini('codestyle_ignore', type='args', - help='skip errors and warnings (default: [{ignored}])'.format( - ignored=pycodestyle.DEFAULT_IGNORE.replace(',', ' '))) - parser.addini('codestyle_show_source', type="bool", default=True, - help='show source code for each error (default: True)') - parser.addini('codestyle_exclude', type="args", - help='source files to be excluded from codestyle') - - -def pytest_configure(config): - config.addinivalue_line('markers', 'codestyle: mark tests to be checked by pycodestyle.') - - -def pytest_collect_file(parent, path): - config = parent.config - if config.getoption('codestyle') and path.ext == '.py': - if not any(path.fnmatch(pattern) for pattern in config.getini('codestyle_exclude')): - return Item(path, parent) - - -class Item(pytest.Item, pytest.File): - CACHE_KEY = 'codestyle/mtimes' - - def __init__(self, path, parent): - super().__init__(path, parent) - self.add_marker('codestyle') - - def setup(self): - old_mtime = self.config.cache.get(self.CACHE_KEY, {}).get(str(self.fspath), -1) - mtime = self.fspath.mtime() - if old_mtime == mtime: - pytest.skip('previously passed pycodestyle checks') - - def runtest(self): - # http://pycodestyle.pycqa.org/en/latest/api.html#pycodestyle.Checker - # http://pycodestyle.pycqa.org/en/latest/advanced.html - checker = pycodestyle.Checker( - filename=str(self.fspath), - max_line_length=int(self.config.getini('codestyle_max_line_length')), - select=self.config.getini('codestyle_select'), - ignore=self.config.getini('codestyle_ignore'), - show_source=self.config.getini('codestyle_show_source') - ) - file_errors, out, err = py.io.StdCapture.call(checker.check_all) - if file_errors > 0: - raise CodeStyleError(out) - else: - # update cache - # http://pythonhosted.org/pytest-cache/api.html - cache = self.config.cache.get(self.CACHE_KEY, {}) - cache[str(self.fspath)] = self.fspath.mtime() - self.config.cache.set(self.CACHE_KEY, cache) - - def repr_failure(self, excinfo): - if excinfo.errisinstance(CodeStyleError): - return excinfo.value.args[0] - else: - return super().repr_failure(excinfo) - - def reportinfo(self): - # https://github.com/pytest-dev/pytest/blob/4678cbeb913385f00cc21b79662459a8c9fafa87/_pytest/main.py#L550 - # https://github.com/pytest-dev/pytest/blob/4678cbeb913385f00cc21b79662459a8c9fafa87/_pytest/doctest.py#L149 - return self.fspath, None, 'pycodestyle-check' - - -class CodeStyleError(Exception): - """custom exception for error reporting.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/pytest_pycodestyle.py new/pytest-codestyle-2.0.0/pytest_pycodestyle.py --- old/pytest-codestyle-1.4.0/pytest_pycodestyle.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pytest-codestyle-2.0.0/pytest_pycodestyle.py 2019-11-17 12:18:21.000000000 +0100 @@ -0,0 +1,75 @@ +import py.io +import pycodestyle +import pytest + + +def pytest_addoption(parser): + group = parser.getgroup('pycodestyle') + group.addoption('--pycodestyle', action='store_true', + default=False, help='run pycodestyle') + + +def pytest_configure(config): + config.addinivalue_line('markers', 'pycodestyle: mark tests to be checked by pycodestyle.') + + +def pytest_collect_file(parent, path): + config = parent.config + if config.getoption('pycodestyle') and path.ext == '.py': + # https://github.com/PyCQA/pycodestyle/blob/2.5.0/pycodestyle.py#L2295 + style_guide = pycodestyle.StyleGuide(paths=[str(path)], verbose=False) + if not style_guide.excluded(filename=str(path)): + options = style_guide.options + return Item(path, parent, options) + + +class Item(pytest.Item, pytest.File): + CACHE_KEY = 'pycodestyle/mtimes' + + def __init__(self, path, parent, options): + super().__init__(path, parent) + self.add_marker('pycodestyle') + self.options = options + # https://github.com/pytest-dev/pytest/blob/92d6a0500b9f528a9adcd6bbcda46ebf9b6baf03/src/_pytest/nodes.py#L380 + # https://github.com/pytest-dev/pytest/blob/92d6a0500b9f528a9adcd6bbcda46ebf9b6baf03/src/_pytest/nodes.py#L101 + # https://github.com/moccu/pytest-isort/blob/44f345560a6125277f7432eaf26a3488c0d39177/pytest_isort.py#L142 + self._nodeid += '::PYCODESTYLE' + + def setup(self): + if not hasattr(self.config, 'cache'): + return + + old_mtime = self.config.cache.get(self.CACHE_KEY, {}).get(str(self.fspath), -1) + mtime = self.fspath.mtime() + if old_mtime == mtime: + pytest.skip('previously passed pycodestyle checks') + + def runtest(self): + # http://pycodestyle.pycqa.org/en/latest/api.html#pycodestyle.Checker + # http://pycodestyle.pycqa.org/en/latest/advanced.html + checker = pycodestyle.Checker(filename=str(self.fspath), + options=self.options) + file_errors, out, err = py.io.StdCapture.call(checker.check_all) + if file_errors > 0: + raise PyCodeStyleError(out) + elif hasattr(self.config, 'cache'): + # update cache + # http://pythonhosted.org/pytest-cache/api.html + cache = self.config.cache.get(self.CACHE_KEY, {}) + cache[str(self.fspath)] = self.fspath.mtime() + self.config.cache.set(self.CACHE_KEY, cache) + + def repr_failure(self, excinfo): + if excinfo.errisinstance(PyCodeStyleError): + return excinfo.value.args[0] + else: + return super().repr_failure(excinfo) + + def reportinfo(self): + # https://github.com/pytest-dev/pytest/blob/4678cbeb913385f00cc21b79662459a8c9fafa87/_pytest/main.py#L550 + # https://github.com/pytest-dev/pytest/blob/4678cbeb913385f00cc21b79662459a8c9fafa87/_pytest/doctest.py#L149 + return self.fspath, None, 'pycodestyle-check' + + +class PyCodeStyleError(Exception): + """custom exception for error reporting.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/setup.cfg new/pytest-codestyle-2.0.0/setup.cfg --- old/pytest-codestyle-1.4.0/setup.cfg 2018-12-14 09:23:53.000000000 +0100 +++ new/pytest-codestyle-2.0.0/setup.cfg 2019-11-17 12:20:36.000000000 +0100 @@ -1,7 +1,9 @@ +[pycodestyle] +max-line-length = 127 + [tool:pytest] -addopts = --isort --codestyle +addopts = --isort --pycodestyle norecursedirs = build dist *.egg-info .git -codestyle_max_line_length = 127 [egg_info] tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-codestyle-1.4.0/setup.py new/pytest-codestyle-2.0.0/setup.py --- old/pytest-codestyle-1.4.0/setup.py 2018-12-14 09:21:51.000000000 +0100 +++ new/pytest-codestyle-2.0.0/setup.py 2019-11-17 12:20:34.000000000 +0100 @@ -12,10 +12,10 @@ long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/henry0312/pytest-codestyle', - author='Tsukasa OMOTO', - author_email='henry0...@gmail.com', + author='OMOTO Tsukasa', + author_email='tsuk...@oomo.to', license='MIT', - py_modules=['pytest_codestyle'], + py_modules=['pytest_pycodestyle'], python_requires='~=3.5', install_requires=[ 'pytest', @@ -29,7 +29,7 @@ # https://docs.pytest.org/en/latest/writing_plugins.html#making-your-plugin-installable-by-others entry_points={ 'pytest11': [ - 'codestyle = pytest_codestyle', + 'pycodestyle = pytest_pycodestyle', ] }, classifiers=[ @@ -42,5 +42,6 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], )