Blob Blame History Raw
%bcond_without doc

%global modname test_server

Name:           python-%{modname}
Version:        0.0.31
Release:        5%{?dist}
Summary:        Server to test HTTP clients, written in Python

License:        MIT
URL:  {modname}
Source0:        %{url}/archive/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz
Patch0:         %{modname}-deprecated-params.patch
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-bottle
BuildRequires:  python3-webtest

%if %{with doc}
BuildRequires:  python3-sphinx

# Tests:
BuildRequires:  python3-pytest



%package -n     python3-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{modname}}

%description -n python3-%{modname}

%package        doc
Summary:        Documentation files for %{modname}

%description    doc

%autosetup -p1 -n%{modname}-%{version}


%if %{with doc}
# avoid WARNING: autodoc: failed to import module
echo "import sys; import os; sys.path.insert(0, os.path.abspath('..'))" >>docs/
# FIXME several other warnings from sphinx
# FIXME drop binary suffix in case python3 gets the default runtime
sphinx-build-3 -d docs/doctrees docs docs/html
rm -fv docs/html/.build*


%{__python3} -m pytest -v

%files -n python3-%{modname}
%license LICENSE
%doc README.rst

%if %{with doc}
%files doc
%license LICENSE
%doc docs/html

* Fri Jul 26 2019 Fedora Release Engineering <> - 0.0.31-5
- Rebuilt for

* Sat Feb 02 2019 Fedora Release Engineering <> - 0.0.31-4
- Rebuilt for

* Thu Nov 01 2018 Raphael Groner <> - 0.0.31-3
- support old API for pysocks

* Sat Oct 06 2018 Raphael Groner <> - 0.0.31-2
- replace python3 version macro with concrete value, currently no plan for epel7
- use binary suffix for sphinx due to weird error with mock

* Wed Oct 03 2018 Raphael Groner <> - 0.0.31-1
- prepare for review
- add optional generation of documentation into subpackage
- don't use pypi tarball due to missing docs subfolder
- skip epel7 for now due to missing runtime e.g. bottle and webtest

* Fri Aug 17 2018 Miro HronĨok <> - 0.0.31-0
- Initial package