archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-httpx / trunk / PKGBUILD
blobb9be04c802eaec2993fac9e7bb2cb379d5138b93
1 # Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
2 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
4 _pkgname=httpx
5 pkgname=python-httpx
6 # https://github.com/encode/httpx/blob/master/CHANGELOG.md
7 pkgver=0.24.0
8 pkgrel=2
9 pkgdesc="A next generation HTTP client for Python"
10 arch=('any')
11 url="https://github.com/encode/${_pkgname}"
12 license=('BSD')
13 depends=('python' 'python-certifi' 'python-httpcore' 'python-idna' 'python-sniffio')
14 optdepends=(
15   'python-brotlicffi: for brotli response decompression'
16   'python-h2: HTTP/2 support'
17   'python-socksio: SOCKS proxy support'
18   'python-click: command line client support'
19   'python-rich: command line client support'
20   'python-pygments: command line client support'
21   'python-trio: alternative async library'
23 makedepends=('python-build' 'python-installer' 'python-hatchling' 'python-hatch-fancy-pypi-readme'
24              'python-pygments')
25 checkdepends=('python-pytest-asyncio' 'python-pytest-trio' 'python-typing_extensions' 'python-brotlicffi' 'python-h2' 'python-trustme' 'uvicorn' 'python-socksio'
26               'python-rich' 'python-chardet')
27 source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
28         "uvicorn-test-server-use-h11.diff")
29 sha512sums=('52ccd285cee6032c604160484520522957fdfb4735385bf68d594574b4525b89ea007eb71a653cdf01381610f350c8120c36422e0fda91c39dad437f5cb3f486'
30             'd3e6a9df365aff5e4e7b724469672c6da9c7e95cc5d79339ebd1ea249236802d81b8792efb0826f89747424fa1bef20d4965ddb75b3b67e9cd320b5fcc738f18')
31 b2sums=('261298dcb65b22c4b188b03a7f650ed2527c8dd3b70d2d21f38f199ff465b107cf034140b349961da19894abdb287ceafb7997dbcc8a4e89b0e319b21121d024'
32         'f7fc5aa67d59dfbf544ea2668a5df6449d1cb30f5adf1433d92ebbc0fd10d46fec592f1befe829e126d72240666b9c3ea1f69a9f2cca6f3f4e135a7e454be25d')
34 prepare() {
35   cd ${_pkgname}-${pkgver}
37   # fix tests
38   patch -Np1 -i ../uvicorn-test-server-use-h11.diff
40   # disable -Werror, which often causes failures due to newer dependencies in Arch
41   sed -i '/\berror\b/d' setup.cfg
44 build() {
45   cd ${_pkgname}-${pkgver}
47   python -m build --wheel --no-isolation
50 check() {
51   cd ${_pkgname}-${pkgver}
53   pytest
56 package() {
57   cd ${_pkgname}-${pkgver}
59   python -m installer --destdir="$pkgdir" dist/*.whl
60   install -Dm644 LICENSE.md "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.md