summaryrefslogtreecommitdiff
path: root/dev-python/u-msgpack
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/u-msgpack
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/u-msgpack')
-rw-r--r--dev-python/u-msgpack/Manifest4
-rw-r--r--dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch60
-rw-r--r--dev-python/u-msgpack/metadata.xml27
-rw-r--r--dev-python/u-msgpack/u-msgpack-2.4.1.ebuild31
4 files changed, 122 insertions, 0 deletions
diff --git a/dev-python/u-msgpack/Manifest b/dev-python/u-msgpack/Manifest
new file mode 100644
index 000000000000..229458dd66f2
--- /dev/null
+++ b/dev-python/u-msgpack/Manifest
@@ -0,0 +1,4 @@
+AUX u-msgpack-2.4.1-little-endian.patch 2129 BLAKE2B d7bd75e409753dedc3e1e7ce984fd2401cb8dff71af6b3da90950b00ea7f2af35f8d3b87af0fa333b61f916bd904934ee5ca09a124bf17a4099f334afe76203a SHA512 978c6eede0b89238134b31b596f9e0fd87d31431fd95d9f44578bb782b17fe8c39fea20bd494581a633219f8137c23156d5bbc454040c137552c7a72901525b5
+DIST u-msgpack-2.4.1.tar.gz 12026 BLAKE2B d8f9c5558daba3afda53c4c1b8e10edd6baa08a58c82796171ae0752c10c638b76abc608349e2ba090e83b2df66611a5c0c03febd38c2a13c45fb617b6bcf74f SHA512 4c3edb72455e8eb8fa7a4ed9b6ef4461755b782391f2c362d52d0fafda3e790fb40d0d239d05ba99beb3ad4cfd9e200175e2a1917cd64ee1e5d8cc3c4e8b3f25
+EBUILD u-msgpack-2.4.1.ebuild 827 BLAKE2B 3b2c3f165ed02e26a26c58af2b7f3f52305d70cd46fa5e1174bc8b39f43d34d546b3d5f6252c8a75bc00651cae5588ebb7fe7167954087701a198b0be097a625 SHA512 e7493bf54356274dae79c64a3f582726fe1e8d48ff161282c120a6dfca2654a28c0996d6d024aa2fdb28e3949016dc421a852b0aece70b78adb8bb19502a152b
+MISC metadata.xml 985 BLAKE2B 6c8134062eec629a9e15fe23321a10d4248f00fd92cf14d43d35395b29970c7668661500dff63f3f004925d2b00d0dc8fe91487d3a056a77b7b2f1f3a33d5d91 SHA512 642fd0a2bed62a5218a3f2765f51f7e221ab57850d03a03f018ffbe1469705e34884b82c51958bc83c4fb722f00b818fcfd85df0366eee2c0550a58d0fbe91a8
diff --git a/dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch b/dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch
new file mode 100644
index 000000000000..c04aca3a3574
--- /dev/null
+++ b/dev-python/u-msgpack/files/u-msgpack-2.4.1-little-endian.patch
@@ -0,0 +1,60 @@
+https://github.com/vsergeev/u-msgpack-python/pull/31
+
+From 003289878812c63ef046dc7090953b8dde784f8c Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Fri, 22 Sep 2017 12:09:30 +0100
+Subject: [PATCH] test_umsgpack.py: fix test on big-endian platforms
+
+On powerpc and powerpc64 one test fails as:
+
+```
+ $ py.test -v
+ ...
+ test_umsgpack.py::TestUmsgpack::test_pack_ext_handler FAILED
+ test_umsgpack.py::TestUmsgpack::test_unpack_ext_handler FAILED
+ ...
+
+ self = <test_umsgpack.TestUmsgpack testMethod=test_pack_ext_handler>
+
+ def test_pack_ext_handler(self):
+ for (name, obj, data) in ext_handlers_test_vectors:
+ obj_repr = repr(obj)
+ print("\tTesting %s: object %s" %
+ (name, obj_repr if len(obj_repr) < 24 else obj_repr[0:24] + "..."))
+ packed = umsgpack.packb(obj, ext_handlers=ext_handlers)
+ > self.assertEqual(packed, data)
+ E AssertionError: b'\xd7 ?\x80\x00\x00@\x00\x00\x00' != b'\xd7 \x00\x00\x80?\x00\x00\x00@'
+
+ test_umsgpack.py:484: AssertionError
+```
+
+The problem here is in 'struct.pack' output:
+it uses native endianness format but test hardcodes little-endian output.
+
+The change forces 'struct.pack' into little-endian format.
+That way all tests pass:.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ test_umsgpack.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/test_umsgpack.py b/test_umsgpack.py
+index a25b5b8..e500276 100644
+--- a/test_umsgpack.py
++++ b/test_umsgpack.py
+@@ -297,9 +297,9 @@ float_precision_test_vectors = [
+ CustomType = namedtuple('CustomType', ['x', 'y', 'z'])
+
+ ext_handlers = {
+- complex: lambda obj: umsgpack.Ext(0x20, struct.pack("ff", obj.real, obj.imag)),
++ complex: lambda obj: umsgpack.Ext(0x20, struct.pack("<ff", obj.real, obj.imag)),
+ CustomType: lambda obj: umsgpack.Ext(0x30, umsgpack.packb(list(obj))),
+- 0x20: lambda ext: complex(*struct.unpack("ff", ext.data)),
++ 0x20: lambda ext: complex(*struct.unpack("<ff", ext.data)),
+ 0x30: lambda ext: CustomType(*umsgpack.unpackb(ext.data)),
+ }
+
+--
+2.14.1
+
diff --git a/dev-python/u-msgpack/metadata.xml b/dev-python/u-msgpack/metadata.xml
new file mode 100644
index 000000000000..7115811532f0
--- /dev/null
+++ b/dev-python/u-msgpack/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>dolsen@gentoo.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>vsergeev@gmail.com</email>
+ <name>Vanya Sergeev</name>
+ </maintainer>
+ <remote-id type="pypi">u-msgpack-python</remote-id>
+ <remote-id type="github">vsergeev/u-msgpack-python</remote-id>
+ </upstream>
+ <longdescription>
+ u-msgpack-python is a lightweight MessagePack serializer and
+ deserializer module written in pure Python, compatible with both Python
+ 2 and Python 3, as well as CPython and PyPy implementations of Python.
+ u-msgpack-python is fully compliant with the latest MessagePack
+ specification. In particular, it supports the new binary, UTF-8 string,
+ and application-defined ext types
+ </longdescription>
+</pkgmetadata>
diff --git a/dev-python/u-msgpack/u-msgpack-2.4.1.ebuild b/dev-python/u-msgpack/u-msgpack-2.4.1.ebuild
new file mode 100644
index 000000000000..6f0bb2d1b085
--- /dev/null
+++ b/dev-python/u-msgpack/u-msgpack-2.4.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
+
+inherit distutils-r1
+
+MY_PN="${PN}-python"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="A portable, lightweight MessagePack serializer and deserializer"
+HOMEPAGE="https://github.com/vsergeev/u-msgpack-python https://pypi.org/project/u-msgpack-python/"
+SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ~ppc ~ppc64 sparc x86 ~amd64-fbsd"
+IUSE="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=("${FILESDIR}"/${P}-little-endian.patch)
+
+python_test() {
+ py.test -v || die "Tests fail with ${EPYTHON}"
+}