aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-07-25 10:46:38 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-07-25 10:46:42 +0000
commit1e181ceecc038401318c4b15529125f7ef6c8c60 (patch)
tree0c6c393ff15ddcb1d5a66e9fa690316307410a40 /testing
parentfe78dda2445239074ee1e7e47e0b8bd2a7bd1604 (diff)
downloadaports-1e181ceecc038401318c4b15529125f7ef6c8c60.tar.bz2
aports-1e181ceecc038401318c4b15529125f7ef6c8c60.tar.xz
testing/py-future: added support for python3.5, created subpackages for python2 and python3
Diffstat (limited to 'testing')
-rw-r--r--testing/py-future/APKBUILD44
-rw-r--r--testing/py-future/re-enable-python3-5.patch113
2 files changed, 148 insertions, 9 deletions
diff --git a/testing/py-future/APKBUILD b/testing/py-future/APKBUILD
index fefc29ec39..8c1ca24dbf 100644
--- a/testing/py-future/APKBUILD
+++ b/testing/py-future/APKBUILD
@@ -3,28 +3,54 @@
pkgname=py-future
_pkgname=python-future
pkgver=0.15.2
-pkgrel=0
+pkgrel=1
pkgdesc="Easy, clean, reliable Python 2/3 compatibility"
url="http://python-future.org/"
arch="noarch"
license="MIT"
depends=""
-makedepends="python-dev py-setuptools"
+makedepends="python-dev python3-dev py-setuptools"
install=""
-subpackages=""
-source="$pkgname-$pkgver.tar.gz::https://github.com/PythonCharmers/$_pkgname/archive/v$pkgver.tar.gz"
+subpackages="py3-${_pkgname/python-/}:_py3 py2-${_pkgname/python-/}:_py2"
+source="$pkgname-$pkgver.tar.gz::https://github.com/PythonCharmers/$_pkgname/archive/v$pkgver.tar.gz
+ re-enable-python3-5.patch"
builddir="$srcdir/$_pkgname-$pkgver"
build() {
cd "$builddir"
- python setup.py build || return 1
+ python2 setup.py build || return 1
+ python3 setup.py build || return 1
}
package() {
cd "$builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ python2 setup.py install --root=$pkgdir/ --optimize=1 || return 1
+ python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
install -Dm0644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE.txt
}
-md5sums="4718b2e0aa11bf12e3fd6aacea6ee48d py-future-0.15.2.tar.gz"
-sha256sums="a37560f258f1d55e17ab699e9ba3d513c509fbe6b6b3778dcf519abc8a0ca66e py-future-0.15.2.tar.gz"
-sha512sums="96365f3c97f801e045d0957509ce05269e72f411202e4af0f9ddff08e5d385e25d73c9a5ad3080d157fd9fed65483a2a355f05d75ab15b19c4777e93c180f70b py-future-0.15.2.tar.gz"
+
+_py() {
+ local python=$1
+ pkgdesc="$pkgdesc - $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+ local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')
+
+ mkdir -p "$subpkgdir"${dir}
+ mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
+}
+
+_py2() {
+ _py python2
+ replaces="$pkgname"
+}
+
+_py3() {
+ _py python3
+}
+
+md5sums="4718b2e0aa11bf12e3fd6aacea6ee48d py-future-0.15.2.tar.gz
+53ea1810e7145ceac4c985c3d0ded09c re-enable-python3-5.patch"
+sha256sums="a37560f258f1d55e17ab699e9ba3d513c509fbe6b6b3778dcf519abc8a0ca66e py-future-0.15.2.tar.gz
+b77830990d4e7ae8811e833a6fd1b91040601a0c413a90d652277d93507352fc re-enable-python3-5.patch"
+sha512sums="96365f3c97f801e045d0957509ce05269e72f411202e4af0f9ddff08e5d385e25d73c9a5ad3080d157fd9fed65483a2a355f05d75ab15b19c4777e93c180f70b py-future-0.15.2.tar.gz
+59e2087d26d3cab859751b82a22158c085d596336066741e97bf41a905dbab04258a1c9cfb4daf9e85ce9a7721d43cb13bc87a7d740a15360e9e94fd657039fd re-enable-python3-5.patch"
diff --git a/testing/py-future/re-enable-python3-5.patch b/testing/py-future/re-enable-python3-5.patch
new file mode 100644
index 0000000000..a5f6fecd6b
--- /dev/null
+++ b/testing/py-future/re-enable-python3-5.patch
@@ -0,0 +1,113 @@
+From ad0ea5e11a329a1070461b4d611a34ba702a93b8 Mon Sep 17 00:00:00 2001
+From: py <pengyu.py@gmail.com>
+Date: Mon, 4 Jul 2016 11:04:26 +0800
+Subject: [PATCH 1/2] Revert "Revert "Enable Py3.5 tests on Travis and add
+ Py3.5 trove classifier to setup.py""
+
+Travis-CI supports Py3.5 now.
+
+This reverts commit 6caac864d578c378479e0f2b8d78d6b3ba115075.
+---
+ .travis.yml | 1 +
+ setup.py | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/.travis.yml b/.travis.yml
+index 6e20573..da167c1 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -1,6 +1,7 @@
+ language: python
+
+ python:
++ - "3.5"
+ - "3.4"
+ - "3.3"
+ - "2.7"
+diff --git a/setup.py b/setup.py
+index 7c81a09..79b7125 100755
+--- a/setup.py
++++ b/setup.py
+@@ -106,6 +106,7 @@
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.3",
+ "Programming Language :: Python :: 3.4",
++ "Programming Language :: Python :: 3.5",
+ "License :: OSI Approved",
+ "License :: OSI Approved :: MIT License",
+ "Development Status :: 4 - Beta",
+
+From 0c2c021a935489bed280e37442ec2d3f79241d1a Mon Sep 17 00:00:00 2001
+From: py <pengyu.py@gmail.com>
+Date: Mon, 4 Jul 2016 11:17:54 +0800
+Subject: [PATCH 2/2] pep461 should pass under py35
+
+revert d141ee8953e9995d0bc6ed84d073db2fa2a0eee8
+---
+ tests/test_future/test_bytes.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/tests/test_future/test_bytes.py b/tests/test_future/test_bytes.py
+index f30e740..4ca5d40 100644
+--- a/tests/test_future/test_bytes.py
++++ b/tests/test_future/test_bytes.py
+@@ -7,6 +7,8 @@
+ from future.builtins import *
+ from future import utils
+
++import sys
++
+ from numbers import Integral
+ from future.tests.base import unittest, expectedFailurePY2
+
+@@ -534,13 +536,14 @@ def test_maketrans(self):
+ self.assertRaises(ValueError, bytes.maketrans, b'abc', b'xyzq')
+ self.assertRaises(TypeError, bytes.maketrans, 'abc', 'def')
+
+- @unittest.expectedFailure
+ def test_mod(self):
+ """
+ From Py3.5 test suite (post-PEP 461).
+
+ The bytes mod code is in _PyBytes_Format() in bytesobject.c in Py3.5.
+ """
++ if sys.version_info[:2] < (3, 5):
++ return
+ b = b'hello, %b!'
+ orig = b
+ b = b % b'world'
+@@ -551,13 +554,12 @@ def test_mod(self):
+ a = b % (b'seventy-nine', 79)
+ self.assertEqual(a, b'seventy-nine / 100 = 79%')
+
+- @unittest.expectedFailure
+ def test_imod(self):
+ """
+ From Py3.5 test suite (post-PEP 461)
+ """
+- # if (3, 0) <= sys.version_info[:2] < (3, 5):
+- # raise unittest.SkipTest('bytes % not yet implemented on Py3.0-3.4')
++ if sys.version_info[:2] < (3, 5):
++ return
+ b = bytes(b'hello, %b!')
+ orig = b
+ b %= b'world'
+diff --git a/setup.py b/setup.py
+index 79b7125..58ba534 100755
+--- a/setup.py
++++ b/setup.py
+@@ -147,14 +147,6 @@ try:
+ 'xmlrpc'
+ ])
+
+- if sys.version_info[0] >= 3:
+- # Do any of the above folders exist in build/lib?
+- files = os.listdir(os.path.join('build', 'lib'))
+- if len(set(files) & set(SYSTEM_MODULES)) > 0:
+- print('ERROR: Your build folder is in an inconsistent state for '
+- 'a Python 3.x install. Please remove it manually and run '
+- 'setup.py again.', file=sys.stderr)
+- sys.exit(1)
+ except OSError:
+ pass
+