From b61a559309685969e1871489a7e2281ecaa2f5f5 Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Sep 19 2018 10:41:27 +0000 Subject: Removed Python 2 package from Fedora 30+ (bz#1629753) Enabled doc build --- diff --git a/python-openstacksdk.spec b/python-openstacksdk.spec index f001b4c..56ff796 100644 --- a/python-openstacksdk.spec +++ b/python-openstacksdk.spec @@ -1,10 +1,14 @@ %{!?upstream_version: %global upstream_version %{version}%{?milestone}} -%if 0%{?fedora} >= 24 -%global with_python3 1 + +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_with python2 +%bcond_without python3 +%else +%bcond_without python2 +%bcond_with python3 %endif -# Disable docs until bs4 package is available -%global with_doc 0 +%global with_doc 1 %global pypi_name openstacksdk @@ -18,7 +22,7 @@ clouds - test files Name: python-%{pypi_name} Version: 0.12.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: An SDK for building applications to work with OpenStack License: ASL 2.0 @@ -31,14 +35,13 @@ BuildRequires: git %description %{common_desc} +%if %{with python2} %package -n python2-%{pypi_name} Summary: An SDK for building applications to work with OpenStack %{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python2-pbr >= 2.0.0 -BuildRequires: python2-sphinx -BuildRequires: python2-openstackdocstheme BuildRequires: python2-keystoneauth1 BuildRequires: python2-appdirs BuildRequires: python2-requestsexceptions @@ -47,6 +50,10 @@ BuildRequires: python2-jmespath BuildRequires: python2-futures BuildRequires: python2-jsonschema BuildRequires: python2-os-service-types +# Doc requirements +BuildRequires: python2-sphinx +BuildRequires: python2-openstackdocstheme +BuildRequires: python2-beautifulsoup4 # Test requirements BuildRequires: python2-deprecation BuildRequires: python2-iso8601 >= 0.1.11 @@ -109,8 +116,9 @@ Requires: python2-%{pypi_name} = %{version}-%{release} %description -n python2-%{pypi_name}-tests %{common_desc_tests} +%endif -%if 0%{?with_python3} +%if %{with python3} %package -n python3-%{pypi_name} Summary: An SDK for building applications to work with OpenStack %{?python_provide:%python_provide python3-%{pypi_name}} @@ -140,6 +148,10 @@ BuildRequires: python3-testrepository BuildRequires: python3-testscenarios BuildRequires: python3-testtools BuildRequires: python3-glanceclient +# Doc requirements +BuildRequires: python3-sphinx +BuildRequires: python3-openstackdocstheme +BuildRequires: python3-beautifulsoup4 Requires: python3-deprecation Requires: python3-jsonpatch >= 1.16 @@ -187,48 +199,55 @@ clouds - documentation. rm -rf {,test-}requirements.txt %build +%if %{with python2} %py2_build +%endif -%if 0%{?with_python3} -%{py3_build} +%if %{with python3} +%py3_build %endif %if 0%{?with_doc} -# generate html docs +# generate html docs +%if %{with python2} sphinx-build -b html doc/source html +%endif +%if %{with python3} +sphinx-build-3 -b html doc/source html +%endif # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %endif %install +%if %{with python2} %py2_install +%endif -%if 0%{?with_python3} +%if %{with python3} %{py3_install} %endif %check # stestr --test-path ./openstack/tests/unit run - -%if 0%{?with_python3} +%if %{with python3} rm -rf .testrepository # stestr-3 --test-path ./openstack/tests/unit run %endif - +%if %{with python2} %files -n python2-%{pypi_name} %doc README.rst %license LICENSE -%if !0%{?with_python3} %{_bindir}/openstack-inventory -%endif %{python2_sitelib}/openstack %{python2_sitelib}/%{pypi_name}-*.egg-info %exclude %{python2_sitelib}/openstack/tests %files -n python2-%{pypi_name}-tests %{python2_sitelib}/openstack/tests +%endif %if 0%{?with_doc} %files -n python-%{pypi_name}-doc @@ -236,7 +255,7 @@ rm -rf .testrepository %license LICENSE %endif -%if 0%{?with_python3} +%if %{with python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE @@ -250,6 +269,10 @@ rm -rf .testrepository %endif %changelog +* Wed Sep 19 2018 Javier Peña - 0.12.0-4 +- Removed Python 2 package from Fedora 30+ (bz#1629753) +- Enabled doc build + * Sat Jul 14 2018 Fedora Release Engineering - 0.12.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild