commit: d030418412529d09801fc2fda2201e525c25ad2d Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Fri May 7 20:54:23 2021 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Fri May 7 22:22:30 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0304184
dev-python/freezegun: Enable python3.10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> .../freezegun/files/freezegun-1.1.0-py310.patch | 30 +++++++++++++++++++++ dev-python/freezegun/freezegun-1.1.0-r1.ebuild | 31 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) 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 00000000000..41bd7bc2712 --- /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 <[email protected]> +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 00000000000..499c86ab148 --- /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 +)
