aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-attrs
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-09-04 14:47:46 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-09-04 15:28:09 +0000
commit81d9960974d3af2e1c321cb3bd1aea5ac21be735 (patch)
tree30175adce772e53d758de41fc4412edfd43e2b34 /main/py-attrs
parentcb28661eef6ff2d1fce93344220d69b340e8b759 (diff)
downloadaports-81d9960974d3af2e1c321cb3bd1aea5ac21be735.tar.bz2
aports-81d9960974d3af2e1c321cb3bd1aea5ac21be735.tar.xz
main/py-attrs: move from community due to fuse3
Diffstat (limited to 'main/py-attrs')
-rw-r--r--main/py-attrs/APKBUILD51
-rw-r--r--main/py-attrs/check.py10
2 files changed, 61 insertions, 0 deletions
diff --git a/main/py-attrs/APKBUILD b/main/py-attrs/APKBUILD
new file mode 100644
index 0000000000..3fa38ef911
--- /dev/null
+++ b/main/py-attrs/APKBUILD
@@ -0,0 +1,51 @@
+# Contributor: Jean-Louis Fuchs <ganwell@fangorn.ch>
+# Maintainer: Jean-Louis Fuchs <ganwell@fangorn.ch>
+pkgname=py-attrs
+pkgver=18.1.0
+pkgrel=0
+pkgdesc="Python classes without boilerplate"
+url="http://www.attrs.org"
+arch="noarch"
+license="MIT"
+makedepends="python3-dev python2-dev py2-setuptools"
+subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
+source="py-attrs-$pkgver.tar.gz::https://github.com/python-attrs/attrs/archive/$pkgver.tar.gz"
+builddir="$srcdir/attrs-$pkgver"
+
+build() {
+ cd "$builddir"
+ python2 setup.py build
+ python3 setup.py build
+}
+
+check() {
+ PYTHONPATH="$builddir/src" python2 check.py
+ PYTHONPATH="$builddir/src" python3 check.py
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc ($python)"
+ depends="$depends $python"
+ provides="$pkgname-tools"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+sha512sums="89fb46c03459457f0d25616b10f9d2f28670d676b54484090c5d974a7c801f3a14a65922f2fbc85dc0d54e222a8da7dc08ab1266f234cb20146bb4ad10d55f4a py-attrs-18.1.0.tar.gz"
diff --git a/main/py-attrs/check.py b/main/py-attrs/check.py
new file mode 100644
index 0000000000..08af9829fb
--- /dev/null
+++ b/main/py-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)