{% set pypi_name = 'oslo.context' %} {% set upstream_version = upstream_version('2.22.1') %} {% set rpm_release = '1' %} {% set source = url_pypi() %} %bcond_without test Name: {{ py2name() }} Version: {{ py2rpmversion() }} Release: {{ py2rpmrelease() }} Summary: OpenStack Oslo context library License: {{ license('Apache-2.0') }} Group: Development/Languages/Python URL: https://launchpad.net/{{ pypi_name }} Source0: {{ source }} BuildRequires: openstack-macros BuildRequires: {{ py2pkg('pbr', py_versions=['py2', 'py3']) }} Requires: {{ py2pkg('debtcollector') }} BuildArch: noarch %if %{with test} BuildRequires: {{ py2pkg('debtcollector', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('fixtures', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('oslotest', py_versions=['py2', 'py3']) }} BuildRequires: {{ py2pkg('stestr', py_versions=['py2', 'py3']) }} %endif %python_subpackages %description The Oslo context library has helpers to maintain useful information about a request context. The request context is usually populated in the WSGI pipeline and used by various modules such as logging. %package -n python-oslo.context-doc Summary: Documentation for OpenStack common context library Group: Documentation/HTML BuildRequires: {{ py2pkg('Sphinx') }} BuildRequires: {{ py2pkg('openstackdocstheme') }} %description -n python-oslo.context-doc Documentation for the oslo-context library. %prep %autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }} %py_req_cleanup %build %{python_build} # generate html docs PBR_VERSION=%{version} sphinx-build -b html doc/source doc/build/html # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %install %{python_install} %if %{with test} %check %python_exec -m stestr.cli run %endif %files %{python_files} %license LICENSE %doc README.rst %{python2_sitelib}/oslo_context %{python2_sitelib}/*.egg-info %files -n python-oslo.context-doc %license LICENSE %doc doc/build/html %changelog