*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / freezegun / freezegun-0.3.12-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Let your Python tests travel through time"
10 HOMEPAGE="https://github.com/spulec/freezegun"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
16 IUSE="test"
17
18 RDEPEND="
19         >dev-python/python-dateutil-2.0[${PYTHON_USEDEP}]
20         dev-python/six[${PYTHON_USEDEP}]
21 "
22 DEPEND="${RDEPEND}
23         dev-python/setuptools[${PYTHON_USEDEP}]
24         test? (
25                 $(python_gen_impl_dep sqlite)
26                 dev-python/mock[${PYTHON_USEDEP}]
27                 dev-python/nose[${PYTHON_USEDEP}]
28         )
29 "
30
31 PATCHES=(
32         # pulled from upstream git, will be in next release
33         "${FILESDIR}/freezegun-0.3.12-py38.patch"
34
35         # test fixes
36         "${FILESDIR}/freezegun-0.3.12-tests.patch"
37 )
38
39 distutils_enable_tests pytest
40
41 python_prepare_all() {
42         sed -r \
43                 -e 's:(python-dateutil)>=2.0:\1:' \
44                 -e "s:'(python-dateutil)>=[0-9.]+,.+':'\1':" \
45                 -i setup.py
46
47         distutils-r1_python_prepare_all
48 }
49
50 python_prepare() {
51         # optional and only works with python3
52         if ! python_is_python3; then
53                 rm ${PN}/_async.py || die
54         fi
55 }