diff options
| author | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
|---|---|---|
| committer | Palica <palica+gitlab@liguros.net> | 2020-06-23 22:35:08 +0200 |
| commit | ecdac123787b96ce6649f0f91da12ea6458cc2b1 (patch) | |
| tree | b89c74d9e6fe6e8aebc4c77bcbeb4ab73214127d /dev-python/raet | |
| parent | 1be72aa41cf41dedadeecf59dca9f01de6381f5e (diff) | |
| download | baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.gz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.tar.xz baldeagleos-repo-ecdac123787b96ce6649f0f91da12ea6458cc2b1.zip | |
Updating liguros repo
Diffstat (limited to 'dev-python/raet')
| -rw-r--r-- | dev-python/raet/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/raet/files/raet-0.6.8-msgpack-1.0.patch | 128 | ||||
| -rw-r--r-- | dev-python/raet/metadata.xml | 17 | ||||
| -rw-r--r-- | dev-python/raet/raet-0.6.8-r1.ebuild | 41 | ||||
| -rw-r--r-- | dev-python/raet/raet-0.6.8.ebuild | 34 |
5 files changed, 221 insertions, 0 deletions
diff --git a/dev-python/raet/Manifest b/dev-python/raet/Manifest new file mode 100644 index 000000000000..719ea8c1cbba --- /dev/null +++ b/dev-python/raet/Manifest @@ -0,0 +1 @@ +DIST raet-0.6.8.tar.gz 807419 BLAKE2B 2370eb55b76a52cf89363f9891a411ea7fa2f27b84bd216c44010fd9afb5dcd9261570f916db00ff7bd922c485cd6123b3a6522154b6e05f7869d7e790177f7b SHA512 01279e7414ec3edc9f2bc0641cb9e0606ebf5700b5ce37a05fd5919f3274b3b43aad64110baf4c4b1fda3843cb1a87b6be4ab592a8f62e82b3a716a86ae61b20 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/metadata.xml b/dev-python/raet/metadata.xml new file mode 100644 index 000000000000..0989e327a18e --- /dev/null +++ b/dev-python/raet/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>chutzpah@gentoo.org</email> + <name>Patrick McLean</name> + </maintainer> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> + <upstream> + <remote-id type="pypi">raet</remote-id> + <remote-id type="github">saltstack/raet</remote-id> + </upstream> + <origin>gentoo-staging</origin> +</pkgmetadata> 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..4ceac99cd6ad --- /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 +} diff --git a/dev-python/raet/raet-0.6.8.ebuild b/dev-python/raet/raet-0.6.8.ebuild new file mode 100644 index 000000000000..c0717ce6d463 --- /dev/null +++ b/dev-python/raet/raet-0.6.8.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +PYTHON_COMPAT=(python3_6) +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-1.5[${PYTHON_USEDEP}]" +DEPEND="${RDEPEND} + dev-python/setuptools[${PYTHON_USEDEP}] + test? ( dev-python/unittest2[${PYTHON_USEDEP}] )" + +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 +} |
