Subject: [alpine-aports] [PATCH 1/3] New aport: testing/py-sh

From: Marian Buschsieweke <[email-masked]>
Date: Tue, 16 Oct 2018 16:03:31 +0200

Call any program from python as if it were a function
https://github.com/amoffat/sh
---
 testing/py-sh/APKBUILD | 51 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 testing/py-sh/APKBUILD

diff --git a/testing/py-sh/APKBUILD b/testing/py-sh/APKBUILD
new file mode 100644
index 0000000000..9a6c7cf5a4
--- /dev/null
+++ b/testing/py-sh/APKBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Marian Buschsieweke <[email-masked]>
+pkgname=py-sh
+_pkgname="${pkgname#py-}"
+pkgver=1.12.14
+pkgrel=0
+pkgdesc="Call any program from python as if it were a function"
+url="https://github.com/amoffat/sh"
+arch="noarch"
+license="MIT"
+makedepends="py-setuptools python2-dev python3-dev"
+# Units rely on peculiarities of the "real" core utils
+checkdepends="py-coverage coreutils"
+subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3"
+source="$_pkgname-$pkgver.tar.gz::https://github.com/amoffat/$_pkgname/archive/$pkgver.tar.gz"
+builddir="$srcdir"/$_pkgname-$pkgver
+
+build() {
+	cd "$builddir"
+	python2 setup.py build
+	python3 setup.py build
+}
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	_py python2
+}
+
+_py3() {
+	_py python3
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+	cd "$builddir"
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+check() {
+	cd "$builddir"
+	python2 setup.py test
+	python3 setup.py test
+}
+
+sha512sums="a20abed5c84430e413c885eb616e69c66b2f9487c49b483ef4f7af6af01954b5ca9da0e6bdf6d1fc0cf97efbc84721fafef0a1e0e2d0c39756a3d4ef2612f64a  sh-1.12.14.tar.gz"
-- 
2.19.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Marian Buschsieweke <[email-masked]>
Date: Tue, 16 Oct 2018 16:03:32 +0200

Get and set values in your .env file in local and production servers
https://github.com/theskumar/python-dotenv
---
 testing/py-dotenv/APKBUILD | 52 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 testing/py-dotenv/APKBUILD

diff --git a/testing/py-dotenv/APKBUILD b/testing/py-dotenv/APKBUILD
new file mode 100644
index 0000000000..5d03271311
--- /dev/null
+++ b/testing/py-dotenv/APKBUILD
@@ -0,0 +1,52 @@
+# Maintainer: Marian Buschsieweke <[email-masked]>
+pkgname=py-dotenv
+_pkgname="python-${pkgname#py-}"
+pkgver=0.9.1
+pkgrel=0
+pkgdesc="Get and set values in your .env file in local and production servers"
+url="https://github.com/theskumar/python-dotenv"
+arch="noarch"
+license="BSD-3-Clause"
+makedepends="py-setuptools python2-dev python3-dev"
+checkdepends="pytest py-sh ipython"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+source="$_pkgname-$pkgver.tar.gz::https://github.com/theskumar/$_pkgname/archive/v$pkgver.tar.gz"
+builddir="$srcdir"/$_pkgname-$pkgver
+
+build() {
+	cd "$builddir"
+	python2 setup.py build
+	python3 setup.py build
+}
+
+package() {
+	mkdir -p "$pkgdir"
+}
+
+_py2() {
+	_py python2
+}
+
+_py3() {
+	_py python3
+}
+
+_py() {
+	local python="$1"
+	pkgdesc="$pkgdesc (for $python)"
+	depends="$depends $python"
+	install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+	cd "$builddir"
+	$python setup.py install --prefix=/usr --root="$subpkgdir"
+}
+
+check() {
+	cd "$builddir"
+	# Python2 test requires ipython version for Python2, which is not packed
+	# yet. The motivation to package it for an obsolete version of Python is not
+	# big enough.
+	python3 setup.py test
+}
+
+sha512sums="11f5f3f07b7673d2c78cb0d73594a640789b0cb973c0b5326a317cd4e8cec062f1d2a513b9acd119679d64b9ed6c6812715c23766e41a0f8b40721bfce1aacda  python-dotenv-0.9.1.tar.gz"
-- 
2.19.1

---

---

From: Marian Buschsieweke <[email-masked]>
Date: Tue, 16 Oct 2018 16:03:33 +0200

---
 testing/ampy/APKBUILD | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/testing/ampy/APKBUILD b/testing/ampy/APKBUILD
index 6298668ce5..6752037b35 100644
--- a/testing/ampy/APKBUILD
+++ b/testing/ampy/APKBUILD
@@ -1,19 +1,18 @@
 # Maintainer: Marian Buschsieweke <[email-masked]>
 pkgname=ampy
-pkgver=0.20171212
+pkgver=1.0.5
 pkgrel=0
 pkgdesc="Utility to interact with a MicroPython board over a serial connection"
 url="https://github.com/adafruit/ampy"
 arch="noarch"
 license="MIT"
-depends="python3 py3-serial py3-click py-setuptools"
-makedepends="python3-dev"
+depends="python3 py3-serial py3-click py3-dotenv"
+makedepends="python3-dev py-setuptools"
 install=""
 subpackages="$pkgname-doc"
-_commit="d3df5f57398c581f8a6c1b930b740fd7060e6833"
-source="https://github.com/adafruit/${pkgname}/archive/${_commit}/master.tar.gz"
+source="${pkgname}-${pkgver}.tar.gz::https://github.com/adafruit/${pkgname}/archive/${pkgver}.tar.gz"
 
-builddir="${srcdir}/${pkgname}-${_commit}"
+builddir="${srcdir}/${pkgname}-${pkgver}"
 
 prepare() {
 	cd "$builddir"
@@ -35,4 +34,4 @@ package() {
 		"$pkgdir"/usr/share/doc/$pkgname/ || return 1
 }
 
-sha512sums="b075745030e924be6bc0eb83fbb2960f27932dd44399a8fe6ce1e54bfbb2bdeba9c159db1add337023327a86ca3808479873afc92ff99b9c024e244cb53bafd5  master.tar.gz"
+sha512sums="e20adc957db6756352faa221ad33633d2550784734c25dae6f10aca217f9a4f2ba07a563ed70aebc158efa60d8295f1df4fd81e9be1487043474fc82a09e4856  ampy-1.0.5.tar.gz"
-- 
2.19.1

---

---

From: Leonardo Arena <[email-masked]>
Date: Thu, 18 Oct 2018 11:05:49 +0200

Hi,

>  create mode 100644 testing/py-sh/APKBUILD

it fails for me with:

======================================================================
FAIL: test_no_fd_leak (test.MiscTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/larena/aports/testing/py-sh/src/sh-1.12.14/test.py", line
2715, in test_no_fd_leak
    self.assertEqual(baseline, num_fds)
AssertionError: 920 != 919

----------------------------------------------------------------------
Ran 156 tests in 38.952s

FAILED (failures=1, skipped=3)
Test failed: <unittest.runner.TextTestResult run=156 errors=0 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=156 errors=0
failures=1>

Thanks!

/eo