Blob Blame History Raw
# Created by pyp2rpm-3.2.2
%global pypi_name cheroot
# rst-linker not yet available in fedora for docs build
%bcond_with docs

Name:           python-%{pypi_name}
Version:        6.5.4
Release:        1%{?dist}
Summary:        Highly-optimized, pure-python HTTP server

License:        BSD
URL:            https://github.com/cherrypy/cheroot
Source0:        %{pypi_source}
BuildArch:      noarch

%description
Cheroot is the high performance, pure Python HTTP server used by CherryPy.Status
The test suite currently relies on pytest. It's being run via Travis
CI.Contribute Cheroot.

%package -n python3-%{pypi_name}
Summary:        %{summary}
Requires:       python3dist(six) >= 1.11.0
Requires:       python3dist(more-itertools) >= 2.6
Requires:       python3-pyOpenSSL
Requires:       python3dist(trustme)

BuildRequires:  python3-devel
BuildRequires:  python3-pyOpenSSL
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(pytest-cov)
BuildRequires:  python3dist(pytest-mock)
# testmon is not needed to tests to run successfully
# the f31 version of testmon requires pytest < 4
# which is not in f31
# BuildRequires:  python3dist(pytest-testmon)
BuildRequires:  python3dist(requests)
BuildRequires:  python3dist(requests-unixsocket)
BuildRequires:  python3-setuptools_scm_git_archive >= 1.0
BuildRequires:  python3dist(setuptools)
BuildRequires:  python3dist(trustme)
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
Cheroot is the high performance, pure Python HTTP server used by CherryPy.Status
The test suite currently relies on pytest. It's being run via Travis
CI.Contribute Cheroot.

%if %{with docs}
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3dist(sphinx-theme-alabaster)
BuildRequires:  python3-rst-linker
BuildRequires:  python3-jaraco-packaging
BuildRequires:  python3dist(docutils)

%package -n python-%{pypi_name}-doc
Summary:        cheroot documentation
%description -n python-%{pypi_name}-doc
Documentation for cheroot
%endif

%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
# remove backports.functools_lru_cache from setup.cfg. it's a py2 dep
sed -i '/backports.functools_lru_cache/d' setup.cfg

# ssl test fail
# https://github.com/cherrypy/cheroot/issues/173
sed -i '187i@pytest.mark.skip(reason="Skip test_tls_client_auth: https://github.com/cherrypy/cheroot/issues/173")' cheroot/test/test_ssl.py

# testmon is not needed to tests to run successfully
# the f31 version of testmon requires pytest < 4
# which is not in f31
sed -i 's/ --testmon//' pytest.ini
sed -i '/pytest-testmon/d' setup.cfg


%build
%py3_build
%if %{with docs}
sphinx-build -vvv docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%endif

%install
%py3_install

%check
LANG=C.utf-8 %{__python3} -m pytest --ignore=build

%files -n python3-%{pypi_name}
%license LICENSE.md
%doc README.rst
%{_bindir}/cheroot
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%if %{with docs}
%files -n python-%{pypi_name}-doc
%license LICENSE.md
%doc html
%endif

%changelog
* Wed May 02 2018 Dan Radez <dradez@redhat.com> - 6.5.4-1
- Initial package.