%global pypi_name wsgi_intercept
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{pypi_name}
Version: 1.2.2
Release: 3%{?dist}
Summary: wsgi_intercept installs a WSGI application in place of a real URI for testing
License: MIT
URL: https://github.com/cdent/wsgi-intercept
Source0: https://pypi.python.org/packages/source/w/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
It installs a WSGI application in place of a real URI for testing.
Testing a WSGI application normally involves starting a server at
a local host and port, then pointing your test code to that address.
Instead,this library lets you intercept calls to any specific host/port
combination and redirect them into a `WSGI application`_ importable by
your test program.
%package -n python2-%{pypi_name}
Summary: wsgi_intercept installs a WSGI application in place of a real URI for testing
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python2-devel
BuildRequires: python-setuptools
# test dependencies
BuildRequires: pytest
BuildRequires: python-httplib2
BuildRequires: python-requests
Requires: python-setuptools
%description -n python2-%{pypi_name}
It installs a WSGI application in place of a real URI for testing.
Testing a WSGI application normally involves starting a server at
a local host and port, then pointing your test code to that address.
Instead,this library lets you intercept calls to any specific host/port
combination and redirect them into a `WSGI application`_ importable by
your test program.
%package -n python-%{pypi_name}-doc
Summary: Documentation for the wsgi-intercept module
BuildRequires: python-sphinx
BuildRequires: python-sphinx_rtd_theme
%description -n python-%{pypi_name}-doc
Documentation for the wsgi-intercept module
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: wsgi_intercept installs a WSGI application in place of a real URI for testing
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# test dependencies
BuildRequires: python3-pytest
BuildRequires: python3-httplib2
BuildRequires: python3-requests
Requires: python3-setuptools
%description -n python3-%{pypi_name}
It installs a WSGI application in place of a real URI for testing.
Testing a WSGI application normally involves starting a server at
a local host and port, then pointing your test code to that address.
Instead,this library lets you intercept calls to any specific host/port
combination and redirect them into a `WSGI application`_ importable by
your test program.
%endif
%prep
%setup -q -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py2_build
# generate html docs
export PYTHONPATH="$( pwd ):$PYTHONPATH"
sphinx-build docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
# fix file encoding
sed -i 's/\r$//' html/_static/jquery.js
%if 0%{?with_python3}
%py3_build
%endif
%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif
%check
%{__python2} setup.py test
%if 0%{?with_python3}
%{__python3} setup.py test
%endif
%files -n python2-%{pypi_name}
%doc README
%license LICENSE
%{python2_sitelib}/%{pypi_name}*
%exclude %{python2_sitelib}/test
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README
%license LICENSE
%{python3_sitelib}/%{pypi_name}*
%exclude %{python3_sitelib}/test
%endif
%files -n python-%{pypi_name}-doc
%license LICENSE
%doc html
%changelog
* Wed May 11 2016 Chandan Kumar <chkumar246@gmail.com> - 1.2.2-3
- Added missing python3 macro in %check
* Wed May 11 2016 Chandan Kumar <chkumar246@gmail.com> - 1.2.2-2
- Applied python3 Alan Pevec patch
* Wed May 05 2016 Chandan Kumar <chkumar246@gmail.com> - 1.2.2-1
- Bumped to version 1.2.2
* Mon Sep 21 2015 Chandan Kumar <chkumar246@gmail.com> - 0.10.3-2
- Fixed import error
- Removed test folder
* Wed Sep 16 2015 Chandan Kumar <chkumar246@gmail.com> - 0.10.3-1
- Initial package.