From eb5f60a6376a8cca7ae1d648983133dae26a2814889d328ab52d89ddc0e39485 Mon Sep 17 00:00:00 2001 From: Jan Matejek Date: Mon, 26 Jun 2017 14:10:23 +0000 Subject: [PATCH] - also do not buildrequire mercurial unless specified - bcond_with test to run the test suite OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools_scm?expand=0&rev=17 --- python-setuptools_scm.changes | 6 ++++++ python-setuptools_scm.spec | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/python-setuptools_scm.changes b/python-setuptools_scm.changes index b16b86b..1c3c1af 100644 --- a/python-setuptools_scm.changes +++ b/python-setuptools_scm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 26 14:09:51 UTC 2017 - jmatejek@suse.com + +- also do not buildrequire mercurial unless specified +- bcond_with test to run the test suite + ------------------------------------------------------------------- Wed May 17 22:32:38 UTC 2017 - dimstar@opensuse.org diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index 5acc60d..f898fdd 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -16,6 +16,7 @@ # +%bcond_with test %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-setuptools_scm Version: 1.15.0 @@ -30,9 +31,12 @@ Patch0: no-generic-python.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros +%if %{with test} # Testing requirements BuildRequires: %{python_module pytest} +BuildRequires: git BuildRequires: mercurial +%endif Requires: python-setuptools Recommends: git Recommends: mecurial @@ -48,9 +52,6 @@ in scm metadata. It also handles file finders for the supperted scm's. %prep %setup -q -n setuptools_scm-%{version} %patch0 -p1 -# We can't pull in git into the build root, as this causes a nasty build cycle -# git - curl - nghttp2 - setuptools - git -rm testing/test_{git,regressions}.py %build %python_build @@ -58,8 +59,10 @@ rm testing/test_{git,regressions}.py %install %python_install +%if %{with test} %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} +%endif %files %python_files %defattr(-,root,root,-)