Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-covdefaults for 
openSUSE:Factory checked in at 2022-09-27 20:14:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-covdefaults (Old)
 and      /work/SRC/openSUSE:Factory/.python-covdefaults.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-covdefaults"

Tue Sep 27 20:14:35 2022 rev:2 rq:1006428 version:2.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-covdefaults/python-covdefaults.changes    
2020-08-28 21:21:37.428331850 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-covdefaults.new.2275/python-covdefaults.changes
  2022-09-27 20:14:49.665944868 +0200
@@ -1,0 +2,6 @@
+Tue Sep 27 00:03:20 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to v2.2.0 
+  No log
+
+-------------------------------------------------------------------

Old:
----
  covdefaults-1.1.0.tar.gz

New:
----
  covdefaults-2.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-covdefaults.spec ++++++
--- /var/tmp/diff_new_pack.kHz2vk/_old  2022-09-27 20:14:50.065945740 +0200
+++ /var/tmp/diff_new_pack.kHz2vk/_new  2022-09-27 20:14:50.069945748 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-covdefaults
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-covdefaults
-Version:        1.1.0
+Version:        2.2.0
 Release:        0
 Summary:        Python coverage plugin to provide default settings
 License:        MIT

++++++ covdefaults-1.1.0.tar.gz -> covdefaults-2.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/.pre-commit-config.yaml 
new/covdefaults-2.2.0/.pre-commit-config.yaml
--- old/covdefaults-1.1.0/.pre-commit-config.yaml       2020-03-10 
21:38:37.000000000 +0100
+++ new/covdefaults-2.2.0/.pre-commit-config.yaml       2022-01-05 
19:21:57.000000000 +0100
@@ -1,6 +1,6 @@
 repos:
 -   repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v2.5.0
+    rev: v4.1.0
     hooks:
     -   id: check-docstring-first
     -   id: check-yaml
@@ -11,34 +11,34 @@
     -   id: requirements-txt-fixer
     -   id: trailing-whitespace
 -   repo: https://github.com/asottile/setup-cfg-fmt
-    rev: v1.7.0
+    rev: v1.20.0
     hooks:
     -   id: setup-cfg-fmt
--   repo: https://gitlab.com/pycqa/flake8
-    rev: 3.7.9
+-   repo: https://github.com/PyCQA/flake8
+    rev: 4.0.1
     hooks:
     -   id: flake8
-        additional_dependencies: [flake8-typing-imports==1.7.0]
+        additional_dependencies: [flake8-typing-imports==1.9.0]
 -   repo: https://github.com/pre-commit/mirrors-autopep8
-    rev: v1.5
+    rev: v1.6.0
     hooks:
     -   id: autopep8
 -   repo: https://github.com/asottile/reorder_python_imports
-    rev: v2.0.0
+    rev: v2.6.0
     hooks:
     -   id: reorder-python-imports
         args: [--py3-plus]
 -   repo: https://github.com/asottile/add-trailing-comma
-    rev: v2.0.0
+    rev: v2.2.1
     hooks:
     -   id: add-trailing-comma
         args: [--py36-plus]
 -   repo: https://github.com/asottile/pyupgrade
-    rev: v2.1.0
+    rev: v2.31.0
     hooks:
     -   id: pyupgrade
         args: [--py36-plus]
 -   repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v0.761
+    rev: v0.930
     hooks:
     -   id: mypy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/README.md 
