File python-openstacksdk.spec of Package python-openstacksdk

#
# spec file for package python-openstacksdk
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           python-openstacksdk
Version:        4.4.0
Release:        0
Summary:        An SDK for building applications to work with OpenStack
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/openstacksdk
Source0:        https://files.pythonhosted.org/packages/source/o/openstacksdk/openstacksdk-4.4.0.tar.gz
BuildRequires:  openstack-macros
BuildRequires:  python311-PyYAML
BuildRequires:  python311-appdirs
BuildRequires:  python311-beautifulsoup4
BuildRequires:  python311-ddt
BuildRequires:  python311-decorator
BuildRequires:  python311-deprecation
BuildRequires:  python311-dogpile.cache
BuildRequires:  python311-extras
BuildRequires:  python311-fixtures
BuildRequires:  python311-jmespath
BuildRequires:  python311-jsonpatch
BuildRequires:  python311-jsonschema
BuildRequires:  python311-keystoneauth1
BuildRequires:  python311-munch
BuildRequires:  python311-os-service-types
BuildRequires:  python311-oslo.config
BuildRequires:  python311-oslotest
BuildRequires:  python311-pbr
BuildRequires:  python311-platformdirs
BuildRequires:  python311-psutil
BuildRequires:  python311-python-subunit
BuildRequires:  python311-requests-mock
BuildRequires:  python311-requestsexceptions
BuildRequires:  python311-statsd
BuildRequires:  python311-stestr
BuildRequires:  python311-stevedore
BuildRequires:  python311-testscenarios
BuildRequires:  python311-testtools
BuildArch:      noarch
%if 0%{?suse_version}
# RDO does not package prometheus_client
BuildRequires:  python311-prometheus_client
%endif

%description
The openstacksdk is a library for building applications to work
with OpenStack clouds.
The project aims to provide a consistent and complete set of
interactions with OpenStack's many services, along with complete
documentation, examples, and tools.

%package -n python311-openstacksdk
Summary:        An SDK for building applications to work with OpenStack
Requires:       python311-PyYAML
Requires:       python311-appdirs
Requires:       python311-cryptography
Requires:       python311-decorator
Requires:       python311-dogpile.cache
Requires:       python311-iso8601
Requires:       python311-jmespath
Requires:       python311-jsonpatch
Requires:       python311-keystoneauth1
Requires:       python311-munch
Requires:       python311-os-service-types
Requires:       python311-platformdirs
Requires:       python311-psutil
Requires:       python311-requestsexceptions
%if 0%{?suse_version}
Obsoletes:      python2-openstacksdk < 1.0.0
%endif
%if 0%{?suse_version}
%if 0%{?sle_version} >= 150000 || 0%{?suse_version} > 1500
Requires:       mkisofs
%else
Requires:       genisoimage
%endif
%else
Requires:       genisoimage
%endif

%description -n python311-openstacksdk
The openstacksdk is a library for building applications to work
with OpenStack clouds.
The project aims to provide a consistent and complete set of
interactions with OpenStack's many services, along with complete
documentation, examples, and tools.

This package contains the Python 3.x module

%package -n python-openstacksdk-doc
Summary:        %{summary} - Documentation
Group:          Documentation/HTML
BuildRequires:  python311-Sphinx
BuildRequires:  python311-openstackdocstheme
BuildRequires:  python311-sphinxcontrib-svg2pdfconverter

%description -n python-openstacksdk-doc
The openstacksdk is a library for building applications to work
with OpenStack clouds.
The project aims to provide a consistent and complete set of
interactions with OpenStack's many services, along with complete
documentation, examples, and tools.

The openstacksdk is a collection of libraries for building
applications to work with OpenStack clouds.

%prep
%autosetup -p1 -n openstacksdk-4.4.0
%py_req_cleanup
sed -i -e 's,coverage.*,,' test-requirements.txt || true
sed -i -e "s,'sphinx.ext.intersphinx'\,,," doc/source/conf.py
%if !0%{?suse_version}
# RDO does not package prometheus_client
rm openstack/tests/unit/test_stats.py
%endif

%build
%py3_build
PBR_VERSION=4.4.0 %sphinx_build -b html doc/source doc/build/html
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%py3_install

%check
export OS_LOG_CAPTURE=true
export OS_TEST_TIMEOUT=30
rm -v openstack/tests/unit/test_hacking.py
%{openstack_stestr_run}

%files -n python311-openstacksdk
%license LICENSE
%doc ChangeLog README.rst
%{_bindir}/openstack-inventory
%{python3_sitelib}/openstack
%{python3_sitelib}/*.egg-info

%files -n python-openstacksdk-doc
%license LICENSE
%doc doc/build/html

%changelog
openSUSE Build Service is sponsored by