commit:     ad9db813692e18f42f67db25f114bb1f7a7a10df
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 29 22:02:53 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Nov 30 00:08:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad9db813

dev-python/boltons: initial import, 21.0.0

For removing test network restrictions on dev-util/maturin

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-python/boltons/Manifest                        |   1 +
 dev-python/boltons/boltons-21.0.0.ebuild           |  25 +++++
 .../boltons/files/boltons-21.0.0-python3.10.patch  | 110 +++++++++++++++++++++
 dev-python/boltons/metadata.xml                    |  13 +++
 4 files changed, 149 insertions(+)

diff --git a/dev-python/boltons/Manifest b/dev-python/boltons/Manifest
new file mode 100644
index 000000000000..21f53da6a6cf
--- /dev/null
+++ b/dev-python/boltons/Manifest
@@ -0,0 +1 @@
+DIST boltons-21.0.0.tar.gz 241010 BLAKE2B 
e8c7cba3aadc40fbf40b784c8060d7b4f9d89457a4416c8fe9c733c3a35cf292609b2cc4e43e20a1308add6b854c3e00cb55274328a14699b3c704b73c189318
 SHA512 
5f5d642ab8ce0bc26133f4bd5059071bc86ca8e6619ebac796d522a0e4c39b958176ccc9de9a56e0448b24bdcf569e73f51011d5a9fc875bdef12a363f106018

diff --git a/dev-python/boltons/boltons-21.0.0.ebuild 
b/dev-python/boltons/boltons-21.0.0.ebuild
new file mode 100644
index 000000000000..fc517a50cd75
--- /dev/null
+++ b/dev-python/boltons/boltons-21.0.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit distutils-r1
+
+DESCRIPTION="Pure-python utilities in the same spirit as the standard library"
+HOMEPAGE="https://boltons.readthedocs.org/";
+SRC_URI="https://github.com/mahmoud/boltons/archive/refs/tags/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+distutils_enable_tests pytest
+distutils_enable_sphinx docs \
+       dev-python/sphinx_rtd_theme
+
+DOCS=( CHANGELOG.md README.md TODO.rst )
+
+PATCHES=(
+       "${FILESDIR}"/${P}-python3.10.patch
+)

diff --git a/dev-python/boltons/files/boltons-21.0.0-python3.10.patch 
b/dev-python/boltons/files/boltons-21.0.0-python3.10.patch
new file mode 100644
index 000000000000..2e9974a71c9e
--- /dev/null
+++ b/dev-python/boltons/files/boltons-21.0.0-python3.10.patch
@@ -0,0 +1,110 @@
+https://github.com/mahmoud/boltons/commit/270e974
+From: Mahmoud Hashemi <[email protected]>
+Date: Sun, 10 Oct 2021 23:26:24 -0700
+Subject: [PATCH] address ecoutils import issue, fixes #294
+--- a/boltons/ecoutils.py
++++ b/boltons/ecoutils.py
+@@ -354,38 +354,53 @@ def get_profile(**kwargs):
+     return ret
+ 
+ 
+-_real_safe_repr = pprint._safe_repr
+-
+-
+-def _fake_json_dumps(val, indent=2):
+-    # never do this. this is a hack for Python 2.4. Python 2.5 added
+-    # the json module for a reason.
+-    def _fake_safe_repr(*a, **kw):
+-        res, is_read, is_rec = _real_safe_repr(*a, **kw)
+-        if res == 'None':
+-            res = 'null'
+-        if res == 'True':
+-            res = 'true'
+-        if res == 'False':
+-            res = 'false'
+-        if not (res.startswith("'") or res.startswith("u'")):
+-            res = res
+-        else:
+-            if res.startswith('u'):
+-                res = res[1:]
++try:
++    import json
++
++    def dumps(val, indent):
++        if indent:
++            return json.dumps(val, sort_keys=True, indent=indent)
++        return json.dumps(val, sort_keys=True)
++
++except ImportError:
++    _real_safe_repr = pprint._safe_repr
++
++    def _fake_json_dumps(val, indent=2):
++        # never do this. this is a hack for Python 2.4. Python 2.5 added
++        # the json module for a reason.
++        def _fake_safe_repr(*a, **kw):
++            res, is_read, is_rec = _real_safe_repr(*a, **kw)
++            if res == 'None':
++                res = 'null'
++            if res == 'True':
++                res = 'true'
++            if res == 'False':
++                res = 'false'
++            if not (res.startswith("'") or res.startswith("u'")):
++                res = res
++            else:
++                if res.startswith('u'):
++                    res = res[1:]
+ 
+-            contents = res[1:-1]
+-            contents = contents.replace('"', '').replace(r'\"', '')
+-            res = '"' + contents + '"'
+-        return res, is_read, is_rec
++                contents = res[1:-1]
++                contents = contents.replace('"', '').replace(r'\"', '')
++                res = '"' + contents + '"'
++            return res, is_read, is_rec
+ 
+-    pprint._safe_repr = _fake_safe_repr
+-    try:
+-        ret = pprint.pformat(val, indent=indent)
+-    finally:
+-        pprint._safe_repr = _real_safe_repr
++        pprint._safe_repr = _fake_safe_repr
++        try:
++            ret = pprint.pformat(val, indent=indent)
++        finally:
++            pprint._safe_repr = _real_safe_repr
++
++        return ret
++
++    def dumps(val, indent):
++        ret = _fake_json_dumps(val, indent=indent)
++        if not indent:
++            ret = re.sub(r'\n\s*', ' ', ret)
++        return ret
+ 
+-    return ret
+ 
+ 
+ def get_profile_json(indent=False):
+@@ -393,20 +408,6 @@ def get_profile_json(indent=False):
+         indent = 2
+     else:
+         indent = 0
+-    try:
+-        import json
+-
+-        def dumps(val, indent):
+-            if indent:
+-                return json.dumps(val, sort_keys=True, indent=indent)
+-            return json.dumps(val, sort_keys=True)
+-
+-    except ImportError:
+-        def dumps(val, indent):
+-            ret = _fake_json_dumps(val, indent=indent)
+-            if not indent:
+-                ret = re.sub(r'\n\s*', ' ', ret)
+-            return ret
+ 
+     data_dict = get_profile()
+     return dumps(data_dict, indent)

diff --git a/dev-python/boltons/metadata.xml b/dev-python/boltons/metadata.xml
new file mode 100644
index 000000000000..769cd6689ddf
--- /dev/null
+++ b/dev-python/boltons/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Ionen Wolkens</name>
+       </maintainer>
+       <stabilize-allarches/>
+       <upstream>
+               <remote-id type="github">mahmoud/boltons</remote-id>
+               <remote-id type="pypi">boltons</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to