dev-python/backports-functools-lru-cache-1.4-r1: added ~alpha, bug 621282
[gentoo.git] / dev-python / backports-functools-lru-cache / backports-functools-lru-cache-1.4-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 pypy )
7
8 inherit distutils-r1
9
10 MY_PN="${PN/-/.}"
11 MY_PN="${MY_PN//-/_}"
12 DESCRIPTION="Backport of functools.lru_cache from Python 3.3"
13 HOMEPAGE="https://github.com/jaraco/backports.functools_lru_cache"
14 SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
15
16 LICENSE="MIT"
17 SLOT="0"
18 KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 x86 ~amd64-linux"
19 IUSE="doc test"
20
21 RDEPEND="dev-python/backports[${PYTHON_USEDEP}]"
22 DEPEND="
23         dev-python/setuptools[${PYTHON_USEDEP}]
24         >=dev-python/setuptools_scm-1.15.0[${PYTHON_USEDEP}]
25         doc? (
26                 >=dev-python/jaraco-packaging-3.2[${PYTHON_USEDEP}]
27                 dev-python/rst-linker[${PYTHON_USEDEP}]
28                 dev-python/sphinx[${PYTHON_USEDEP}]
29         )
30         test? (
31                 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
32         )
33 "
34
35 S="${WORKDIR}/${MY_PN}-${PV}"
36
37 python_compile_all() {
38         if use doc; then
39                 cd docs || die
40                 sphinx-build . _build/html || die
41                 HTML_DOCS=( docs/_build/html/. )
42         fi
43 }
44
45 python_test() {
46         PYTHONPATH=. py.test || die "tests failed with ${EPYTHON}"
47 }
48
49 python_install() {
50         # avoid a collision with dev-python/backports
51         rm "${BUILD_DIR}"/lib/backports/__init__.py || die
52         distutils-r1_python_install --skip-build
53 }