1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
8 PYTHON_REQ_USE="sqlite"
11 DESCRIPTION="Flask extension for easy ReSTful API generation"
12 HOMEPAGE="http://packages.python.org/Flask-Restless/"
13 SRC_URI="https://github.com/jfinkels/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
15 LICENSE="|| ( AGPL-3 BSD )"
17 KEYWORDS="~amd64 ~x86"
19 IUSE="doc examples test"
21 RDEPEND=">=dev-python/flask-0.7[${PYTHON_USEDEP}]
22 dev-python/flask-sqlalchemy[${PYTHON_USEDEP}]
23 dev-python/sqlalchemy[${PYTHON_USEDEP}]
24 dev-python/python-dateutil:0[${PYTHON_USEDEP}]
25 dev-python/mimerender[${PYTHON_USEDEP}]"
27 dev-python/setuptools[${PYTHON_USEDEP}]
28 test? ( dev-python/nose[${PYTHON_USEDEP}] )
29 doc? ( dev-python/sphinx[${PYTHON_USEDEP}]
30 >=dev-python/sphinxcontrib-httpdomain-1.1.7[${PYTHON_USEDEP}]
31 >=dev-python/sphinxcontrib-issuetracker-0.11[${PYTHON_USEDEP}]
32 dev-python/flask-themes[${PYTHON_USEDEP}] )"
34 PATCHES=( "${FILESDIR}"/mapping.patch )
36 python_compile_all() {
38 if ! "${PYTHON}" -c "import flask_restless"; then
39 eerror "flask-restless is not installed. Building of the docs"
40 eerror "requires flask-restless to be installed."
41 eerror "emerge with USE=-doc followed bu USE=doc"
44 # Changes connect to read issues @ github
45 rm -f docs/changelog.rst
46 einfo "Generating html docs for ${PN}"
47 PYTHONPATH=${PYTHONPATH}"${S}"/docs emake -C docs html \
48 || die "Generating html docs for ${PN} failed"
53 nosetests -w tests || die "Tests failed under ${EPYTHON}"
56 python_install_all() {
57 use doc && local HTML_DOCS=( docs/_build/html/. )
58 use examples && local EXAMPLES=( examples/. )
59 distutils-r1_python_install_all