#3 Add bcond_without tests
Merged 4 years ago by laxathom. Opened 4 years ago by kanarip.
rpms/ kanarip/python-path epel8  into  master

Add bcond_without tests
Jeroen van Meeuwen (Kolab Systems) • 4 years ago  
file modified
+8
@@ -4,6 +4,8 @@ 

  

  %global bname path

  

+ %bcond_without tests

+ 

  Name:           python-%{bname}

  Version:        5.2

  Release:        16%{?dist}
@@ -15,13 +17,17 @@ 

  

  BuildArch:      noarch

  BuildRequires:  python2-devel

+ %if %{with tests}

  BuildRequires:  pytest

+ %endif

  

  %if 0%{?with_python3}

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

+ %if %{with tests}

  BuildRequires:  python3-pytest

  %endif

+ %endif

  

  %description

  path.py implements a path objects as first-class entities,
@@ -60,6 +66,7 @@ 

  

  %py2_build

  

+ %if %{with tests}

  %check

  pushd build/lib

      LC_ALL=C.UTF-8 py.test-2 -v
@@ -71,6 +78,7 @@ 

      py.test-%{python3_version} -v

  popd

  %endif

+ %endif # with tests

  

  %install

  %if 0%{?with_python3}

With python-path depending on pytest, and pytest in turn depending on python-path... well... resolved.

Looks good! (I'm not merging yet because the package is not mine or in @python-sig - but ultimately we'll need this for Python 3.8 bootstrap as well.)

Pull-Request has been merged by laxathom

4 years ago