summaryrefslogtreecommitdiff
path: root/dev-python/raet
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
commitdeba8115d2c2af26df42966b91ef04ff4dd79cde (patch)
tree9a48f42594e1a9e6b2020d5535a784314434d7a7 /dev-python/raet
parent38423c67c8a23f6a1bc42038193182e2da3116eb (diff)
gentoo resync : 14.05.2020
Diffstat (limited to 'dev-python/raet')
-rw-r--r--dev-python/raet/Manifest2
-rw-r--r--dev-python/raet/files/raet-0.6.8-msgpack-1.0.patch128
-rw-r--r--dev-python/raet/raet-0.6.8-r1.ebuild41
3 files changed, 171 insertions, 0 deletions
diff --git a/dev-python/raet/Manifest b/dev-python/raet/Manifest
index 063fd4ab149e..831b4177536a 100644
--- a/dev-python/raet/Manifest
+++ b/dev-python/raet/Manifest
@@ -1,3 +1,5 @@
+AUX raet-0.6.8-msgpack-1.0.patch 8061 BLAKE2B 90607848542b8ba5a219a872f6f4f4e12546ebf12e1d38cfc3c3259282eda97a641fcfa587646e83ffa5e98d5cc3b0e77c032ebf2358a5cd603e2ac58ad9a114 SHA512 524e2c787386a885796a3666dff792d7e2808585658227acbab51c90c7ebfdfb0435ea67bcdc23e9be6b43364452e23a085d4843e4c1ee1dd576e140007c4293
DIST raet-0.6.8.tar.gz 807419 BLAKE2B 2370eb55b76a52cf89363f9891a411ea7fa2f27b84bd216c44010fd9afb5dcd9261570f916db00ff7bd922c485cd6123b3a6522154b6e05f7869d7e790177f7b SHA512 01279e7414ec3edc9f2bc0641cb9e0606ebf5700b5ce37a05fd5919f3274b3b43aad64110baf4c4b1fda3843cb1a87b6be4ab592a8f62e82b3a716a86ae61b20
+EBUILD raet-0.6.8-r1.ebuild 1031 BLAKE2B 515b36ef61938e7b35a296a5bc8d12e9646ce2b51ccd26b6a2b9c76385d5d43fec00e7892dff5c736192a9789a057642d4efb98010880629894e2d5f0b38ff93 SHA512 0b7ef5def4bc0305eeb44fd6b95647d2b3cd80377cbca68a0ce5aa2480611fd7759a43f7df54237939557a0ac9a635415cec1856cab44cd8c8442ed45998cf74
EBUILD raet-0.6.8.ebuild 908 BLAKE2B 3fc45741dc163e06dd450730feff0007ec21f88ae7dbb3c0dc653b93bcceea29b1d3aa7c34a572f0b28971dd7b8738693a22ae6b13610e978497c355b0ff2b6d SHA512 025be2d4a5b55ec054b60669c6ae02380b51fe3467670081502713fa36c81722720b760e49f7545137b826c969ab3b4a69919d307ea82a9817f23bbfdfbd7536
MISC metadata.xml 489 BLAKE2B f5c03c42cb002c7d6c81692f7f98312ad51a06e306a33b63cd048cbb25d0ef1429e5322bc5eb08de2d3d5a179a100f61c5e73d7f874a43e009eb0bcad8013e26 SHA512 0987a39737bc4556adf615ced4c1550f69fd952d32f5208b91763da8d23021fa88c5bfebe0f12fa382fad2a4066f68fe372c637389543a936dfc818f1de5f621
diff --git a/dev-python/raet/files/raet-0.6.8-msgpack-1.0.patch b/dev-python/raet/files/raet-0.6.8-msgpack-1.0.patch
new file mode 100644
index 000000000000..732d64091523
--- /dev/null
+++ b/dev-python/raet/files/raet-0.6.8-msgpack-1.0.patch
@@ -0,0 +1,128 @@
+From 34e87f76daff2b0c898ff544cddad04a46784dfe Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
+Date: Thu, 23 Apr 2020 19:06:54 +0200
+Subject: [PATCH] Make the package compatible with msgpack 1.0.0.
+
+Also, a wee bit of cleanup.
+---
+ raet/keeping.py | 4 ++--
+ raet/lane/paging.py | 8 +++-----
+ raet/road/packeting.py | 11 ++++-------
+ raet/road/test/test_packeting.py | 6 +++---
+ 4 files changed, 12 insertions(+), 17 deletions(-)
+
+diff --git a/raet/keeping.py b/raet/keeping.py
+index fad41b2..d7270d9 100644
+--- a/raet/keeping.py
++++ b/raet/keeping.py
+@@ -127,7 +127,7 @@ def dump(data, filepath):
+ raise raeting.KeepError("Invalid filepath ext '{0}' "
+ "needs msgpack installed".format(filepath))
+ with ocfn(filepath, "w+b", binary=True) as f:
+- msgpack.dump(data, f, encoding='utf-8')
++ msgpack.dump(data, f)
+ f.flush()
+ os.fsync(f.fileno())
+ else:
+@@ -154,7 +154,7 @@ def load(filepath):
+ raise raeting.KeepError("Invalid filepath ext '{0}' "
+ "needs msgpack installed".format(filepath))
+ with ocfn(filepath, "rb", binary=True) as f:
+- it = msgpack.load(f, object_pairs_hook=odict, encoding='utf-8')
++ it = msgpack.load(f, object_pairs_hook=odict)
+ else:
+ it = None
+ except EOFError:
+diff --git a/raet/lane/paging.py b/raet/lane/paging.py
+index eeff2b3..9a98af7 100644
+--- a/raet/lane/paging.py
++++ b/raet/lane/paging.py
+@@ -162,8 +162,7 @@ def pack(self):
+ if not msgpack:
+ emsg = "Msgpack not installed."
+ raise raeting.PacketError(emsg)
+- self.packed = msgpack.dumps(self.data,
+- encoding='utf-8')
++ self.packed = msgpack.dumps(self.data)
+ else:
+ emsg = "Unrecognized message pack kind '{0}'\n".format(pk)
+ console.terse(emsg)
+@@ -192,7 +191,7 @@ def parse(self):
+
+ if pk == PackKind.json:
+ if self.packed:
+- self.data = json.loads(self.packed.decode(encoding='utf-8'),
++ self.data = json.loads(self.packed.decode(),
+ object_pairs_hook=odict)
+ elif pk == PackKind.pack:
+ if self.packed:
+@@ -200,8 +199,7 @@ def parse(self):
+ emsg = "Msgpack not installed."
+ raise raeting.PacketError(emsg)
+ self.data = msgpack.loads(self.packed,
+- object_pairs_hook=odict,
+- encoding='utf-8')
++ object_pairs_hook=odict)
+
+ if not isinstance(self.data, Mapping):
+ emsg = "Message body not a mapping\n"
+diff --git a/raet/road/packeting.py b/raet/road/packeting.py
+index 918d479..33a7ac8 100644
+--- a/raet/road/packeting.py
++++ b/raet/road/packeting.py
+@@ -283,8 +283,7 @@ def pack(self):
+ if not msgpack:
+ emsg = "Msgpack not installed."
+ raise raeting.PacketError(emsg)
+- self.packed = msgpack.dumps(self.data,
+- encoding='utf-8')
++ self.packed = msgpack.dumps(self.data)
+ elif bk == BodyKind.raw:
+ self.packed = self.data # data is already formatted string
+
+@@ -308,9 +307,8 @@ def parse(self):
+
+ if bk == BodyKind.json:
+ if self.packed:
+- kit = json.loads(self.packed.decode(encoding='utf-8'),
+- object_pairs_hook=odict,
+- encoding='utf-8')
++ kit = json.loads(self.packed.decode(),
++ object_pairs_hook=odict)
+ if not isinstance(kit, Mapping):
+ emsg = "Packet body not a mapping."
+ raise raeting.PacketError(emsg)
+@@ -321,8 +319,7 @@ def parse(self):
+ emsg = "Msgpack not installed."
+ raise raeting.PacketError(emsg)
+ kit = msgpack.loads(self.packed,
+- object_pairs_hook=odict,
+- encoding='utf-8')
++ object_pairs_hook=odict)
+ if not isinstance(kit, Mapping):
+ emsg = "Packet body not a mapping."
+ raise raeting.PacketError(emsg)
+diff --git a/raet/road/test/test_packeting.py b/raet/road/test/test_packeting.py
+index da88c01..6089ffe 100644
+--- a/raet/road/test/test_packeting.py
++++ b/raet/road/test/test_packeting.py
+@@ -375,8 +375,8 @@ def testSegmentation(self):
+
+ tray0 = packeting.TxTray(stack=stack, data=data, body=stuff)
+ tray0.pack()
+- self.assertEquals(tray0.packed, b' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299')
+- self.assertEquals(len(tray0.packets), 2)
++ self.assertEqual(tray0.packed, b' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299')
++ self.assertEqual(len(tray0.packets), 2)
+
+ tray1 = packeting.RxTray(stack=stack)
+ for packet in tray0.packets:
+@@ -416,7 +416,7 @@ def testSegmentation(self):
+ 'fk': 0,
+ 'fl': 0,
+ 'fg': '08'})
+- self.assertEquals( tray1.body, stuff)
++ self.assertEqual( tray1.body, stuff)
+
+ class StackTestCase(unittest.TestCase):
+ '''
diff --git a/dev-python/raet/raet-0.6.8-r1.ebuild b/dev-python/raet/raet-0.6.8-r1.ebuild
new file mode 100644
index 000000000000..217a7b9449a8
--- /dev/null
+++ b/dev-python/raet/raet-0.6.8-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=(python3_{7,8})
+inherit distutils-r1
+
+DESCRIPTION="Reliable Asynchronous Event Transport Protocol"
+HOMEPAGE="https://github.com/RaetProtocol/raet"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND=">=dev-python/six-1.6.1[${PYTHON_USEDEP}]
+ >=dev-python/libnacl-1.4.3[${PYTHON_USEDEP}]
+ >=dev-python/ioflo-2.0[${PYTHON_USEDEP}]"
+BDEPEND="${RDEPEND}
+ test? (
+ dev-python/msgpack[${PYTHON_USEDEP}]
+ dev-python/unittest2[${PYTHON_USEDEP}]
+ )"
+
+PATCHES=(
+ # This is from https://github.com/RaetProtocol/raet/pull/14/
+ #${FILESDIR}/raet-0.6.8-msgpack-1.0.patch
+)
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+ sed -i -e "/setuptools_git/d" setup.py || die
+}
+
+python_test() {
+ pushd "${BUILD_DIR}"/lib || die
+ ${EPYTHON} ${PN}/test/__init__.py || die "tests failed for ${EPYTHON}"
+ popd || die
+}