From 811de6c86e5d265e8b9bf6c648a1e1803be5e573 Mon Sep 17 00:00:00 2001 From: Carl George Date: Thu, 5 Apr 2018 00:06:43 -0500 Subject: [PATCH] Add patch0 to remove pytest-{cov,runner} deps --- disable-coverage-and-runner.patch | 25 +++++++++++++++++++++++++ python-jwt.spec | 16 +++++++--------- 2 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 disable-coverage-and-runner.patch diff --git a/disable-coverage-and-runner.patch b/disable-coverage-and-runner.patch new file mode 100644 index 0000000..61d1d24 --- /dev/null +++ b/disable-coverage-and-runner.patch @@ -0,0 +1,25 @@ +diff -Nurp pyjwt-1.6.1.orig/setup.py pyjwt-1.6.1/setup.py +--- pyjwt-1.6.1.orig/setup.py 2018-03-18 08:37:23.000000000 -0500 ++++ pyjwt-1.6.1/setup.py 2018-04-04 23:46:56.178058061 -0500 +@@ -34,13 +34,8 @@ if sys.argv[-1] == 'publish': + + tests_require = [ + 'pytest >3,<4', +- 'pytest-cov', +- 'pytest-runner', + ] + +-needs_pytest = set(('pytest', 'test', 'ptr')).intersection(sys.argv) +-pytest_runner = ['pytest-runner'] if needs_pytest else [] +- + setup( + name='PyJWT', + version=version, +@@ -67,7 +62,6 @@ setup( + 'Topic :: Utilities', + ], + test_suite='tests', +- setup_requires=pytest_runner, + tests_require=tests_require, + extras_require=dict( + test=tests_require, diff --git a/python-jwt.spec b/python-jwt.spec index 6ff28d2..059b3ad 100644 --- a/python-jwt.spec +++ b/python-jwt.spec @@ -14,24 +14,19 @@ Group: Development/Libraries License: MIT URL: https://github.com/jpadilla/pyjwt Source0: %{url}/archive/%{version}/pyjwt-%{version}.tar.gz +Patch0: disable-coverage-and-runner.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-cryptography >= 1.4.0 - BuildRequires: python2-pytest -BuildRequires: python2-pytest-cov -BuildRequires: python2-pytest-runner %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-cryptography >= 1.4.0 - BuildRequires: python3-pytest -BuildRequires: python3-pytest-cov -BuildRequires: python3-pytest-runner %endif %description @@ -65,7 +60,9 @@ encrypted JSON objects. %endif %prep -%autosetup -n pyjwt-%{version} +%autosetup -n pyjwt-%{version} -p 1 +# prevent pulling in `addopts` for pytest run later +rm setup.cfg %build %py2_build @@ -80,9 +77,9 @@ encrypted JSON objects. %endif %check -%{__python2} setup.py test +py.test-%{python2_version} --verbose %if 0%{?with_python3} -%{__python3} setup.py test +py.test-%{python3_version} --verbose %endif %files -n python2-jwt @@ -103,6 +100,7 @@ encrypted JSON objects. %changelog * Thu Apr 05 2018 Carl George - 1.6.1-1 - Latest upstream +- Add patch0 to remove pytest-{cov,runner} deps * Mon Feb 12 2018 Iryna Shcherbina - 1.5.3-3 - Update Python 2 dependency declarations to new packaging standards