summaryrefslogtreecommitdiff
blob: f6efc4939461063953a25530b1ddcef5bd4a4a5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/django-pipeline/django-pipeline-1.3.9.ebuild,v 1.5 2013/05/31 16:21:20 idella4 Exp $

EAPI=5
PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )

inherit distutils-r1

DESCRIPTION="An asset packaging library for Django"
HOMEPAGE="http://pypi.python.org/pypi/django-pipeline/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc test"

RDEPEND=">=dev-python/django-1.4.1[${PYTHON_USEDEP}]
	dev-python/futures[$(python_gen_usedep python{2_6,2_7})]
	dev-python/jsmin[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
	dev-python/setuptools[${PYTHON_USEDEP}]"
# Test phase unworkable due to missing source content
RESTRICT="test"

python_compile_all() {
	use doc && emake -C docs html
	rm -f docs/_build/doctrees/environment.pickle || die
}

python_compile() {
	# Need remove tests before reaching distutils-r1_src_install
	if ! use test; then
		rm -rf tests/ || die
	fi
	distutils-r1_python_compile
}

python_test() {
	export DJANGO_SETTINGS_MODULE="django.conf"
	export SECRET_KEY='green'
	local test
	pushd "${BUILD_DIR}"/lib/tests/tests/ > /dev/null || die
	for test in test_*.py
	do
		if ! "${PYTHON}" -c \
			"from django.conf import global_settings;global_settings.SECRET_KEY='$SECRET_KEY'" ${test}
		then
			die "test ${test} failed under ${EPYTHON}"
		else
			einfo "test ${test} passed under ${EPYTHON}"
		fi
	done
	cd ../../
	rm -rf tests/ || die
	rm -rf "${S}"/tests/ || einfo "tests folder already removed"
}

python_install_all() {
	use doc && HTML_DOCS=( docs/_build/html/. )
	distutils-r1_python_install_all
}