mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
dev-python/mergedict: Fix py36 + EAPI 7 + py3[78]
Closes: https://bugs.gentoo.org/619330 Signed-off-by: Sebastian Pipping <sping@gentoo.org> Package-Manager: Portage-2.3.84, Repoman-2.3.20
This commit is contained in:
60
dev-python/mergedict/files/mergedict-0.2.0-py34.patch
Normal file
60
dev-python/mergedict/files/mergedict-0.2.0-py34.patch
Normal file
@@ -0,0 +1,60 @@
|
||||
From c3f6333298c86e5681af282c7210eb1047a991dd Mon Sep 17 00:00:00 2001
|
||||
From: schettino72 <schettino72@gmail.com>
|
||||
Date: Sat, 30 Aug 2014 10:51:26 +0800
|
||||
Subject: [PATCH] install sigledispatch only when required.
|
||||
|
||||
---
|
||||
mergedict.py | 7 +++++--
|
||||
setup.py | 7 ++++++-
|
||||
2 files changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/mergedict.py b/mergedict.py
|
||||
index 5dcd994..ad80a16 100644
|
||||
--- a/mergedict.py
|
||||
+++ b/mergedict.py
|
||||
@@ -26,8 +26,11 @@
|
||||
|
||||
import sys
|
||||
import inspect
|
||||
-from singledispatch import singledispatch
|
||||
-
|
||||
+try:
|
||||
+ from functools import singledispatch
|
||||
+# singledispatch was added on python 3.4
|
||||
+except ImportError: # pragma: no cover
|
||||
+ from singledispatch import singledispatch
|
||||
|
||||
class MergeDict(dict):
|
||||
"""Base class for a dict that implements a merge() method.
|
||||
diff --git a/setup.py b/setup.py
|
||||
index b37319e..1966b9a 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
+import sys
|
||||
import os
|
||||
import codecs
|
||||
from setuptools import setup
|
||||
@@ -11,6 +12,10 @@
|
||||
long_description = ld_file.read()
|
||||
|
||||
|
||||
+install_requires = []
|
||||
+if sys.version_info[0] < 3 or sys.version_info[1] < 4:
|
||||
+ install_requires.append('singledispatch')
|
||||
+
|
||||
setup (
|
||||
name = 'mergedict',
|
||||
version = '0.2.0',
|
||||
@@ -23,7 +28,7 @@
|
||||
platforms = ['any'],
|
||||
license = 'MIT',
|
||||
py_modules = ['mergedict'],
|
||||
- install_requires = ['singledispatch'],
|
||||
+ install_requires = install_requires,
|
||||
classifiers = [
|
||||
'Development Status :: 4 - Beta',
|
||||
'Intended Audience :: Developers',
|
||||
24
dev-python/mergedict/mergedict-0.2.0-r1.ebuild
Normal file
24
dev-python/mergedict/mergedict-0.2.0-r1.ebuild
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python{2_7,3_{6,7,8}} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="A Python 'dict' with a merge() method"
|
||||
HOMEPAGE="https://github.com/schettino72/mergedict/"
|
||||
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="virtual/python-singledispatch[${PYTHON_USEDEP}]"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-py34.patch
|
||||
)
|
||||
Reference in New Issue
Block a user