File python-openstacksdk.spec of Package python-openstacksdk

%global pypi_name openstacksdk

%bcond_with python3
%bcond_with test

%global common_desc \
A collection of libraries for building applications to work with OpenStack \
clouds.

%global common_desc_tests \
A collection of libraries for building applications to work with OpenStack \
clouds - test files

Name:           python-%{pypi_name}
Version:        0.61.0
Release:        1%{?dist}
Summary:        An SDK for building applications to work with OpenStack

License:        Apache-2.0
URL:            http://developer.openstack.org/sdks/python/openstacksdk/
Source0:        https://pypi.io/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%description
%{common_desc}


%if %{with python3}
%package -n python3-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildConflicts: python3-jsonpatch = 1.20
BuildConflicts: python3-pbr = 2.1.0
BuildRequires:  python3-cryptography >= 2.1
BuildRequires:  python3-decorator >= 4.4.1
#BuildRequires:  python3-deprecation >= 1.0
%if 0%{?suse_version}
BuildRequires:  python3-dogpile.cache >= 0.6.2
%else
BuildRequires:  python3-dogpile-cache >= 0.6.2
%endif
BuildRequires:  python3-iso8601 >= 0.1.11
BuildRequires:  python3-jmespath >= 0.9.0
BuildRequires:  python3-jsonpatch >= 1.16
BuildRequires:  python3-keystoneauth1 >= 3.18.0
BuildRequires:  python3-munch >= 2.1.0
BuildRequires:  python3-netifaces >= 0.10.4
BuildRequires:  python3-os-service-types >= 1.7.0
BuildRequires:  python3-pbr >= 2.0.0
BuildRequires:  python3-PyYAML
BuildRequires:  python3-requestsexceptions >= 1.2.0
BuildRequires:  python3-setuptools


%if %{with test}
BuildRequires:  python%{python3_pkgversion}-sphinx
BuildConflicts: python%{python3_pkgversion}-coverage = 4.4
BuildRequires:  python%{python3_pkgversion}-appdirs >= 1.3.0
BuildRequires:  python%{python3_pkgversion}-coverage >= 4.0
BuildRequires:  python%{python3_pkgversion}-extras >= 1.0.0
BuildRequires:  python%{python3_pkgversion}-fixtures >= 3.0.0
BuildRequires:  python%{python3_pkgversion}-jsonschema < 3.0.0
BuildRequires:  python%{python3_pkgversion}-jsonschema >= 2.6.0
BuildRequires:  python%{python3_pkgversion}-mock >= 2.0.0
BuildRequires:  python%{python3_pkgversion}-oslotest >= 3.2.0
BuildRequires:  python%{python3_pkgversion}-python-subunit >= 1.0.0
BuildRequires:  python%{python3_pkgversion}-requests-mock >= 1.2.0
BuildRequires:  python%{python3_pkgversion}-stestr >= 1.0.0
BuildRequires:  python%{python3_pkgversion}-testrepository >= 0.0.18
BuildRequires:  python%{python3_pkgversion}-testscenarios >= 0.4
BuildRequires:  python%{python3_pkgversion}-testtools >= 2.2.0
%endif # with test

Conflicts:      python3-jsonpatch = 1.20
Conflicts:      python3-pbr = 2.1.0
Requires:       python3-appdirs >= 1.3.0
Requires:       python3-cryptography >= 2.1
Requires:       python3-decorator >= 4.4.1
#Requires:       python3-deprecation >= 1.0
%if 0%{?suse_version}
Requires:       python3-dogpile.cache >= 0.6.2
%else
Requires:       python3-dogpile-cache >= 0.6.2
%endif
Requires:       python3-iso8601 >= 0.1.11
Requires:       python3-jmespath >= 0.9.0
Requires:       python3-jsonpatch >= 1.16
Requires:       python3-keystoneauth1 >= 3.18.0
Requires:       python3-munch >= 2.1.0
Requires:       python3-netifaces >= 0.10.4
Requires:       python3-os-service-types >= 1.7.0
Requires:       python3-PyYAML >= 3.11
Requires:       python3-requestsexceptions >= 1.2.0
Requires:       python3-setuptools


%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}

%description -n python%{python3_pkgversion}-%{pypi_name}
%{common_desc}

%package -n python%{python3_pkgversion}-%{pypi_name}-tests
Summary:        An SDK for building applications to work with OpenStack - test files

Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release}

%description -n python%{python3_pkgversion}-%{pypi_name}-tests
%{common_desc_tests}
%endif # with python3

%prep
%autosetup -n %{pypi_name}-%{version}
# Let RPM handle the requirements
rm -rf {,test-}requirements.txt

%build
%if %{with python3}
%py3_build
%endif # python3
# generate html docs 
# PYTHONPATH=${PWD} sphinx-build-3 doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%install
# Must do the default python version install last because
# the scripts in /usr/bin are overwritten with every setup.py install.
%if %{with python3}
%py3_install
%endif # python3

%check
%if %{with test}
%if %{with python3}
%{__python3} setup.py test
%endif # with python3
%endif # with test

%if %{with python3}
%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%license LICENSE
%{_bindir}/openstack-inventory
%{python3_sitelib}/openstack
%{python3_sitelib}/%{pypi_name}-*.egg-info
%exclude %{python3_sitelib}/openstack/tests
 
%files -n python%{python3_pkgversion}-%{pypi_name}-tests
%{python3_sitelib}/openstack/tests
%endif # with python3

%changelog
* Fri Jun 24 2022 - Artem Goncharov <artem.goncharov@gmail.com>
- Update to 0.61.0

* Wed Aug 05 2020 - Artem Goncharov <artem.goncharov@gmail.com>
- Update to 0.48.0

* Fri Oct 11 2019 - Artem Goncharov <artem.goncharov@gmail.com>
- Update to 0.36.0

* Mon Jul 15 2019 - Artem Goncharov <artem.goncharov@gmail.com>
- Update to 0.31.1 for CenOS7-

* Fri Jul 12 2019 - Artem Goncharov <artem.goncharov@gmail.com>
- Update to 0.31.1-

* Wed Mar 27 2019 - Artem Goncharov <artem.goncharov@gmail.com>
- Update to 0.26.0-

* Fri Sep 14 2018 - Artem Goncharov <artem.goncharov@gmail.com>
- initial version 
openSUSE Build Service is sponsored by