aboutsummaryrefslogtreecommitdiff
blob: 74ecf7e102f349776e605414c7d239ed4247695f (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
64
65
66
67
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS=1
RESTRICT_PYTHON_ABIS="3.* *-jython"

inherit distutils

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"
KEYWORDS="~amd64"
IUSE="doc"

LICENSE="MIT"
SLOT="0"
PYTHON_MODNAME="pipeline"
DISTUTILS_SRC_TEST=nosetests
RDEPEND=">=dev-python/django-1.4"
DEPEND="${RDEPEND}
	dev-python/setuptools"

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

src_test() {
	export DJANGO_SETTINGS_MODULE="django.conf"
	# Python.[56] trigger a harmless deprecation warning
	testing() {
		local exit_status=0 test
		pushd build-${PYTHON_ABI}/lib/tests/tests/ > /dev/null || die
		for test in [a-z]*.py
		do
			if ! "$(PYTHON)" ${test}; then
				eerror "test "${test}" failed"
				exit_status="1"
			else
				einfo "test "${test}" passed OK"
			fi
		done
		popd > /dev/null
		return ${exit_status}
	}
	python_execute_function testing
}

src_install() {
	distutils_src_install

	if use doc; then
		dohtml -r docs/_build/html/
	fi

	# Remove un-needed tests to avoid file collisions
	rmtests() {
		rm -rf ${ED}/$(python_get_sitedir)/tests/ || die
	}

	python_execute_function rmtests
}