python-nose2/backport-Remove-install_requires-dependency-on-coverage.patch
2022-10-24 15:50:32 +08:00

61 lines
2.1 KiB
Diff

From fb770f4d748a5c334efa3ef251ff4f1524ac0c90 Mon Sep 17 00:00:00 2001
From: Stephen Rosen <sirosen@globus.org>
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