From d030418412529d09801fc2fda2201e525c25ad2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 7 May 2021 22:54:23 +0200 Subject: [PATCH] dev-python/freezegun: Enable python3.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- .../files/freezegun-1.1.0-py310.patch | 30 ++++++++++++++++++ .../freezegun/freezegun-1.1.0-r1.ebuild | 31 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 dev-python/freezegun/files/freezegun-1.1.0-py310.patch create mode 100644 dev-python/freezegun/freezegun-1.1.0-r1.ebuild diff --git a/dev-python/freezegun/files/freezegun-1.1.0-py310.patch b/dev-python/freezegun/files/freezegun-1.1.0-py310.patch new file mode 100644 index 0000000000000..41bd7bc2712b5 --- /dev/null +++ b/dev-python/freezegun/files/freezegun-1.1.0-py310.patch @@ -0,0 +1,30 @@ +From 57d024e4ce2516c55c715448296b9099db68343c Mon Sep 17 00:00:00 2001 +From: Karthikeyan Singaravelan +Date: Fri, 7 May 2021 15:51:33 +0000 +Subject: [PATCH] Fix decorate_class for Python 3.10 where staticmethod is + callable. + +(edited by mgorny for more readable indent) +--- + freezegun/api.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/freezegun/api.py b/freezegun/api.py +index cab9ebe..eb3a931 100644 +--- a/freezegun/api.py ++++ b/freezegun/api.py +@@ -598,7 +598,10 @@ class _freeze_time(object): + continue + seen.add(attr) + +- if not callable(attr_value) or inspect.isclass(attr_value): ++ # staticmethods are callable from Python 3.10 . Hence skip them from decoration ++ if (not callable(attr_value) ++ or inspect.isclass(attr_value) ++ or isinstance(attr_value, staticmethod)): + continue + + try: +-- +2.31.1 + diff --git a/dev-python/freezegun/freezegun-1.1.0-r1.ebuild b/dev-python/freezegun/freezegun-1.1.0-r1.ebuild new file mode 100644 index 0000000000000..499c86ab148ee --- /dev/null +++ b/dev-python/freezegun/freezegun-1.1.0-r1.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{7..10} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Let your Python tests travel through time" +HOMEPAGE="https://github.com/spulec/freezegun" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" + +RDEPEND=" + >dev-python/python-dateutil-2.7[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + $(python_gen_impl_dep sqlite) + dev-python/nose[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}"/${P}-py310.patch +)