From 34b3362ad01dee92d63c1310b7875ae50413180e Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 24 Mar 2020 20:02:31 +0000 Subject: [PATCH] dev-python/chai: Bump to 1.1.2, py3.8 Avoid pyc and SyntaxErrors during install by not installing python2.py. Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Chris Mayo Closes: https://github.com/gentoo/gentoo/pull/15094 Signed-off-by: Andreas Sturmlechner --- dev-python/chai/Manifest | 1 + dev-python/chai/chai-1.1.2.ebuild | 19 ++++++++++++ .../chai/files/chai-1.1.2-drop-Python2.patch | 30 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 dev-python/chai/chai-1.1.2.ebuild create mode 100644 dev-python/chai/files/chai-1.1.2-drop-Python2.patch diff --git a/dev-python/chai/Manifest b/dev-python/chai/Manifest index 205e3089f35d..bfbf42d8a844 100644 --- a/dev-python/chai/Manifest +++ b/dev-python/chai/Manifest @@ -1 +1,2 @@ DIST chai-1.1.1.tar.gz 81684 BLAKE2B 0aa285d3545e445f26f0b088c1b721f2dd14094a8f499cf7b2dde378a20ee15e376e43a91a664be9d6bd11b45d9c2f4606ce5de73743c27b6bb76e9bea409194 SHA512 f51406258327d9a49e820f0489d60e87f576c72232c701e99f96945932ed300582e6dd81608e5b262e2645c4e9c5216ec8f52e98d454c994beac8d1d8137dc87 +DIST chai-1.1.2.tar.gz 107807 BLAKE2B 6cedd108f7275c3dd03167c7ad49695d95c27e1b0c752247e170996f001c7690cede7c7ac8de8e374077ea9802534b8386b0bd2da7197f0a47085ad9f9e470fc SHA512 81191b11a8c5c6bd1fbb0c43fe7855d6e6d9be54b4d0ddc42582a23b9df03249a91ba8ca50b5b74e76aab73a101377624e041b6c47ea6cba5267d4b58eaf77e5 diff --git a/dev-python/chai/chai-1.1.2.ebuild b/dev-python/chai/chai-1.1.2.ebuild new file mode 100644 index 000000000000..f031b5fb0dd8 --- /dev/null +++ b/dev-python/chai/chai-1.1.2.ebuild @@ -0,0 +1,19 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8} ) +inherit distutils-r1 + +DESCRIPTION="Easy to use mocking, stubbing and spying framework" +HOMEPAGE="https://github.com/agoragames/chai" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" + +PATCHES=( "${FILESDIR}"/${P}-drop-Python2.patch ) + +distutils_enable_tests nose diff --git a/dev-python/chai/files/chai-1.1.2-drop-Python2.patch b/dev-python/chai/files/chai-1.1.2-drop-Python2.patch new file mode 100644 index 000000000000..82e8b78b2424 --- /dev/null +++ b/dev-python/chai/files/chai-1.1.2-drop-Python2.patch @@ -0,0 +1,30 @@ +--- a/chai/chai.py ++++ b/chai/chai.py +@@ -62,11 +62,6 @@ + try: + func(self, *args, **kwargs) + except UnexpectedCall as e: +- # if this is not python3, use python2 syntax +- if not hasattr(e, '__traceback__'): +- from .python2 import reraise +- reraise( +- AssertionError, '\n\n' + str(e), sys.exc_info()[-1]) + exc = AssertionError('\n\n' + str(e)) + setattr(exc, '__traceback__', sys.exc_info()[-1]) + raise exc +--- a/chai/python2.py ++++ b/chai/python2.py +@@ -1,3 +0,0 @@ +- +-def reraise(exc, msg, traceback): +- raise exc, msg, traceback +--- a/chai.egg-info/SOURCES.txt ++++ b/chai.egg-info/SOURCES.txt +@@ -10,7 +10,6 @@ + chai/exception.py + chai/expectation.py + chai/mock.py +-chai/python2.py + chai/spy.py + chai/stub.py + chai.egg-info/PKG-INFO -- 2.26.2