1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( pypy3 python3_{6,7,8,9} )
7 DISTUTILS_USE_SETUPTOOLS=rdepend
12 DESCRIPTION="Objects and routines pertaining to date and time"
13 HOMEPAGE="https://github.com/jaraco/tempora"
14 SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
15 S="${WORKDIR}/${MY_PN}-${PV}"
19 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
21 RESTRICT="!test? ( test )"
24 >=dev-python/jaraco-functools-1.20[${PYTHON_USEDEP}]
25 dev-python/pytz[${PYTHON_USEDEP}]
30 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
31 dev-python/freezegun[${PYTHON_USEDEP}]
35 distutils_enable_sphinx docs \
36 ">=dev-python/jaraco-packaging-3.2" \
37 ">=dev-python/rst-linker-1.9"
39 python_prepare_all() {
40 # avoid a setuptools_scm dependency
41 sed -i "s:use_scm_version=True:version='${PV}',name='${PN//-/.}':" setup.py || die
42 sed -r -i "s:setuptools_scm[[:space:]]*([><=]{1,2}[[:space:]]*[0-9.a-zA-Z]+)[[:space:]]*::" \
45 distutils-r1_python_prepare_all
49 # Override pytest options to skip flake8
50 # Skip a test that requires pytest-freezegun
51 # because it seems to be poorly maintained
52 PYTHONPATH=. pytest -vv --override-ini="addopts=--doctest-modules" \
53 --deselect tempora/__init__.py::tempora.get_nearest_year_for_day \
54 || die "tests failed with ${EPYTHON}"