summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO24
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD72
-rw-r--r--config.sh1
-rw-r--r--test_redis_client.conf6
5 files changed, 108 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f35a9dbe8a8e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+pkgbase = python-aredis
+ pkgdesc = Redis client for Python asyncio (has support for redis server, sentinel and cluster)
+ pkgver = 1.1.8
+ pkgrel = 1
+ url = https://github.com/NoneGG/aredis
+ arch = x86_64
+ license = custom
+ checkdepends = python-pytest
+ checkdepends = python-pytest-asyncio
+ checkdepends = python-mock
+ checkdepends = redis
+ checkdepends = redis-create-cluster
+ checkdepends = python-contextvars
+ makedepends = python-setuptools
+ depends = python
+ source = https://files.pythonhosted.org/packages/source/a/aredis/aredis-1.1.8.tar.gz
+ source = test_redis_client.conf
+ source = config.sh
+ md5sums = 1ff3630906f395ddfef12b9dbf2b850e
+ md5sums = 1a8e476f369a657b1c41e56f8d3e8c5d
+ md5sums = 92fa2184a98d197b06996a91b543e3ee
+
+pkgname = python-aredis
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..3c52670f2ca2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.zst
+*.tar.gz
+*.log
+src/
+pkg/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7d99aba4f1a3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,72 @@
+# Maintainer: Yuuta Liang <yuuta@yuuta.moe>
+pkgname=python-aredis
+pkgver=1.1.8
+pkgrel=1
+epoch=
+pkgdesc="Redis client for Python asyncio (has support for redis server, sentinel and cluster)"
+arch=(x86_64)
+url="https://github.com/NoneGG/aredis"
+license=('custom')
+groups=()
+depends=('python')
+makedepends=('python-setuptools')
+checkdepends=(
+'python-pytest'
+'python-pytest-asyncio'
+'python-mock'
+'redis'
+'redis-create-cluster'
+'python-contextvars'
+)
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+_name=${pkgname#python-}
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz"
+"test_redis_client.conf"
+"config.sh")
+noextract=()
+md5sums=('1ff3630906f395ddfef12b9dbf2b850e'
+ '1a8e476f369a657b1c41e56f8d3e8c5d'
+ '92fa2184a98d197b06996a91b543e3ee')
+validpgpkeys=()
+
+prepare() {
+ cd "$_name-$pkgver"
+}
+
+build() {
+ cd "$_name-$pkgver"
+ python setup.py build
+}
+
+check() {
+ cd "$_name-$pkgver"
+ local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
+ redis-server ../test_redis_client.conf &
+ local _redis_pid=$!
+ echo Waiting 5s for redis-server to start...
+ sleep 5
+ PYTHONPATH="$PWD/build/lib.linux-$CARCH-${python_version}" pytest tests/client/
+ kill $_redis_pid
+
+ (cd ..; create-cluster start)
+ (cd ..; echo yes | create-cluster create)
+ echo Waiting 10s for the cluster to start...
+ sleep 10
+ PYTHONPATH="$PWD/build/lib.linux-$CARCH-${python_version}" pytest tests/cluster/
+ (cd ..; create-cluster stop)
+ (cd ..; create-cluster clean)
+}
+
+package() {
+ cd "$_name-$pkgver"
+ python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+ mkdir -p $pkgdir/usr/share/licenses/${pkgname}/
+ install -Dm644 LICENSE $pkgdir/usr/share/licenses/${pkgname}/
+}
diff --git a/config.sh b/config.sh
new file mode 100644
index 000000000000..ffc97e84df78
--- /dev/null
+++ b/config.sh
@@ -0,0 +1 @@
+PORT=6999
diff --git a/test_redis_client.conf b/test_redis_client.conf
new file mode 100644
index 000000000000..10192c75824c
--- /dev/null
+++ b/test_redis_client.conf
@@ -0,0 +1,6 @@
+bind 127.0.0.1 -::1
+port 6379
+daemonize no
+logfile "/dev/null"
+always-show-logo no
+save ""