This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 297
/
PKGBUILD
57 lines (51 loc) · 2.07 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
pkgname=python-anyio
# https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst
pkgver=3.6.2
pkgrel=4
pkgdesc='High level compatibility layer for multiple asynchronous event loop implementations'
arch=(any)
url='https://github.com/agronholm/anyio'
license=(MIT)
depends=(python python-idna python-sniffio)
makedepends=(python-build python-installer python-setuptools python-setuptools-scm python-wheel
python-uvloop python-trio)
checkdepends=(python-pytest python-trustme python-hypothesis python-pytest-mock)
optdepends=(
'python-trio: trio backend'
'python-outcome: trio backend'
'python-uvloop: use uvloop for asyncio backend'
'python-pytest: pytest plugin'
)
source=(https://github.com/agronholm/anyio/archive/$pkgver/anyio-$pkgver.tar.gz
$pkgname-553.patch)
sha256sums=('befe8a0e100f6a92ad1b15a6e4adc86bb5f1e055f09b125090300ade5b33534d'
'4d500b72e1c8669c8944ea4deb2bacecfb679f49efee054c49fc0ee7aea8f9df')
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
prepare() {
cd anyio-$pkgver
# Remove "error" from pytest filterwarnings
sed -i '/"error"/d' pyproject.toml
# XXX: Temporarily remove testing trio as a backend. anyio 3.x is known to be incompatible with trio >= 0.22
# https://github.com/agronholm/anyio/commit/787cb0c2e53c2a3307873d202fbd49dc5eac4e96
sed -i '/"trio"/d' tests/conftest.py
# Backported from https://github.com/agronholm/anyio/pull/553 (merged to git master)
patch -Np1 -i ../$pkgname-553.patch
}
build() {
cd anyio-$pkgver
python -m build --wheel --no-isolation
}
check() {
cd anyio-$pkgver
# Install to a temporary root as the test suite requires the entry point for
# its pytest plugin
pyver=$(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
python -m installer --destdir="$PWD/tmp_install" dist/*.whl
PYTHONPATH="$PWD/tmp_install/usr/lib/python$pyver/site-packages" pytest
}
package() {
cd anyio-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}