File python-httpcore.spec of Package python-httpcore

#
# spec file for package python-httpcore
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
Name:           python-httpcore%{psuffix}
Version:        0.14.3
Release:        0
Summary:        A minimal low-level HTTP client
License:        BSD-3-Clause
Group:          Development/Languages/Python
URL:            https://github.com/encode/httpcore
Source:         httpcore-%{version}.tar.xz
%if %{with test}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module pytest-cov}
BuildRequires:  %{python_module pytest-trio}
BuildRequires:  %{python_module pytest-asyncio}
BuildRequires:  %{python_module trustme}
BuildRequires:  %{python_module black}
BuildRequires:  %{python_module autoflake}
BuildRequires:  %{python_module mypy}
BuildRequires:  %{python_module mitmproxy}
BuildRequires:  %{python_module trio}
BuildRequires:  %{python_module tqdm}
BuildRequires:  %{python_module pathspec}
BuildRequires:  %{python_module regex}
BuildRequires:  %{python_module appdirs}
BuildRequires:  %{python_module tornado}
BuildRequires:  %{python_module isort}
BuildRequires:  %{python_module twine}
BuildRequires:  %{python_module asyncio}
BuildRequires:  %{python_module click}
BuildRequires:  %{python_module PyYAML}
BuildRequires:  %{python_module Jinja2}
BuildRequires:  %{python_module attrs}
BuildRequires:  %{python_module idna}
BuildRequires:  %{python_module autoflake}
BuildRequires:  %{python_module pyOpenSSL}
BuildRequires:  %{python_module h11 >= 0.13}
BuildRequires:  %{python_module h2 >= 3.0}
BuildRequires:  %{python_module sniffio >= 1.0.0}
BuildRequires:  %{python_module httpcore}
%endif
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module hatchling}
BuildRequires:  %{python_module hatch-fancy-pypi-readme}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-h11 >= 0.13
Requires:       python-h2 >= 3.0
Requires:       python-certifi
Requires:       python-sniffio >= 1.0.0
BuildArch:      noarch
%python_subpackages

%description
> *Do one thing, and do it well.*

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, session cookie handling,
content or charset decoding, handling JSON, environment based configuration
defaults, or any of that Jazz.

Some things HTTP Core does do:

* Sending HTTP requests.
* Provides both sync and async interfaces.
* Supports HTTP/1.1 and HTTP/2.
* Async backend support for `asyncio` and `trio`.
* Automatic connection pooling.
* HTTP(S) proxy support.

%prep
%setup -q -n httpcore-%{version}

%build
%if !%{with test}
%pyproject_wheel
%endif

%install
%if !%{with test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif

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

%if !%{with test}
%files %{python_files}
%doc README.md CHANGELOG.md
%license LICENSE.md
%{python_sitelib}/*
%endif

%changelog
openSUSE Build Service is sponsored by