public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-docker] epel10.2: Don't build Python 2 subpackage on EL > 7
@ 2026-10-13 18:27 Charalampos Stratakis
  0 siblings, 0 replies; only message in thread
From: Charalampos Stratakis @ 2026-10-13 18:27 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-docker
            Branch : epel10.2
            Commit : ef125df53742ad1296f62c59b6e60947bcc74dad
            Author : Charalampos Stratakis <cstratak@redhat.com>
            Date   : 2018-03-15T17:24:25+01:00
            Stats  : +49/-11 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-docker/c/ef125df53742ad1296f62c59b6e60947bcc74dad?branch=epel10.2

            Log:
            Don't build Python 2 subpackage on EL > 7

Conditionalize the tests subpackage as well as it's packaged only for python2.

Rename the tests subpackage to conforn to the latest packaging guidelines
and provide and obsolete the previous namespace to maintain the upgrade path.

---
diff --git a/python-docker.spec b/python-docker.spec
index f9defe9..9b6875e 100644
--- a/python-docker.spec
+++ b/python-docker.spec
@@ -1,17 +1,24 @@
-%if 0%{?rhel} != 0 && 0%{?rhel} <= 7
-# Do not build bindings for python3 for RHEL <= 7
+%if 0%{?fedora} || 0%{?rhel} > 7
+# Enable python3 build by default
+%bcond_without python3
+%bcond_without tests
+%else
 %bcond_with python3
 %bcond_with tests
+%endif
+
+%if 0%{?rhel} > 7
+# Disable python2 build by default
+%bcond_with python2
 %else
-%bcond_without python3
-%bcond_without tests
+%bcond_without python2
 %endif
 
 %global srcname docker
 
 Name:           python-%{srcname}
 Version:        3.1.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        A Python library for the Docker Engine API
 License:        ASL 2.0
 URL:            https://pypi.python.org/pypi/%{srcname}
@@ -33,7 +40,7 @@ BuildArch:      noarch
 It lets you do anything the docker command does, but from within Python apps –
 run containers, manage containers, manage Swarms, etc.
 
-
+%if %{with python2}
 %package -n python2-%{srcname}
 Summary:        A Python library for the Docker Engine API
 %{?python_provide:%python_provide python2-%{srcname}}
@@ -69,9 +76,15 @@ Obsoletes:      python-docker-py < 2
 %description -n python2-%{srcname}
 It lets you do anything the docker command does, but from within Python apps –
 run containers, manage containers, manage Swarms, etc.
+%endif # with python2
 
-%package tests
+%if %{with python2}
+%if %{with tests}
+%package -n python2-%{srcname}-tests
 Summary:        Unit tests and integration tests for python-docker
+
+%{?python_provide:%python_provide python2-%{srcname}-tests}
+
 Requires:       python2-%{srcname}
 Requires:       python2-mock >= 1.0.1
 Requires:       %{?fedora:python2-}pytest >= 2.9.1
@@ -84,8 +97,15 @@ Requires:       python%{?fedora:2}-ipaddress >= 1.0.16
 Requires:       python%{?fedora:2}-pyOpenSSL
 Requires:       python%{?fedora:2}-idna
 Requires:       python%{?fedora:2}-cryptography
-%description tests
+
+# Remove at Fedora 31
+Provides:       python-%{srcname}-tests = %{version}-%{release}
+Obsoletes:      python-%{srcname}-tests < %{version}-%{release}
+
+%description -n python2-%{srcname}-tests
 Upstream test-suite (unit, integration) packaged as RPM.
+%endif # tests
+%endif # with python2
 
 %if %{with python3}
 %package -n python3-%{srcname}
@@ -126,27 +146,37 @@ run containers, manage containers, manage Swarms, etc.
 rm -fr docker.egg-info
 
 %build
+%if %{with python2}
 %py2_build
+%endif # with python2
 
 %if %{with python3}
 %py3_build
 %endif # with_python3
 
 %install
+%if %{with python2}
 %py2_install
+%endif # with python2
 
 %if %{with python3}
 %py3_install
 %endif # with_python3
 
+%if %{with python2}
+%if %{with tests}
 # copy tests to /usr/libexec/installed-tests
 mkdir -p %{buildroot}%{_libexecdir}/installed-tests/%{name}
 cp -avr tests/ %{buildroot}%{_libexecdir}/installed-tests/%{name}/
+%endif # tests
+%endif # with python2
 
 %check
+%if %{with python2}
 %if %{with tests}
 %{__python2} -m pytest -v tests/unit/
-%endif
+%endif # tests
+%endif # with python2
 
 %if %{with python3}
 %if %{with tests}
@@ -154,11 +184,12 @@ cp -avr tests/ %{buildroot}%{_libexecdir}/installed-tests/%{name}/
 %endif # tests
 %endif # with_python3
 
-
+%if %{with python2}
 %files -n python2-%{srcname}
 %license LICENSE
 %doc README.md
 %{python2_sitelib}/*
+%endif # with python2
 
 %if %{with python3}
 %files -n python3-%{srcname}
@@ -167,10 +198,17 @@ cp -avr tests/ %{buildroot}%{_libexecdir}/installed-tests/%{name}/
 %{python3_sitelib}/*
 %endif # with_python3
 
-%files tests
+%if %{with python2}
+%if %{with tests}
+%files -n python2-%{srcname}-tests
 %{_libexecdir}/installed-tests
+%endif # tests
+%endif # with python2
 
 %changelog
+* Thu Mar 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 3.1.1-2
+- Don't build Python 2 subpackage on EL > 7
+
 * Tue Mar 06 2018 Tomas Tomecek <ttomecek@redhat.com> - 3.1.1-1
 - New upstream release 3.1.1
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-13 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 18:27 [rpms/python-docker] epel10.2: Don't build Python 2 subpackage on EL > 7 Charalampos Stratakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox