diff options
Diffstat (limited to 'dev-python/psycopg/psycopg-2.8.4.ebuild')
-rw-r--r-- | dev-python/psycopg/psycopg-2.8.4.ebuild | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/dev-python/psycopg/psycopg-2.8.4.ebuild b/dev-python/psycopg/psycopg-2.8.4.ebuild index f5b41a2bfa7d..76f4141a2922 100644 --- a/dev-python/psycopg/psycopg-2.8.4.ebuild +++ b/dev-python/psycopg/psycopg-2.8.4.ebuild @@ -13,6 +13,7 @@ MY_P="${MY_PN}-${PV}" DESCRIPTION="PostgreSQL database adapter for Python" HOMEPAGE="http://initd.org/psycopg/ https://pypi.org/project/psycopg2/" SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" +S=${WORKDIR}/${MY_P} LICENSE="LGPL-3+" SLOT="2" @@ -26,15 +27,11 @@ DEPEND="${RDEPEND} >=dev-python/sphinx-1.6 )" -RESTRICT="test" - # Avoid using mxdatetime: https://bugs.gentoo.org/452028 PATCHES=( "${FILESDIR}"/psycopg-2.8.3-avoid-mxdatetime.patch ) -S="${WORKDIR}/${MY_P}" - python_compile() { local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS} @@ -55,6 +52,26 @@ python_compile_all() { use doc && emake -C doc/src -j1 html text } +src_test() { + initdb -D "${T}"/pgsql || die + # TODO: random port + pg_ctl -w -D "${T}"/pgsql start \ + -o "-h '' -k '${T}'" || die + createdb -h "${T}" psycopg2_test || die + + local -x PSYCOPG2_TESTDB_HOST="${T}" + distutils-r1_src_test + + pg_ctl -w -D "${T}"/pgsql stop || die +} + +python_test() { + "${EPYTHON}" -c " +import tests +tests.unittest.main(defaultTest='tests.test_suite') +" --verbose || die "Tests fail with ${EPYTHON}" +} + python_install_all() { if use doc; then dodoc -r doc/src/_build/html |