new/covdefaults-2.2.0/README.md
--- old/covdefaults-1.1.0/README.md     2020-03-10 21:38:37.000000000 +0100
+++ new/covdefaults-2.2.0/README.md     2022-01-05 19:21:57.000000000 +0100
@@ -1,5 +1,6 @@
 [![Build 
Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.covdefaults?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=62&branchName=master)
 [![Azure DevOps 
coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/62/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=62&branchName=master)
+[![pre-commit.ci 
status](https://results.pre-commit.ci/badge/github/asottile/covdefaults/master.svg)](https://results.pre-commit.ci/latest/github/asottile/covdefaults/master)
 
 covdefaults
 ===========
@@ -45,10 +46,8 @@
 branch = True
 source = .
 omit =
-    */.tox/*
     */__main__.py
     */setup.py
-    */venv*/*
 ```
 
 ### `[coverage:report]`
@@ -57,7 +56,7 @@
 show_missing = True
 skip_covered = True
 fail_under = 100
-exclude =
+exclude_lines =
     # a more strict default pragma
     \# pragma: no cover\b
 
@@ -69,7 +68,7 @@
 
     # typing-related code
     ^if (False|TYPE_CHECKING):
-    : \.\.\.$
+    : \.\.\.(\s*#.*)?$
     ^ +\.\.\.$
     -> ['"]?NoReturn['"]?:
 
@@ -77,6 +76,16 @@
     if __name__ == ['"]__main__['"]:$
 
     # additional platform related pragmas (see below)
+    # additional version related pragmas (see below)
+partial_branches =
+    # a more strict default pragma
+    \# pragma: no cover\b
+
+    # out platform pragmas
+    \# pragma: (nt|posix|cygwin|darwin|linux|msys|win32|cpython|pypy) (no 
)?cover\b
+
+    # our version pragmas
+    \# pragma: (>=?|<=?|==|!=)\d+\.\d+ cover\b
 ```
 
 ### platform specific `# pragma: no cover`
@@ -124,6 +133,28 @@
 which is not `win32` -- whereas the `# pragma: win32 no cover` will be a
 "no cover" only on `win32`.
 
+### version specific `# pragma: no cover`
+
+several `# pragma: no cover` tags will be added automatically based on the
+platform and implementation.
+
+these will be in the form of:
+
+```python
+# pragma: >=#.# cover
+```
+
+where the comparison operator is one of `>`, `>=`, `<`, `<=`, `==`, `!=`
+
+for example:
+
+```python
+if sys.version_info >= (3, 9):  # pragma: >=3.9 cover
+    print('3.9+')
+else:  # pragma: <3.9 cover
+    print('old')
+```
+
 ### overriding options
 
 several of the options can be overridden / extended in your coverage
@@ -143,11 +174,20 @@
 
 ```ini
 [covdefaults]
-subtract_omit = */.tox/*
+subtract_omit = */__main__.py
+```
+
+this will result in `*/__main__.py` not being `omit`ted (`*/__main__.py` is
+among the defaults provided by `covdefaults`).
+
+#### `run:source`
+
+```ini
+[run]
+source = $PWD
 ```
 
-this will result in `*/.tox/*` not being `omit`ted (`*/.tox/*` is among the
-defaults provided by `covdefaults`).
+covdefaults will not override this value to `.` if it is set manually.
 
 #### `report:exclude_lines`
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/azure-pipelines.yml 
new/covdefaults-2.2.0/azure-pipelines.yml
--- old/covdefaults-1.1.0/azure-pipelines.yml   2020-03-10 21:38:37.000000000 
+0100
+++ new/covdefaults-2.2.0/azure-pipelines.yml   2022-01-05 19:21:57.000000000 
+0100
@@ -10,10 +10,9 @@
       type: github
       endpoint: github
       name: asottile/azure-pipeline-templates
-      ref: refs/tags/v1.0.1
+      ref: refs/tags/v2.1.0
 
 jobs:
-- template: job--pre-commit.yml@asottile
 - template: job--python-tox.yml@asottile
   parameters:
     toxenvs: [pypy3, py36, py37, py38]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/covdefaults.py 
new/covdefaults-2.2.0/covdefaults.py
--- old/covdefaults-1.1.0/covdefaults.py        2020-03-10 21:38:37.000000000 
+0100
+++ new/covdefaults-2.2.0/covdefaults.py        2022-01-05 19:21:57.000000000 
+0100
@@ -1,7 +1,9 @@
 import os
 import sys
+from typing import Any
 from typing import Dict
 from typing import List
+from typing import Tuple
 
 from coverage import CoveragePlugin
 from coverage.config import CoverageConfig
@@ -18,22 +20,69 @@
 )
 
 
-def _plat_impl_pragmas():  # type: () -> List[str]
+def _plat_impl_pragmas() -> List[str]:
     tags = {os.name, sys.platform, sys.implementation.name}
     ret = [fr'# pragma: {tag} cover\b' for tag in _ALL if tag not in tags]
     ret.extend(fr'# pragma: {tag} no cover\b' for tag in tags)
     return ret
 
 
-OPTIONS = (
+def _lt(n: int) -> str:
+    n_s = str(n)
+    digit = r'\d'
+
+    parts = [
+        f'{n_s[:i]}[0-{int(n_s[i]) - 1}]{len(n_s[i + 1:]) * digit}'
+        for i in range(len(n_s))
+        if n_s[i] != '0'
+    ]
+    if len(n_s) > 1:
+        parts.append(f'{digit}{{1,{len(n_s) - 1}}}')
+
+    return f'({"|".join(parts)})'
+
+
+def _gt(n: int) -> str:
+    n_s = str(n)
+    digit = r'\d'
+
+    parts = [
+        f'{n_s[:i]}[{int(n_s[i]) + 1}-9]{len(n_s[i + 1:]) * digit}'
+        for i in range(len(n_s))
+        if n_s[i] != '9'
+    ]
+    parts.append(f'{digit}{{{len(n_s) + 1},}}')
+
+    return f'({"|".join(parts)})'
+
+
+def _version_pragmas(
+        major: int = sys.version_info[0],
+        minor: int = sys.version_info[1],
+) -> List[str]:
+    return [
+        # <
+        fr'# pragma: <=?{_lt(major)}\.\d+ cover\b',
+        fr'# pragma: <=?{major}\.{_lt(minor)} cover\b',
+        fr'# pragma: <{major}\.{minor} cover\b',
+        # >
+        fr'# pragma: >=?{_gt(major)}\.\d+ cover\b',
+        fr'# pragma: >=?{major}\.{_gt(minor)} cover\b',
+        fr'# pragma: >{major}\.{minor} cover\b',
+        # != / ==
+        fr'# pragma: !={major}\.{minor} cover\b',
+        fr'# pragma: ==(?!{major}\.{minor})\d+\.\d+ cover\b',
+    ]
+
+
+OPTIONS: Tuple[Tuple[str, Any], ...] = (
     ('run:branch', True),
-    ('run:source', ['.']),
 
     ('report:show_missing', True),
     ('report:skip_covered', True),
 )
 EXTEND = (
-    ('run:omit', ['*/.tox/*', '*/__main__.py', '*/setup.py', '*/venv*/*']),
+    ('run:omit', ['*/__main__.py', '*/setup.py']),
     (
         'report:exclude_lines',
         [
@@ -46,12 +95,23 @@
             r'^\s*raise$',
             # typing-related code
             r'^if (False|TYPE_CHECKING):',
-            r': \.\.\.$',
+            r': \.\.\.(\s*#.*)?$',
             r'^ +\.\.\.$',
             r'-> [\'"]?NoReturn[\'"]?:',
             # non-runnable code
             r'^if __name__ == [\'"]__main__[\'"]:$',
             *_plat_impl_pragmas(),
+            *_version_pragmas(),
+        ],
+    ),
+    (
+        'report:partial_branches',
+        [
+            r'# pragma: no branch\b',
+            # platform specific no cover
+            fr'# pragma: ({"|".join(_ALL)}) (no )?cover\b',
+            # version specific no cover
+            r'# pragma: (>=?|<=?|==|!=)\d+\.\d+ cover\b',
         ],
     ),
 )
@@ -64,6 +124,8 @@
     def configure(self, config: CoverageConfig) -> None:
         for k, v in OPTIONS:
             config.set_option(k, v)
+        if config.get_option('run:source') is None:
+            config.set_option('run:source', ['.'])
         for k, v in EXTEND:
             before = set(config.get_option(k) or ())
             before.update(v)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/requirements-dev.txt 
new/covdefaults-2.2.0/requirements-dev.txt
--- old/covdefaults-1.1.0/requirements-dev.txt  2020-03-10 21:38:37.000000000 
+0100
+++ new/covdefaults-2.2.0/requirements-dev.txt  2022-01-05 19:21:57.000000000 
+0100
@@ -1,3 +1,2 @@
 coverage
-pre-commit
 pytest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/setup.cfg 
new/covdefaults-2.2.0/setup.cfg
--- old/covdefaults-1.1.0/setup.cfg     2020-03-10 21:38:37.000000000 +0100
+++ new/covdefaults-2.2.0/setup.cfg     2022-01-05 19:21:57.000000000 +0100
@@ -1,6 +1,6 @@
 [metadata]
 name = covdefaults
-version = 1.1.0
+version = 2.2.0
 description = A coverage plugin to provide sensible default settings
 long_description = file: README.md
 long_description_content_type = text/markdown
@@ -16,13 +16,15 @@
     Programming Language :: Python :: 3.6
     Programming Language :: Python :: 3.7
     Programming Language :: Python :: 3.8
+    Programming Language :: Python :: 3.9
+    Programming Language :: Python :: 3.10
     Programming Language :: Python :: Implementation :: CPython
     Programming Language :: Python :: Implementation :: PyPy
 
 [options]
 py_modules = covdefaults
 install_requires =
-    coverage>=4.5
+    coverage>=6.0.2
 python_requires = >=3.6.1
 
 [bdist_wheel]
@@ -37,6 +39,8 @@
 disallow_incomplete_defs = true
 disallow_untyped_defs = true
 no_implicit_optional = true
+warn_redundant_casts = true
+warn_unused_ignores = true
 
 [mypy-testing.*]
 disallow_untyped_defs = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/tests/covdefaults_test.py 
new/covdefaults-2.2.0/tests/covdefaults_test.py
--- old/covdefaults-1.1.0/tests/covdefaults_test.py     2020-03-10 
21:38:37.000000000 +0100
+++ new/covdefaults-2.2.0/tests/covdefaults_test.py     2022-01-05 
19:21:57.000000000 +0100
@@ -24,6 +24,89 @@
         assert (c, pragma, no, cover) == ('#', 'pragma:', 'no', r'cover\b'), s
 
 
+def _matches_version_pragma(major, minor, s):
+    regexes = covdefaults._version_pragmas(major, minor)
+    return any(re.match(reg, s) for reg in regexes)
+
+
[email protected](
+    ('s', 'expected'),
+    (
+        # <
+        ('# pragma: <2.7 cover', True),
+        ('# pragma: <3.6 cover', True),
+        ('# pragma: <3.7 cover', True),
+        ('# pragma: <3.8 cover', False),
+        ('# pragma: <3.10 cover', False),
+        # <=
+        ('# pragma: <=2.7 cover', True),
+        ('# pragma: <=3.6 cover', True),
+        ('# pragma: <=3.7 cover', False),
+        ('# pragma: <=3.8 cover', False),
+        ('# pragma: <=3.10 cover', False),
+        # >
+        ('# pragma: >2.7 cover', False),
+        ('# pragma: >3.6 cover', False),
+        ('# pragma: >3.7 cover', True),
+        ('# pragma: >3.8 cover', True),
+        ('# pragma: >3.10 cover', True),
+        # >=
+        ('# pragma: >=2.7 cover', False),
+        ('# pragma: >=3.6 cover', False),
+        ('# pragma: >=3.7 cover', False),
+        ('# pragma: >=3.8 cover', True),
+        ('# pragma: >=3.10 cover', True),
+        # ==
+        ('# pragma: ==3.6 cover', True),
+        ('# pragma: ==3.7 cover', False),
+        ('# pragma: ==3.8 cover', True),
+        # !=
+        ('# pragma: !=3.6 cover', False),
+        ('# pragma: !=3.7 cover', True),
+        ('# pragma: !=3.8 cover', False),
+    ),
+)
+def test_version_pragmas_py37(s, expected):
+    assert _matches_version_pragma(3, 7, s) == expected
+
+
[email protected](
+    ('s', 'expected'),
+    (
+        # <
+        ('# pragma: <2.7 cover', True),
+        ('# pragma: <3.9 cover', True),
+        ('# pragma: <3.10 cover', True),
+        ('# pragma: <3.11 cover', False),
+        # <=
+        ('# pragma: <=2.7 cover', True),
+        ('# pragma: <=3.9 cover', True),
+        ('# pragma: <=3.10 cover', False),
+        ('# pragma: <=3.11 cover', False),
+        # >
+        ('# pragma: >2.7 cover', False),
+        ('# pragma: >3.9 cover', False),
+        ('# pragma: >3.10 cover', True),
+        ('# pragma: >3.11 cover', True),
+        # >=
+        ('# pragma: >=2.7 cover', False),
+        ('# pragma: >=3.9 cover', False),
+        ('# pragma: >=3.10 cover', False),
+        ('# pragma: >=3.11 cover', True),
+        # ==
+        ('# pragma: ==3.9 cover', True),
+        ('# pragma: ==3.10 cover', False),
+        ('# pragma: ==3.11 cover', True),
+        # !=
+        ('# pragma: !=3.9 cover', False),
+        ('# pragma: !=3.10 cover', True),
+        ('# pragma: !=3.11 cover', False),
+    ),
+)
+def test_version_pragmas_py310(s, expected):
+    assert _matches_version_pragma(3, 10, s) == expected
+
+
 @pytest.fixture
 def configured():
     cfg = CoverageConfig()
@@ -39,26 +122,29 @@
     assert configured.get_option('report:fail_under') == 100
 
 
+def test_source_already_set():
+    cfg = CoverageConfig()
+    cfg.set_option('run:source', ['/tmp/foo'])
+    configure(cfg)
+    assert cfg.get_option('run:source') == ['/tmp/foo']
+
+
 def test_extends_existing_omit():
     cfg = CoverageConfig()
     cfg.set_option('run:omit', ['pre_commit/resources/*'])
     configure(cfg)
     assert cfg.get_option('run:omit') == [
-        '*/.tox/*',
         '*/__main__.py',
         '*/setup.py',
-        '*/venv*/*',
         'pre_commit/resources/*',
     ]
 
 
 def test_subtract_omit():
     cfg = CoverageConfig()
-    covdefaults.CovDefaults(subtract_omit='*/.tox/*').configure(cfg)
+    covdefaults.CovDefaults(subtract_omit='*/__main__.py').configure(cfg)
     assert cfg.get_option('run:omit') == [
-        '*/__main__.py',
         '*/setup.py',
-        '*/venv*/*',
     ]
 
 
@@ -82,6 +168,8 @@
         'if TYPE_CHECKING:\n',
         'def f(x: int) -> int: ...\n',
         'def f(x: int) -> int:\n    ...\n',
+        'def f(x: int) -> C: ...# noqa: F821\n',
+        'def f(x: int) -> C: ...  # noqa: F821\n',
         'def never_returns() -> NoReturn:\n',
         'def never_returns() -> "NoReturn":\n',
         "def never_returns() -> 'NoReturn':\n",
@@ -94,6 +182,28 @@
         if any(re.search(reg, line) for line in src.splitlines()):
             break
     else:
+        raise AssertionError(f'no regex matched {src!r}')
+
+
[email protected](
+    'src',
+    (
+        'if True:  # pragma: no branch\n',
+        'if sys.platform == "win32":  # pragma: win32 cover\n',
+        'if sys.platform != "win32":  # pragma: win32 no cover\n',
+        'if sys.version_info >= (3, 9):  # pragma: >=3.9 cover\n',
+        'if sys.version_info > (3, 9):  # pragma: >3.9 cover\n',
+        'if sys.version_info <= (3, 9):  # pragma: <=3.9 cover\n',
+        'if sys.version_info < (3, 9):  # pragma: <3.9 cover\n',
+        'if sys.version_info == (3, 9):  # pragma: ==3.9 cover\n',
+        'if sys.version_info != (3, 9):  # pragma: !=3.9 cover\n',
+    ),
+)
+def test_partial_branches(configured, src):
+    for reg in configured.get_option('report:partial_branches'):
+        if any(re.search(reg, line) for line in src.splitlines()):
+            break
+    else:
         raise AssertionError(f'no regex matched {src!r}')
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/covdefaults-1.1.0/tox.ini 
new/covdefaults-2.2.0/tox.ini
--- old/covdefaults-1.1.0/tox.ini       2020-03-10 21:38:37.000000000 +0100
+++ new/covdefaults-2.2.0/tox.ini       2022-01-05 19:21:57.000000000 +0100
@@ -7,7 +7,6 @@
     coverage erase
     coverage run -m pytest {posargs:tests}
     coverage report
-    pre-commit install
 
 [testenv:pre-commit]
 skip_install = true

Reply via email to