2021-05-17 15:32:01 +00:00
|
|
|
#
|
2022-02-01 07:47:58 +00:00
|
|
|
# spec file
|
2021-05-17 15:32:01 +00:00
|
|
|
#
|
2023-04-21 13:19:00 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2021-05-17 15:32:01 +00:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-02-01 07:47:58 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2022-07-20 16:54:32 +00:00
|
|
|
|
2023-04-21 13:19:00 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-02-01 07:47:58 +00:00
|
|
|
Name: python-httpcore%{psuffix}
|
2022-12-24 00:51:24 +00:00
|
|
|
Version: 0.16.3
|
2021-05-17 15:32:01 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Minimal low-level Python HTTP client
|
|
|
|
License: BSD-3-Clause
|
|
|
|
URL: https://github.com/encode/httpcore
|
|
|
|
Source: https://github.com/encode/httpcore/archive/%{version}.tar.gz#/httpcore-%{version}.tar.gz
|
2022-12-24 00:51:24 +00:00
|
|
|
# PATCH-FIX-UPSTREAM httpcore-allow-deprecationwarnings-test.patch gh#encode/httpcore#511, gh#agronholm/anyio#470
|
|
|
|
Patch1: httpcore-allow-deprecationwarnings-test.patch
|
2022-07-20 16:54:32 +00:00
|
|
|
BuildRequires: %{python_module base >= 3.7}
|
2021-05-17 15:32:01 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: python-certifi
|
2022-12-24 00:51:24 +00:00
|
|
|
Requires: (python-anyio >= 3 with python-anyio < 5)
|
|
|
|
Requires: (python-h11 >= 0.13.0 with python-h11 < 0.15)
|
|
|
|
Requires: (python-sniffio >= 1.0 with python-sniffio < 2)
|
2022-02-12 14:41:11 +00:00
|
|
|
Recommends: python-h2 >= 3.0
|
2022-07-20 16:54:32 +00:00
|
|
|
Recommends: python-socksio >= 1.0
|
2021-05-17 15:32:01 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
# SECTION test requirements
|
2022-02-01 07:47:58 +00:00
|
|
|
%if %{with test}
|
2022-07-20 16:54:32 +00:00
|
|
|
BuildRequires: %{python_module Werkzeug}
|
2021-05-17 15:32:01 +00:00
|
|
|
BuildRequires: %{python_module h2 >= 3.0}
|
2022-07-20 16:54:32 +00:00
|
|
|
BuildRequires: %{python_module httpcore = %{version}}
|
|
|
|
BuildRequires: %{python_module pytest >= 7.0.1}
|
|
|
|
BuildRequires: %{python_module pytest-asyncio >= 0.16.0}
|
2022-02-01 06:15:41 +00:00
|
|
|
BuildRequires: %{python_module pytest-httpbin}
|
2021-05-17 15:32:01 +00:00
|
|
|
BuildRequires: %{python_module pytest-trio >= 0.7.0}
|
2022-12-24 00:51:24 +00:00
|
|
|
BuildRequires: %{python_module trio >= 0.21.0}
|
2022-02-01 07:47:58 +00:00
|
|
|
%endif
|
2021-05-17 15:32:01 +00:00
|
|
|
# /SECTION
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
Python minimal low-level HTTP client.
|
|
|
|
|
|
|
|
%prep
|
2022-12-24 00:51:24 +00:00
|
|
|
%autosetup -p1 -n httpcore-%{version}
|
2021-05-17 15:32:01 +00:00
|
|
|
|
2022-12-24 00:51:24 +00:00
|
|
|
%if !%{with test}
|
2021-05-17 15:32:01 +00:00
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2022-02-01 07:47:58 +00:00
|
|
|
%endif
|
2021-05-17 15:32:01 +00:00
|
|
|
|
2022-02-01 07:47:58 +00:00
|
|
|
%if %{with test}
|
2022-12-24 00:51:24 +00:00
|
|
|
%check
|
|
|
|
# we don't ship socksio
|
|
|
|
donttest="socks5"
|
|
|
|
# gh#encode/httpcore#622
|
|
|
|
donttest+=" or test_request_with_content"
|
|
|
|
%pytest -rsfE --asyncio-mode=strict -p no:unraisableexception -k "not ($donttest)"
|
2022-02-01 07:47:58 +00:00
|
|
|
%endif
|
2021-05-17 15:32:01 +00:00
|
|
|
|
2022-02-01 07:47:58 +00:00
|
|
|
%if !%{with test}
|
2021-05-17 15:32:01 +00:00
|
|
|
%files %{python_files}
|
|
|
|
%doc README.md
|
|
|
|
%license LICENSE.md
|
2022-07-20 16:54:32 +00:00
|
|
|
%{python_sitelib}/httpcore
|
|
|
|
%{python_sitelib}/httpcore-%{version}*-info
|
2022-02-01 07:47:58 +00:00
|
|
|
%endif
|
2021-05-17 15:32:01 +00:00
|
|
|
|
|
|
|
%changelog
|