1 |
commit: 8dd1909481af4844bd735c5ab0ecdb64be37c973 |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 4 08:03:09 2021 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 4 08:04:04 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8dd19094 |
7 |
|
8 |
dev-python/pygresql: enable tests |
9 |
|
10 |
Closes: https://bugs.gentoo.org/798375 |
11 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
12 |
|
13 |
dev-python/pygresql/pygresql-5.2.2.ebuild | 26 ++++++++++++++++++++++++-- |
14 |
1 file changed, 24 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/pygresql/pygresql-5.2.2.ebuild b/dev-python/pygresql/pygresql-5.2.2.ebuild |
17 |
index 578b5884f40..5a676aa5de5 100644 |
18 |
--- a/dev-python/pygresql/pygresql-5.2.2.ebuild |
19 |
+++ b/dev-python/pygresql/pygresql-5.2.2.ebuild |
20 |
@@ -13,6 +13,7 @@ MY_P="PyGreSQL-${PV}" |
21 |
DESCRIPTION="A Python interface for the PostgreSQL database" |
22 |
HOMEPAGE="https://pygresql.org/" |
23 |
SRC_URI="mirror://pypi/P/PyGreSQL/${MY_P}.tar.gz" |
24 |
+S="${WORKDIR}/${MY_P}" |
25 |
|
26 |
LICENSE="POSTGRESQL" |
27 |
SLOT="0" |
28 |
@@ -21,8 +22,29 @@ KEYWORDS="~alpha amd64 ~hppa ~ia64 ppc ~sparc x86" |
29 |
DEPEND="${POSTGRES_DEP}" |
30 |
RDEPEND="${DEPEND}" |
31 |
|
32 |
-S="${WORKDIR}/${MY_P}" |
33 |
-PATCHES=( "${FILESDIR}"/${PN}-5.2-CFLAGS.patch ) |
34 |
+PATCHES=( |
35 |
+ "${FILESDIR}"/${PN}-5.2-CFLAGS.patch |
36 |
+) |
37 |
+ |
38 |
+distutils_enable_tests unittest |
39 |
+ |
40 |
+src_test() { |
41 |
+ local db="${T}/pgsql" |
42 |
+ initdb --username=portage -D "${db}" || die |
43 |
+ pg_ctl -w -D "${db}" start \ |
44 |
+ -o "-h '127.0.0.1' -p 5432 -k '${T}'" || die |
45 |
+ psql -h "${T}" -U portage -d postgres \ |
46 |
+ -c "ALTER ROLE portage WITH PASSWORD 'postgres';" || die |
47 |
+ createdb -h "${T}" -U portage unittest || die |
48 |
+ |
49 |
+ cat > tests/LOCAL_PyGreSQL.py <<-EOF || die |
50 |
+ dbhost = '${T}' |
51 |
+ EOF |
52 |
+ |
53 |
+ distutils-r1_src_test |
54 |
+ |
55 |
+ pg_ctl -w -D "${db}" stop || die |
56 |
+} |
57 |
|
58 |
python_install_all() { |
59 |
local DOCS=( docs/*.rst docs/community/* docs/contents/tutorial.rst ) |