aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJean-Louis Fuchs <ganwell@fangorn.ch>2017-09-18 19:43:17 +0200
committerLeonardo Arena <rnalrd@alpinelinux.org>2017-11-02 13:09:34 +0000
commitf428844e1dfa4cac5ffa37cbed9c2b522f347188 (patch)
treea6c180ef9c8ea276b4e40b54212275007a979b28 /testing
parent07cf6b14f3e2e3e143b8f6c6c5bb5d06d737d6e0 (diff)
downloadaports-f428844e1dfa4cac5ffa37cbed9c2b522f347188.tar.bz2
aports-f428844e1dfa4cac5ffa37cbed9c2b522f347188.tar.xz
testing/py3-attrs: new aport
Diffstat (limited to 'testing')
-rw-r--r--testing/py3-attrs/APKBUILD29
-rw-r--r--testing/py3-attrs/check.py10
2 files changed, 39 insertions, 0 deletions
diff --git a/testing/py3-attrs/APKBUILD b/testing/py3-attrs/APKBUILD
new file mode 100644
index 0000000000..80a9d31c68
--- /dev/null
+++ b/testing/py3-attrs/APKBUILD
@@ -0,0 +1,29 @@
+# Contributor: Jean-Louis Fuchs <ganwell@fangorn.ch>
+# Maintainer: Jean-Louis Fuchs <ganwell@fangorn.ch>
+pkgname=py3-attrs
+pkgver=17.2.0
+pkgrel=0
+pkgdesc="Python classes without boilerplate"
+url="http://www.attrs.org"
+arch="noarch"
+license="MIT"
+depends="python3"
+makedepends="python3-dev py3-pytest"
+source="py3-attrs-$pkgver.tar.gz::https://github.com/python-attrs/attrs/archive/$pkgver.tar.gz"
+builddir="$srcdir/attrs-$pkgver"
+
+build() {
+ cd "$builddir"
+ python3 setup.py build
+}
+
+check() {
+ PYTHONPATH="$builddir/src" python3 check.py
+}
+
+package() {
+ cd "$builddir"
+ python3 setup.py install --prefix=/usr --root="$pkgdir"
+}
+
+sha512sums="0084f115d8013e63bd81118a9f4d7a5e9c0b398a1ca8596d81fa00db17b2c241243026ccc7a5af579aba1aa53027cabfa2ae8610ac310e7f037f7b0ef2b15542 py3-attrs-17.2.0.tar.gz"
diff --git a/testing/py3-attrs/check.py b/testing/py3-attrs/check.py
new file mode 100644
index 0000000000..08af9829fb
--- /dev/null
+++ b/testing/py3-attrs/check.py
@@ -0,0 +1,10 @@
+import attr
+
+@attr.s
+class SomeClass(object):
+ a_number = attr.ib(default=42)
+ list_of_numbers = attr.ib(default=attr.Factory(list))
+
+a = SomeClass()
+assert a.a_number == 42
+assert isinstance(a.list_of_numbers, list)