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
#
2022-02-01 06:15:41 +00:00
# Copyright (c) 2022 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
2022-02-01 07:47:58 +00:00
Name : python-httpcore%{psuffix}
2022-07-20 16:54:32 +00:00
Version : 0.15.0
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-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
2022-07-20 16:54:32 +00:00
Requires : python-anyio >= 3
2021-05-17 15:32:01 +00:00
Requires : python-certifi
2021-06-03 12:45:31 +00:00
Requires : python-h11 >= 0.11.0
2021-05-17 15:32:01 +00:00
Requires : python-sniffio >= 1.0
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-07-20 16:54:32 +00:00
BuildRequires : %{python_module trio >= 0.19.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
%setup -q -n httpcore-%{version}
#sed -i 's/"localhost"/"127.0.0.1"/' tests/*sync_tests/test_interfaces.py tests/conftest.py
%build
%python_build
%install
2022-02-01 07:47:58 +00:00
%if !%{with test}
2021-05-17 15:32:01 +00:00
%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
%check
# ulimit -n 50000
# test_no_retries and test_retries are very slow and fails
# tests/async_tests + tests/sync_tests causes open file limit
2022-02-01 06:15:41 +00:00
# socks5 -- we don't ship socksio
2022-11-23 14:27:20 +00:00
# gh#encode/httpcore#622 - test_request_with_content
2022-02-01 07:47:58 +00:00
%if %{with test}
2022-11-23 14:27:20 +00:00
%pytest -rs -k 'not (test_interfaces or test_no_retries or test_retries or test_threadsafe_basic or test_request_with_content or socks5)' --asyncio-mode=strict
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