6b3d663
# what it's called on pypi
6b3d663
%global srcname hpack
6b3d663
# what it's imported as
6b3d663
%global libname hpack
a34c99c
a34c99c
%global common_description %{expand:
a34c99c
HTTP/2 Header Encoding for Python This module contains a pure-Python
a34c99c
HTTP/2 header encoding (HPACK) logic for use in Python programs that implement
a34c99c
HTTP/2. It also contains a compatibility layer that automatically enables the
a34c99c
use of nghttp2 if it's available.}
a34c99c
6b3d663
%if %{defined fedora}
6b3d663
%bcond_without docs
6b3d663
%endif
6b3d663
6b3d663
%bcond_without  check
6b3d663
6b3d663
Name:           python-%{srcname}
e528222
Version:        4.0.0
6b3d663
Release:        1%{?dist}
a34c99c
Summary:        Pure-Python HPACK header compression
a34c99c
a34c99c
License:        MIT
6b3d663
URL:            http://hyper.rtfd.org
6b3d663
VCS:            https://github.com/python-hyper/hpack
6b3d663
Source0:        %vcs/archive/v%{version}/%{srcname}-%{version}.tar.gz
fccefe4
6b3d663
BuildArch:      noarch
6b3d663
BuildRequires:  make
a34c99c
BuildRequires:  python3-devel
a34c99c
94ffadf
%description %{common_description}
a34c99c
6b3d663
%package -n     python3-%{srcname}
a34c99c
Summary:        %{summary}
a34c99c
6b3d663
%description -n python3-%{srcname} %{common_description}
6b3d663
6b3d663
%package doc
6b3d663
Summary:        Documentation for %{name}
6b3d663
6b3d663
%description doc
6b3d663
%{common_description}
6b3d663
6b3d663
This is the documentation package for %{name}.
a34c99c
a34c99c
%prep
6b3d663
%autosetup -p1 -n %{srcname}-%{version}
a34c99c
94ffadf
%generate_buildrequires
94ffadf
# Upstream uses tox to call pytest.  If we used it we'd have to patch out
94ffadf
# pytest-xdist, pytest-cov, and coverage related pytest flags.  Instead, we'll
94ffadf
# just call pytest directly.
94ffadf
%pyproject_buildrequires
6b3d663
echo 'python3dist(hypothesis)'
6b3d663
echo 'python3dist(pytest)'
6b3d663
echo 'python3dist(sphinx)'
94ffadf
a34c99c
%build
94ffadf
%pyproject_wheel
a34c99c
6b3d663
# generate html docs
6b3d663
PYTHONPATH=${PWD} sphinx-build-3 docs/source html
6b3d663
# remove the sphinx-build leftovers
6b3d663
rm -rf html/.{doctrees,buildinfo}
6b3d663
a34c99c
%install
94ffadf
%pyproject_install
6b3d663
%pyproject_save_files %{libname}
a34c99c
6b3d663
%if %{with check}
a34c99c
%check
94ffadf
%pytest -k 'not test_get_by_index_out_of_range'
6b3d663
%endif
a34c99c
6b3d663
%files -n python3-%{srcname} -f %{pyproject_files}
6b3d663
%license LICENSE
a34c99c
%doc README.rst
a34c99c
6b3d663
%files doc
6b3d663
%doc html
6b3d663
%license LICENSE
6b3d663
a34c99c
%changelog
46b1b28
%autochangelog