Blob Blame History Raw
%global pypi_name httpcore

%if %{defined fedora}
%bcond_without tests
%endif

Name:           python-%{pypi_name}
Version:        0.14.7
Release:        %autorelease
Summary:        Minimal low-level HTTP client

License:        BSD
URL:            https://github.com/encode/httpcore
# pypi source doesn't contain tests
# Source0:        %%{pypi_source %%{pypi_name}}
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
# https://github.com/encode/httpcore/pull/503
Patch:          0001-Relax-h11-dependency.patch
BuildArch:      noarch

%description
The HTTP Core package provides a minimal low-level HTTP client, which does
one thing only: Sending HTTP requests. It does not provide any high level
model abstractions over the API, does not handle redirects, multipart uploads,
building authentication headers, transparent HTTP caching, URL parsing, etc.

%package -n     python3-%{pypi_name}
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%if %{with tests}
BuildRequires:  %{py3_dist pytest pytest-asyncio pytest-httpbin pytest-trio}
%endif

%description -n python3-%{pypi_name}
The HTTP Core package provides a minimal low-level HTTP client, which does
one thing only: Sending HTTP requests. It does not provide any high level
model abstractions over the API, does not handle redirects, multipart uploads,
building authentication headers, transparent HTTP caching, URL parsing, etc.

%prep
%autosetup -n %{pypi_name}-%{version} -p 1
rm -rf %{pypi_name}.egg-info

%generate_buildrequires
%pyproject_buildrequires %{?with_tests:-x http2,socks}

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files %{pypi_name}

%check
%if %{with tests}
%pytest
%endif

%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE.md
%doc README.md

%changelog
%autochangelog