From 87d02fc872a25835417760a6fcdbbeb3663ff23297979cbffcd699a799b40664 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 31 Mar 2025 02:00:41 +0000 Subject: [PATCH] - Add patch support-coverage-7.7.patch: * Support Coverage 7.7.0 and above changes with plugins. - Switch to autosetup and pyproject macros. - No more greedy globs in %files. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-covdefaults?expand=0&rev=12 --- .gitattributes | 23 ++++++++++++++ .gitignore | 1 + covdefaults-2.3.0.tar.gz | 3 ++ python-covdefaults.changes | 39 ++++++++++++++++++++++++ python-covdefaults.spec | 62 ++++++++++++++++++++++++++++++++++++++ support-coverage-7.7.patch | 32 ++++++++++++++++++++ 6 files changed, 160 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 covdefaults-2.3.0.tar.gz create mode 100644 python-covdefaults.changes create mode 100644 python-covdefaults.spec create mode 100644 support-coverage-7.7.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/covdefaults-2.3.0.tar.gz b/covdefaults-2.3.0.tar.gz new file mode 100644 index 0000000..d26eac5 --- /dev/null +++ b/covdefaults-2.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adc3b7da4fb7ed00ba1daeb8de1a20580e4875983311079ee57b7544f462bae5 +size 6361 diff --git a/python-covdefaults.changes b/python-covdefaults.changes new file mode 100644 index 0000000..a1773f9 --- /dev/null +++ b/python-covdefaults.changes @@ -0,0 +1,39 @@ +------------------------------------------------------------------- +Mon Mar 31 01:59:41 UTC 2025 - Steve Kowalik + +- Add patch support-coverage-7.7.patch: + * Support Coverage 7.7.0 and above changes with plugins. +- Switch to autosetup and pyproject macros. +- No more greedy globs in %files. + +------------------------------------------------------------------- +Sun Jun 11 08:31:24 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Tue Mar 14 22:32:41 UTC 2023 - Dirk Müller + +- update to 2.3.0: + * Add assert_never to coverage ignore rules + +------------------------------------------------------------------- +Wed Dec 7 15:57:27 UTC 2022 - Yogalakshmi Arunachalam + +- Update to v2.2.2 + * Merge pull request #97 from sobolevn/patch-1 + * Do not report class level `if TYPE_CHECKING` as uncovered + +- Update to v2.2.1 + * A coverage plugin to provide sensible default settings + +------------------------------------------------------------------- +Tue Sep 27 00:03:20 UTC 2022 - Yogalakshmi Arunachalam + +- Update to v2.2.0 + No log + +------------------------------------------------------------------- +Tue Aug 18 07:15:14 PM UTC 2020 - John Vandenberg + +- Initial spec for v1.1.0 diff --git a/python-covdefaults.spec b/python-covdefaults.spec new file mode 100644 index 0000000..fc27c22 --- /dev/null +++ b/python-covdefaults.spec @@ -0,0 +1,62 @@ +# +# spec file for package python-covdefaults +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-covdefaults +Version: 2.3.0 +Release: 0 +Summary: Python coverage plugin to provide default settings +License: MIT +URL: https://github.com/asottile/covdefaults +Source: https://github.com/asottile/covdefaults/archive/v%{version}.tar.gz#/covdefaults-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#asottile/covdefaults#164 +Patch0: support-coverage-7.7.patch +BuildRequires: %{python_module coverage} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-coverage +BuildArch: noarch +%python_subpackages + +%description +Python coverage plugin to provide default settings. + +%prep +%autosetup -p1 -n covdefaults-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%python_exec -m coverage run -m pytest -v + +%files %{python_files} +%doc README.md +%license LICENSE +%{python_sitelib}/covdefaults.py +%pycache_only %{python_sitelib}/__pycache__/covdefaults.*.pyc +%{python_sitelib}/covdefaults-%{version}.dist-info + +%changelog diff --git a/support-coverage-7.7.patch b/support-coverage-7.7.patch new file mode 100644 index 0000000..ffaf362 --- /dev/null +++ b/support-coverage-7.7.patch @@ -0,0 +1,32 @@ +From 5f8217506f8425d793b04d6379971c7c6245d9e5 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Mon, 31 Mar 2025 12:40:43 +1100 +Subject: [PATCH] Support Coverage 7.7.0 and above + +Coverage 7.7.0 refactored the way the Plugins class is used, and as a +consequence, the load_plugins method was renamed, and is no longer a +class method. Check if the new method exists, and fall back to the older +method otherwise. +--- + tests/covdefaults_test.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/tests/covdefaults_test.py b/tests/covdefaults_test.py +index 2bf41c2..9f3f129 100644 +--- a/tests/covdefaults_test.py ++++ b/tests/covdefaults_test.py +@@ -228,7 +228,13 @@ def test_configure_keeps_existing_fail_under(): + + def test_coverage_init(): + cfg = CoverageConfig() +- plugin_manager = Plugins.load_plugins(['covdefaults'], cfg) ++ # Coverage 7.7.0 and above ++ if hasattr(Plugins, 'load_from_config'): ++ plugin_manager = Plugins() ++ plugin_manager.load_from_config(['covdefaults'], cfg) ++ # Coverage 7.6.12 and below ++ else: # pragma: no cover ++ plugin_manager = Plugins.load_plugins(['covdefaults'], cfg) + assert plugin_manager.get('covdefaults.CovDefaults') + +