dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / dev-python / tempora / tempora-3.0.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( pypy3 python3_{6,7,8,9} )
7 DISTUTILS_USE_SETUPTOOLS=rdepend
8
9 inherit distutils-r1
10
11 MY_PN="${PN/-/.}"
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}"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
20 IUSE="test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="
24         >=dev-python/jaraco-functools-1.20[${PYTHON_USEDEP}]
25         dev-python/pytz[${PYTHON_USEDEP}]
26 "
27 BDEPEND="
28         test? (
29                 ${RDEPEND}
30                 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
31                 dev-python/freezegun[${PYTHON_USEDEP}]
32         )
33 "
34
35 distutils_enable_sphinx docs \
36         ">=dev-python/jaraco-packaging-3.2" \
37         ">=dev-python/rst-linker-1.9"
38
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:]]*::" \
43                 setup.cfg || die
44
45         distutils-r1_python_prepare_all
46 }
47
48 python_test() {
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}"
55 }