diff options
author | 2021-05-07 22:54:23 +0200 | |
---|---|---|
committer | 2021-05-08 00:22:30 +0200 | |
commit | d030418412529d09801fc2fda2201e525c25ad2d (patch) | |
tree | 9e985f35ad8e2ffae727c48f23a4a291aa9dff80 /dev-python/freezegun | |
parent | dev-python/python-dateutil: Enable python3.10 (diff) | |
download | gentoo-d030418412529d09801fc2fda2201e525c25ad2d.tar.gz gentoo-d030418412529d09801fc2fda2201e525c25ad2d.tar.bz2 gentoo-d030418412529d09801fc2fda2201e525c25ad2d.zip |
dev-python/freezegun: Enable python3.10
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/freezegun')
-rw-r--r-- | dev-python/freezegun/files/freezegun-1.1.0-py310.patch | 30 | ||||
-rw-r--r-- | dev-python/freezegun/freezegun-1.1.0-r1.ebuild | 31 |
2 files changed, 61 insertions, 0 deletions
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 000000000000..41bd7bc2712b --- /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 <tir.karthi@gmail.com> +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 000000000000..499c86ab148e --- /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 +) |