diff --git a/backport-Remove-install_requires-dependency-on-coverage.patch b/backport-Remove-install_requires-dependency-on-coverage.patch new file mode 100644 index 0000000000000000000000000000000000000000..5fbaf2efee07e6b624f6b12e8b49f23422756ef8 --- /dev/null +++ b/backport-Remove-install_requires-dependency-on-coverage.patch @@ -0,0 +1,60 @@ +From fb770f4d748a5c334efa3ef251ff4f1524ac0c90 Mon Sep 17 00:00:00 2001 +From: Stephen Rosen +Date: Fri, 18 Mar 2022 05:16:19 +0000 +Subject: [PATCH] Remove install_requires dependency on 'coverage' + +This can be traced back to an added dependency on code-cov (prior to +coverage) which doesn't appear to have been correct. It was added to +the installation requirements rather than the dev requirements. +It should be possible to use ``nose2`` in an environment without +``coverage`` installed (but not to use the coverage plugin). + +As a result, `install_requires` can be removed entirely. +--- + nose2/tests/functional/test_coverage.py | 7 +++++++ + setup.py | 5 ++--- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/nose2/tests/functional/test_coverage.py b/nose2/tests/functional/test_coverage.py +index d98d5b4..1b96ae4 100644 +--- a/nose2/tests/functional/test_coverage.py ++++ b/nose2/tests/functional/test_coverage.py +@@ -6,6 +6,13 @@ from nose2.tests._common import FunctionalTestCase, support_file + + + class TestCoverage(FunctionalTestCase): ++ def setUp(self): ++ super(TestCoverage, self).setUp() ++ try: ++ import coverage # noqa: F401 ++ except ImportError: ++ self.skipTest("coverage required") ++ + def assertProcOutputPattern(self, proc, libname, stats, + total_stats=None, assert_exit_status=0): + """ +diff --git a/setup.py b/setup.py +index 992d2a4..69de6d2 100644 +--- a/setup.py ++++ b/setup.py +@@ -28,15 +28,14 @@ setup( + ], + install_requires=[ + "six>=1.7", +- "coverage>=4.4.1", + # mock on py2, py3.4 and py3.5 + # not just py2: py3 versions of mock don't all have the same + # interface and this can cause issues + 'mock==2.0.0;python_version<"3.6"', + ], + extras_require={ +- "coverage_plugin": ["coverage>=4.4.1"], +- "doc": ["Sphinx>=1.6.5", "sphinx_rtd_theme", "mock"], ++ "coverage_plugin": ["coverage"], ++ "doc": ["Sphinx", "sphinx_rtd_theme", "mock"], + }, + entry_points={ + "console_scripts": [ +-- +2.27.0 + diff --git a/python-nose2.spec b/python-nose2.spec index b3f030c0ea2d46fc6b0b23ecff250b1065546b77..977519cf101dd9ffc771104a7839c612e42a1757 100644 --- a/python-nose2.spec +++ b/python-nose2.spec @@ -2,13 +2,15 @@ Name: python-%{srcname} Version: 0.9.2 -Release: 1 +Release: 2 Summary: Next generation of nicer testing for Python License: BSD URL: https://nose2.readthedocs.org Source0: %pypi_source +Patch0: backport-Remove-install_requires-dependency-on-coverage.patch + BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel @@ -51,7 +53,7 @@ In service of some those goals, some features of nose will not be supported in nose2. See the documentation for a thorough rundown. %prep -%autosetup -n %{srcname}-%{version} -p0 +%autosetup -n %{srcname}-%{version} -p1 %build @@ -74,5 +76,8 @@ PYTHONPATH=`pwd` %{__python3} -m nose2.__main__ -v %{_bindir}/nose2 %changelog +* Mon Oct 24 2022 zhangruifang - 0.9.2-2 +- delete the require on coverage + * Thu Jun 11 2020 Dillon Chen - 0.9.2-1 - build for openEuler