#3 add %bcond {tests, python2}
Opened a month ago by pkopkan. Modified 23 days ago
rpms/ pkopkan/python-markupsafe master  into  master

file modified
+13 -4

@@ -1,3 +1,5 @@ 

+ %bcond_without python2

+ 

  Name:           python-markupsafe

  Version:        1.1.1

  Release:        4%{?dist}

@@ -11,7 +13,7 @@ 

  %description

  A library for safe markup escaping.

  

- 

+ %if %{with python2}

  %package -n python2-markupsafe

  Summary:        Implements a XML/HTML/XHTML Markup safe string for Python 2

  BuildRequires:  python2-devel

@@ -20,7 +22,7 @@ 

  

  %description -n python2-markupsafe

  A library for safe markup escaping. Python 2 version.

- 

+ %endif

  

  %package -n python3-markupsafe

  Summary:        Implements a XML/HTML/XHTML Markup safe string for Python 3

@@ -37,14 +39,18 @@ 

  

  

  %build

+ %if %{with python2}

  %py2_build

- %py3_build

+ %endif

  

+ %py3_build

  

  %install

+ %if %{with python2}

  %py2_install

  # C code errantly gets installed

  rm %{buildroot}%{python2_sitearch}/markupsafe/*.c

+ %endif

  

  %py3_install

  # C code errantly gets installed

@@ -52,16 +58,19 @@ 

  

  

  %check

+ %if %{with python2}

  %{__python2} setup.py test

+ %endif

  %{__python3} setup.py test

  

  

+ %if %{with python2}

  %files -n python2-markupsafe

  %license LICENSE.rst

  %doc CHANGES.rst README.rst

  %{python2_sitearch}/MarkupSafe-%{version}-py%{python2_version}.egg-info/

  %{python2_sitearch}/markupsafe/

- 

+ %endif

  

  %files -n python3-markupsafe

  %license LICENSE.rst

no initial comment

LGTM.

I would maybe add a short comment above the bcond definitions, because it can be confusing for newcommers:

# tests and python2 are enabled by default (to disable, use %bcond_with)

The tests have no extra dependencies. What is the benefit of the tests bcond?

You're right, there's likely no benefit in this case. Dropping the PR.

Oh, apologies, the python2 bcond is still useful. @pkopkan Could you please remove the %bcond for tests, but leave the python2 bcond?

rebased onto 806f2c8

23 days ago

rebased onto 8ddd4c2

23 days ago

rebased onto 4c1750b

23 days ago