## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%bcond tests 1

Name:           python-httpx
Version:        0.28.1
Release:        %autorelease
Summary:        Next-generation HTTP client for Python

License:        BSD-3-Clause
URL:            https://github.com/encode/httpx
Source0:        %{url}/archive/%{version}/httpx-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python3-devel
%if %{with tests}
# See the Optional charset auto-detection group in requirements.txt:
BuildRequires:  %{py3_dist chardet}
# See the Tests & Linting group in requirements.txt:
BuildRequires:  %{py3_dist cryptography}
BuildRequires:  %{py3_dist pytest}
BuildRequires:  %{py3_dist trio}
BuildRequires:  %{py3_dist trustme}
BuildRequires:  %{py3_dist uvicorn}
BuildRequires:  %{py3_dist zstandard}
%endif
BuildRequires:  help2man

%global _description %{expand:
HTTPX is a fully featured HTTP client library for Python 3. It includes an
integrated command line client, has support for both HTTP/1.1 and HTTP/2, and
provides both sync and async APIs.}


%description %{_description}

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

%description -n python3-httpx %{_description}
HTTPX is a fully featured HTTP client for Python, which provides sync and
async APIs, and support for both HTTP/1.1 and HTTP/2.

%pyproject_extras_subpkg -n python3-httpx brotli http2 socks

%pyproject_extras_subpkg -n python3-httpx cli
%{_bindir}/httpx
%{_mandir}/man1/httpx.1*

%prep
%autosetup -n httpx-%{version}

%generate_buildrequires
%pyproject_buildrequires -x brotli,cli,http2,socks

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files -l httpx
install -d '%{buildroot}%{_mandir}/man1'
PYTHONPATH='%{buildroot}%{python3_sitelib}' \
    PATH="${PATH-}:%{buildroot}%{_bindir}" \
    PYTHONDONTWRITEBYTECODE=1 \
    help2man --no-info --version-string='%{version}' \
    --output='%{buildroot}%{_mandir}/man1/httpx.1' httpx

%check
%pyproject_check_import
%if %{with tests}
# These require network access (DNS)
k="${k-}${k+ and }not test_async_proxy_close"
k="${k-}${k+ and }not test_sync_proxy_close"

# ResourceWarning in test_write_timeout[trio] with trio >=0.27
# https://github.com/encode/httpx/discussions/3498
k="${k-}${k+ and }not test_write_timeout[trio]"

%pytest -k "${k-}" -v
%endif

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

%changelog
## START: Generated by rpmautospec
* Thu Feb 27 2025 Carl George <carlwgeorge@fedoraproject.org> - 0.28.1-1
- Update to version 0.28.1 rhbz#2333343

* Tue Feb 11 2025 Benjamin A. Beasley <code@musicinmybrain.net> - 0.27.2-3
- Skip and report test that fails with trio>=0.27 (ResourceWarning)

* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild

* Mon Sep 30 2024 Fabian Affolter <mail@fabian-affolter.ch> - 0.27.2-1
- UPdate to latest upstream release

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.27.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sun Jun 09 2024 Python Maint <python-maint@redhat.com> - 0.27.0-3
- Rebuilt for Python 3.13

* Sun Jun 09 2024 Python Maint <python-maint@redhat.com> - 0.27.0-2
- Bootstrap for Python 3.13

* Mon Apr 08 2024 Fabian Affolter <mail@fabian-affolter.ch> - 0.27.0-1
- UPdate to latest upstream release 0.27.0

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-12
- Run the upstream test suite

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-11
- Install the CLI tool and man page as part of the cli extra

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-10
- Generate and install a man page

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-9
- Add missing brotli, cli, http2, and socks extras metapackages

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-7
- Package the changelog an the Chinese version of the readme

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-6
- Do not package a duplicate LICENSE.md file

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-5
- Update License to SPDX

* Tue Feb 13 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.26.0-4
- Update Summary and description from upstream

* Tue Feb 06 2024 František Zatloukal <fzatlouk@redhat.com> - 0.26.0-1
- Update to 0.26.0 (Fixes RHBZ#2262291)

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.25.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.25.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sun Nov 05 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 0.25.1-1
- feat: update to 0.25.1 (fixes rh#2247996)

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.24.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Jul 17 2023 František Zatloukal <fzatlouk@redhat.com> - 0.24.1-1
- Update to 0.24.1 (Fixes RHBZ#2223286)

* Mon Jul 03 2023 Python Maint <python-maint@redhat.com> - 0.24.0-2
- Rebuilt for Python 3.12

* Mon May 15 2023 František Zatloukal <fzatlouk@redhat.com> - 0.24.0-1
- Update to 0.24 (Fixes RHBZ#2143942 )

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sun Sep 18 2022 Fabian Affolter <mail@fabian-affolter.ch> - 0.23.0-1
- Update to latest upstream release 0.23.0 (closes rhbz#2127178)

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.22.0-2
- Rebuilt for Python 3.11

* Sun Mar 06 2022 Fabian Affolter <mail@fabian-affolter.ch> - 0.22.0-1
- Update to latest upstream release 0.22.0 (closes rhbz#2053821)

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sun Dec 12 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.21.1-1
- Update to latest upstream release 0.21.1

* Sun Dec 12 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.21.0-1
- Update to latest upstream release 0.21.0

* Tue Oct 26 2021 Joel Capitao <jcapitao@redhat.com> - 0.20.0-1
- Update to latest upstream release 0.20.0

* Thu Aug 26 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.19.0-1
- * Thu Aug 26 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.19.0-1 -
  Update to latest upstream release 0.19.0

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.17.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.17.1-2
- Rebuilt for Python 3.10

* Tue Mar 16 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.17.1-1
- * Tue Mar 16 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.17.1 -
  Update to new upstream release 0.17.1 (#1933492)

* Mon Mar 01 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.17.0-1
- * Mon Mar 01 2021 Fabian Affolter <mail@fabian-affolter.ch> - 0.17.0-1 -
  Update to new upstream release 0.17.0 (#1933492)

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Oct 09 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.16.1-1
- * Fri Oct 09 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.16.1-1 -
  Update to new upstream release 0.16.1 (#1884265)

* Wed Oct 07 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.16.0-1
- * Wed Oct 07 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.16.0-1 -
  Update to new upstream release 0.16.0 (#1884265)

* Sun Oct 04 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.5-1
- * Sun Oct 04 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.5-1 -
  Update to new upstream release 0.15.5 (#1884265)

* Fri Sep 25 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.4-1
- * Fri Sep 25 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.4-1 -
  Update to latest upstream release 0.15.4 (#1881434)

* Fri Sep 25 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.3-1
- * Fri Sep 25 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.3-1 -
  Update to latest upstream release 0.15.3 (#1881434)

* Wed Sep 23 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.0-1
- * Wed Sep 23 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.15.0-1 -
  Update to latest upstream release 0.15.0 (#1881434)

* Thu Sep 03 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.14.3-2
- * Thu Sep 03 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.14.3-2 -
  Run dependency genenerator

* Thu Sep 03 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.14.3-1
- * Thu Sep 03 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.14.3-1 -
  Update to latest upstream release 0.14.3 (rhbz#1875281)

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jul 03 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.13.3-1
- * Fri Jun 05 2020 Fabian Affolter <mail@fabian-affolter.ch> - 0.13.3-1 -
  Initial package for Fedora
## END: Generated by rpmautospec