1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_6 )
10 MY_PN="collective-${PN}"
12 DESCRIPTION="Package used for parsing and generating iCalendar files (RFC 2445)"
13 HOMEPAGE="https://github.com/collective/icalendar"
14 SRC_URI="mirror://pypi/i/${PN}/${P}.tar.gz"
18 KEYWORDS="~amd64 ~x86"
20 RESTRICT="!test? ( test )"
24 dev-python/pytz[${PYTHON_USEDEP}]
25 dev-python/setuptools[${PYTHON_USEDEP}]
26 dev-python/python-dateutil[${PYTHON_USEDEP}]"
30 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
31 test? ( dev-python/python-dateutil:0[${PYTHON_USEDEP}]
32 dev-python/pytest[${PYTHON_USEDEP}]
33 dev-python/coverage[${PYTHON_USEDEP}] )"
35 python_prepare_all() {
36 # reset conf.py to not read version from an installed instance
37 sed -e "s:pkg_resources.get_distribution('icalendar').version:'3.9.0':" \
38 -i docs/conf.py || die
39 distutils-r1_python_prepare_all
42 python_compile_all() {
44 pushd docs > /dev/null
47 DOCS=( ${DOCS} docs/_build/text/*.txt )
53 coverage run --source=src/icalendar --omit=*/tests/* --module \
54 pytest src/icalendar || die "test failed under ${EPYTHON}"