%{!?sources_gpg: %{!?dlrn:%global sources_gpg 1} } %global sources_gpg_sign 0x2426b928085a020d8a90d0d879ab7008d0896c8a %{!?upstream_version: %global upstream_version %{version}%{?milestone}} # we are excluding some BRs from automatic generator %global excluded_brs doc8 bandit pre-commit hacking flake8-import-order %global with_doc 1 %global sname sushy %global common_desc \ Sushy is a Python library to communicate with Redfish based systems (http://redfish.dmtf.org) %global common_desc_tests Tests for Sushy Name: python-%{sname} Version: XXX Release: XXX Summary: Sushy is a Python library to communicate with Redfish based systems License: Apache-2.0 URL: http://launchpad.net/%{sname}/ Source0: http://tarballs.openstack.org/%{sname}/%{sname}-%{upstream_version}.tar.gz # Required for tarball sources verification %if 0%{?sources_gpg} == 1 Source101: http://tarballs.openstack.org/%{sname}/%{sname}-%{upstream_version}.tar.gz.asc Source102: https://releases.openstack.org/_static/%{sources_gpg_sign}.txt %endif BuildArch: noarch # Required for tarball sources verification %if 0%{?sources_gpg} == 1 BuildRequires: /usr/bin/gpgv2 BuildRequires: openstack-macros %endif %description %{common_desc} %package -n python3-%{sname} Summary: Sushy is a Python library to communicate with Redfish based systems BuildRequires: git-core BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros %description -n python3-%{sname} %{common_desc} %package -n python3-%{sname}-tests Summary: Sushy tests Requires: python3-%{sname} = %{version}-%{release} Requires: python3-oslotest Requires: python3-stestr %description -n python3-%{sname}-tests %{common_desc_tests} %if 0%{?with_doc} %package -n python-%{sname}-doc Summary: Sushy documentation %description -n python-%{sname}-doc Documentation for Sushy %endif %prep # Required for tarball sources verification %if 0%{?sources_gpg} == 1 %{gpgverify} --keyring=%{SOURCE102} --signature=%{SOURCE101} --data=%{SOURCE0} %endif %autosetup -n %{sname}-%{upstream_version} -S git sed -i /^[[:space:]]*-c{env:.*_CONSTRAINTS_FILE.*/d tox.ini sed -i "s/^deps = -c{env:.*_CONSTRAINTS_FILE.*/deps =/" tox.ini sed -i /^minversion.*/d tox.ini sed -i /^requires.*virtualenv.*/d tox.ini # Exclude some bad-known BRs for pkg in %{excluded_brs};do for reqfile in doc/requirements.txt test-requirements.txt; do if [ -f $reqfile ]; then sed -i /^${pkg}.*/d $reqfile fi done done # Automatic BR generation %generate_buildrequires %if 0%{?with_doc} %pyproject_buildrequires -t -e %{default_toxenv},docs %else %pyproject_buildrequires -t -e %{default_toxenv} %endif %build %pyproject_wheel %if 0%{?with_doc} # generate html docs %tox -e docs # remove the sphinx-build-3 leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %endif %check %tox -e %{default_toxenv} %install %pyproject_install %files -n python3-%{sname} %license LICENSE %{python3_sitelib}/%{sname} %{python3_sitelib}/%{sname}-*.dist-info %exclude %{python3_sitelib}/%{sname}/tests %files -n python3-%{sname}-tests %license LICENSE %{python3_sitelib}/%{sname}/tests %if 0%{?with_doc} %files -n python-%{sname}-doc %license LICENSE %doc doc/build/html README.rst %endif %changelog