Gentoo Archives: gentoo-commits

From: Sebastian Pipping <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/mergedict/, dev-python/mergedict/files/
Date: Mon, 20 Jan 2020 22:21:56
Message-Id: 1579558853.37faf468013751883b4741bbc52049e6b162fca2.sping@gentoo
1 commit: 37faf468013751883b4741bbc52049e6b162fca2
2 Author: Sebastian Pipping <sping <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 20 21:28:06 2020 +0000
4 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 20 22:20:53 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37faf468
7
8 dev-python/mergedict: Fix py36 + EAPI 7 + py3[78]
9
10 Closes: https://bugs.gentoo.org/619330
11 Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>
12 Package-Manager: Portage-2.3.84, Repoman-2.3.20
13
14 .../mergedict/files/mergedict-0.2.0-py34.patch | 60 ++++++++++++++++++++++
15 dev-python/mergedict/mergedict-0.2.0-r1.ebuild | 24 +++++++++
16 2 files changed, 84 insertions(+)
17
18 diff --git a/dev-python/mergedict/files/mergedict-0.2.0-py34.patch b/dev-python/mergedict/files/mergedict-0.2.0-py34.patch
19 new file mode 100644
20 index 00000000000..454a41a4fc8
21 --- /dev/null
22 +++ b/dev-python/mergedict/files/mergedict-0.2.0-py34.patch
23 @@ -0,0 +1,60 @@
24 +From c3f6333298c86e5681af282c7210eb1047a991dd Mon Sep 17 00:00:00 2001
25 +From: schettino72 <schettino72@×××××.com>
26 +Date: Sat, 30 Aug 2014 10:51:26 +0800
27 +Subject: [PATCH] install sigledispatch only when required.
28 +
29 +---
30 + mergedict.py | 7 +++++--
31 + setup.py | 7 ++++++-
32 + 2 files changed, 11 insertions(+), 3 deletions(-)
33 +
34 +diff --git a/mergedict.py b/mergedict.py
35 +index 5dcd994..ad80a16 100644
36 +--- a/mergedict.py
37 ++++ b/mergedict.py
38 +@@ -26,8 +26,11 @@
39 +
40 + import sys
41 + import inspect
42 +-from singledispatch import singledispatch
43 +-
44 ++try:
45 ++ from functools import singledispatch
46 ++# singledispatch was added on python 3.4
47 ++except ImportError: # pragma: no cover
48 ++ from singledispatch import singledispatch
49 +
50 + class MergeDict(dict):
51 + """Base class for a dict that implements a merge() method.
52 +diff --git a/setup.py b/setup.py
53 +index b37319e..1966b9a 100644
54 +--- a/setup.py
55 ++++ b/setup.py
56 +@@ -1,6 +1,7 @@
57 + #!/usr/bin/python
58 + # -*- coding: utf-8 -*-
59 +
60 ++import sys
61 + import os
62 + import codecs
63 + from setuptools import setup
64 +@@ -11,6 +12,10 @@
65 + long_description = ld_file.read()
66 +
67 +
68 ++install_requires = []
69 ++if sys.version_info[0] < 3 or sys.version_info[1] < 4:
70 ++ install_requires.append('singledispatch')
71 ++
72 + setup (
73 + name = 'mergedict',
74 + version = '0.2.0',
75 +@@ -23,7 +28,7 @@
76 + platforms = ['any'],
77 + license = 'MIT',
78 + py_modules = ['mergedict'],
79 +- install_requires = ['singledispatch'],
80 ++ install_requires = install_requires,
81 + classifiers = [
82 + 'Development Status :: 4 - Beta',
83 + 'Intended Audience :: Developers',
84
85 diff --git a/dev-python/mergedict/mergedict-0.2.0-r1.ebuild b/dev-python/mergedict/mergedict-0.2.0-r1.ebuild
86 new file mode 100644
87 index 00000000000..25b8d266ce9
88 --- /dev/null
89 +++ b/dev-python/mergedict/mergedict-0.2.0-r1.ebuild
90 @@ -0,0 +1,24 @@
91 +# Copyright 1999-2020 Gentoo Authors
92 +# Distributed under the terms of the GNU General Public License v2
93 +
94 +EAPI=7
95 +
96 +PYTHON_COMPAT=( python{2_7,3_{6,7,8}} )
97 +
98 +inherit distutils-r1
99 +
100 +DESCRIPTION="A Python 'dict' with a merge() method"
101 +HOMEPAGE="https://github.com/schettino72/mergedict/"
102 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
103 +
104 +LICENSE="MIT"
105 +SLOT="0"
106 +KEYWORDS="~amd64 ~x86"
107 +IUSE=""
108 +
109 +DEPEND=""
110 +RDEPEND="virtual/python-singledispatch[${PYTHON_USEDEP}]"
111 +
112 +PATCHES=(
113 + "${FILESDIR}"/${P}-py34.patch
114 +)