ilot/py3-testing-common-fatabase: new aport
This commit is contained in:
parent
ddcd833b5a
commit
23492e9b4d
2 changed files with 74 additions and 0 deletions
|
@ -0,0 +1,37 @@
|
|||
From fa31191abe883d0ddc2a441550eeacc4126c85cb Mon Sep 17 00:00:00 2001
|
||||
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||
Date: Sat, 18 Dec 2021 10:32:19 -0500
|
||||
Subject: [PATCH] Support Callable in collections.abc
|
||||
|
||||
The abstract base classes are available here in Python 3.3+, and
|
||||
in current Python versions they are no longer available directly
|
||||
in collections.
|
||||
---
|
||||
src/testing/common/database.py | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/testing/common/database.py b/src/testing/common/database.py
|
||||
index 5ba8c5e..74e1067 100644
|
||||
--- a/src/testing/common/database.py
|
||||
+++ b/src/testing/common/database.py
|
||||
@@ -23,7 +23,10 @@
|
||||
from time import sleep
|
||||
from shutil import copytree, rmtree
|
||||
from datetime import datetime
|
||||
-import collections
|
||||
+try:
|
||||
+ from collections.abc import Callable
|
||||
+except ImportError:
|
||||
+ from collections import Callable
|
||||
|
||||
|
||||
class DatabaseFactory(object):
|
||||
@@ -285,7 +288,7 @@ def decorator(fn, path=arg):
|
||||
|
||||
return skipIf(cond, "%s not found" % self.name)(fn)
|
||||
|
||||
- if isinstance(arg, collections.Callable): # execute as simple decorator
|
||||
+ if isinstance(arg, Callable): # execute as simple decorator
|
||||
return decorator(arg, None)
|
||||
else: # execute with path argument
|
||||
return decorator
|
37
ilot/py3-testing-common-database/APKBUILD
Normal file
37
ilot/py3-testing-common-database/APKBUILD
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=py3-testing-common-database
|
||||
#_pkgreal is used by apkbuild-pypi to find modules at PyPI
|
||||
_pkgreal=testing.common.database
|
||||
pkgver=2.0.3
|
||||
pkgrel=0
|
||||
pkgdesc="testing.common.database is utilities for testing.* package."
|
||||
url="https://pypi.python.org/project/pyrad"
|
||||
arch="noarch"
|
||||
license="BSD-3-Clause"
|
||||
depends="python3"
|
||||
checkdepends="py3-unittest2"
|
||||
makedepends="py3-setuptools py3-gpep517 py3-wheel"
|
||||
source="
|
||||
$pkgname-$pkgver.tar.gz::https://github.com/tk0miya/testing.common.database/archive/refs/tags/$pkgver.tar.gz
|
||||
25_support-callable-in-collections.patch
|
||||
"
|
||||
options="!check" # No testsuite
|
||||
builddir="$srcdir/$_pkgreal-$pkgver"
|
||||
subpackages="$pkgname-pyc"
|
||||
|
||||
build() {
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
package() {
|
||||
python3 -m installer -d "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
d63df9a16ca518645f53516f4ab1c8e3bd539cd3d60471678c1b2dbe1b33a84587a93ae095bd0e46157581139921b3865b3ce5eb25efcefdf05cf65a6947f33c py3-testing-common-database-2.0.3.tar.gz
|
||||
3ccb5977103d5703887cbddf58a70dfb262cc233c06e60b61178ca85fa69851fedc7c110141e3e98f838a38911fcf151b64e60224d9aff3ddf46849db4d81de3 25_support-callable-in-collections.patch
|
||||
"
|
Loading…
Add table
Reference in a new issue