b89800e
a240f2b
%{!?_licensedir:%global license %%doc}
a240f2b
%global pypi_name os-client-config
b89800e
%global with_doc 1
9bf267c
Alan Pevec 944a970
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
Alan Pevec 944a970
b89800e
%global common_desc \
b89800e
The os-client-config is a library for collecting client configuration for \
b89800e
using an OpenStack cloud in a consistent and comprehensive manner. It \
b89800e
will find cloud config for as few as 1 cloud and as many as you want to \
b89800e
put in a config file. It will read environment variables and config files, \
b89800e
and it also contains some vendor specific default values so that you don't \
b89800e
have to know extra info to use OpenStack \
b89800e
 \
b89800e
* If you have a config file, you will get the clouds listed in it \
b89800e
* If you have environment variables, you will get a cloud named `envvars` \
b89800e
* If you have neither, you will get a cloud named `defaults` with base defaults
b89800e
a240f2b
Name:           python-%{pypi_name}
b89800e
Version:        1.32.0
a49e11c
Release:        3%{?dist}
Alan Pevec e1f2b37
Summary:        OpenStack Client Configuration Library
7e1289d
License:        ASL 2.0
a240f2b
URL:            https://github.com/openstack/%{pypi_name}
71d84a9
Source0:        https://pypi.io/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
7e1289d
a240f2b
BuildArch:      noarch
Alan Pevec 944a970
BuildRequires:  git
Alan Pevec 944a970
b89800e
%description
b89800e
%{common_desc}
a240f2b
a240f2b
a240f2b
%package -n python3-%{pypi_name}
Alan Pevec 944a970
Summary:        %{summary}
a240f2b
%{?python_provide:%python_provide python3-%{pypi_name}}
b89800e
7e1289d
BuildRequires:  python3-devel
7e1289d
BuildRequires:  python3-setuptools
7e1289d
BuildRequires:  python3-pbr
Alan Pevec 944a970
# Testing requirements
a61eecd
BuildRequires:  python3-fixtures
392380a
BuildRequires:  python3-stestr
b89800e
BuildRequires:  python3-jsonschema >= 2.6.0
b89800e
BuildRequires:  python3-glanceclient >= 0.18.0
b89800e
BuildRequires:  python3-openstacksdk
8578bdc
BuildRequires:  python3-oslotest >= 1.10.0
7e1289d
b89800e
Requires:       python3-openstacksdk >= 0.13.0
7e1289d
a240f2b
%description -n python3-%{pypi_name}
b89800e
%{common_desc}
7e1289d
8c1007b
7e1289d
b89800e
%if 0%{?with_doc}
b89800e
%package  -n python-%{pypi_name}-doc
b89800e
Summary:        Documentation for OpenStack os-client-config library
b89800e
b89800e
BuildRequires:  python3-sphinx
b89800e
BuildRequires:  python3-openstackdocstheme
b89800e
BuildRequires:  python3-reno
b89800e
BuildRequires:  python3-sphinx
b89800e
BuildRequires:  python3-openstackdocstheme
b89800e
b89800e
%description -n python-%{pypi_name}-doc
7e1289d
Documentation for the os-client-config library.
7e1289d
%endif
7e1289d
7e1289d
%prep
Alan Pevec 944a970
%autosetup -n %{pypi_name}-%{upstream_version} -S git
7e1289d
7e1289d
# Let RPM handle the dependencies
7e1289d
rm -f test-requirements.txt requirements.txt
7e1289d
7e1289d
%build
7e1289d
%py3_build
7e1289d
b89800e
%if 0%{?with_doc}
b89800e
# generate html doc
b89800e
sphinx-build-3 -b html doc/source/ doc/build/html
b89800e
sphinx-build-3 -b html doc/source/ doc/build/html
b89800e
rm -rf doc/build/html/.{doctrees,buildinfo} doc/build/html/objects.inv
9bf267c
%endif
7e1289d
b89800e
%install
7e1289d
7e1289d
%py3_install
7e1289d
7e1289d
b89800e
%check
b89800e
# NOTE(jpena): we are disabling Python2 unit tests when building the Python 3 package.
b89800e
# The reason is that unit tests require glanceclient, and glanceclient is python3-only
b89800e
# when building with Python 3. We could revert that, but it is a rabbit hole we do not
b89800e
# want to enter
b89800e
export OS_TEST_PATH='./os_client_config/tests'
b89800e
export PATH=$PATH:$RPM_BUILD_ROOT/usr/bin
b89800e
export PYTHONPATH=$PWD
b89800e
b89800e
rm -rf .stestr
b89800e
export PYTHON=python3
b89800e
stestr-3 --test-path $OS_TEST_PATH run
7e1289d
a240f2b
%files -n python3-%{pypi_name}
7e1289d
%doc ChangeLog CONTRIBUTING.rst PKG-INFO README.rst
7e1289d
%license LICENSE
7e1289d
%{python3_sitelib}/os_client_config
7e1289d
%{python3_sitelib}/*.egg-info
7e1289d
b89800e
%if 0%{?with_doc}
b89800e
%files -n python-%{pypi_name}-doc
a240f2b
%license LICENSE
b89800e
%doc doc/build/html
7e1289d
%endif
7e1289d
7e1289d
%changelog
a49e11c
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.32.0-3
a49e11c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a49e11c
392380a
* Fri May 10 2019 Alfredo Moralejo <amoralej@redhat.com> 1.32.0-2
392380a
- Added stestr as BR
392380a
b89800e
* Fri Mar 08 2019 RDO <dev@lists.rdoproject.org> 1.32.0-1
b89800e
- Update to 1.32.0
1912658