public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:master commit in: dev-python/psycopg2cffi/, dev-python/psycopg2cffi/files/
@ 2023-02-27 15:06 Florian Schmaus
  0 siblings, 0 replies; only message in thread
From: Florian Schmaus @ 2023-02-27 15:06 UTC (permalink / raw
  To: gentoo-commits

commit:     38212e927a9233e80677309952b7ec44de5123b0
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Sun Feb 26 21:31:16 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 22:41:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=38212e92

dev-python/psycopg2cffi: enable py3.11, fix tests

Closes: https://bugs.gentoo.org/819018
Closes: https://bugs.gentoo.org/897522
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 dev-python/psycopg2cffi/Manifest                   |  2 +-
 .../files/psycopg2cffi-2.9.0-include-tests.patch   | 10 ++++
 .../psycopg2cffi/psycopg2cffi-2.9.0-r1.ebuild      | 59 ++++++++++++++++++++++
 dev-python/psycopg2cffi/psycopg2cffi-2.9.0.ebuild  | 28 ----------
 4 files changed, 70 insertions(+), 29 deletions(-)

diff --git a/dev-python/psycopg2cffi/Manifest b/dev-python/psycopg2cffi/Manifest
index 26be24ea9..d267c2e40 100644
--- a/dev-python/psycopg2cffi/Manifest
+++ b/dev-python/psycopg2cffi/Manifest
@@ -1 +1 @@
-DIST psycopg2cffi-2.9.0.tar.gz 65512 BLAKE2B 2e106eea22feb08aa7154dfc4959a9e68d946b34e872711f19856521dca050d0380498d3c20e762b31e7181ecfc5371a1b02c4bb711bccccfe56a4af9f497ffc SHA512 afd3ce9fa76dcd2df29b7aa8c5d31a33058023dc020ac829b95b8f7950fa17f2733f86a8c45f3d6eefeafae1c7f3997cbae820da98952d71336f7a1c72e84353
+DIST psycopg2cffi-2.9.0.gh.tar.gz 117682 BLAKE2B 9fe983f8f72fe384b1946143331b17dbcd03d12579241c7444d0d1c8bb7d51ed9576eace780ae3dd58c2d621b21f045347e25692514fa2fbbee2aac21ef89adb SHA512 520c4aaad33916ff5e1a7089888e04134bd5ad6f3115415a3dd04fb48afdc8ad0c68bf9e71d9158640392d3a2cd0b280eea8fa7a3d2ed63944e234d52f8cce43

diff --git a/dev-python/psycopg2cffi/files/psycopg2cffi-2.9.0-include-tests.patch b/dev-python/psycopg2cffi/files/psycopg2cffi-2.9.0-include-tests.patch
new file mode 100644
index 000000000..1237fa7d5
--- /dev/null
+++ b/dev-python/psycopg2cffi/files/psycopg2cffi-2.9.0-include-tests.patch
@@ -0,0 +1,10 @@
+--- a/setup.py
++++ b/setup.py
+@@ -57,7 +57,7 @@ setup_kwargs = dict(
+     description=README[0].strip(),
+     long_description=''.join(README),
+     test_suite='psycopg2cffi.tests.suite',
+-    packages=['psycopg2cffi', 'psycopg2cffi._impl', 'psycopg2cffi.tests'],
++    packages=['psycopg2cffi', 'psycopg2cffi._impl', 'psycopg2cffi.tests', 'psycopg2cffi.tests.psycopg2_tests'],
+     install_requires=['six'],
+ )

diff --git a/dev-python/psycopg2cffi/psycopg2cffi-2.9.0-r1.ebuild b/dev-python/psycopg2cffi/psycopg2cffi-2.9.0-r1.ebuild
new file mode 100644
index 000000000..965fa9788
--- /dev/null
+++ b/dev-python/psycopg2cffi/psycopg2cffi-2.9.0-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2019-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} pypy3 )
+DISTUTILS_USE_PEP517=setuptools
+inherit databases distutils-r1 edo
+
+DESCRIPTION="Implementation of the psycopg2 module using cffi. Compatible with Psycopg 2.5."
+HOMEPAGE="
+	https://pypi.org/project/psycopg2cffi/
+	https://github.com/chtd/psycopg2cffi
+"
+SRC_URI="https://github.com/chtd/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="LGPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="dev-db/postgresql:="
+RDEPEND="
+	${DEPEND}
+	dev-python/six[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	virtual/python-cffi[${PYTHON_USEDEP}]
+	test? (
+		$(epostgres --get-depend)
+	)
+"
+
+PATCHES=( "${FILESDIR}"/${P}-include-tests.patch )
+
+EPYTEST_DESELECT=(
+	# hang
+	tests/psycopg2_tests/test_cancel.py::CancelTests::test_async_cancel
+	# fail
+	tests/psycopg2_tests/test_dates.py::FromTicksTestCase::test_date_value_error_sec_59_99
+	tests/psycopg2_tests/test_types_basic.py::TypesBasicTests::testEmptyArray
+)
+
+distutils_enable_tests pytest
+
+python_test() {
+	cd "${T}" || die
+	epytest --pyargs ${PN}
+}
+
+src_test() {
+	local -x PSYCOPG2_TESTDB_HOST="localhost"
+	local -x PSYCOPG2_TESTDB_PORT="55432"
+	local -x PSYCOPG2_TESTDB_USER="postgres"
+	epostgres --start ${PSYCOPG2_TESTDB_PORT}
+	edo createdb -h ${PSYCOPG2_TESTDB_HOST} -p ${PSYCOPG2_TESTDB_PORT} -U postgres psycopg2_test
+
+	distutils-r1_src_test
+	epostgres --stop
+}

diff --git a/dev-python/psycopg2cffi/psycopg2cffi-2.9.0.ebuild b/dev-python/psycopg2cffi/psycopg2cffi-2.9.0.ebuild
deleted file mode 100644
index a77ccb921..000000000
--- a/dev-python/psycopg2cffi/psycopg2cffi-2.9.0.ebuild
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2019-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( pypy3 python3_{8..10} )
-
-inherit distutils-r1
-
-DESCRIPTION="Implementation of the psycopg2 module using cffi. Compatible with Psycopg 2.5."
-HOMEPAGE="
-	https://github.com/chtd/psycopg2cffi
-	https://pypi.org/project/psycopg2cffi/
-"
-SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="LGPL-3+"
-SLOT="0"
-KEYWORDS="~amd64"
-
-RDEPEND="
-	dev-db/postgresql:*
-	dev-python/six[${PYTHON_USEDEP}]
-	virtual/python-cffi[${PYTHON_USEDEP}]
-"
-DEPEND="${RDEPEND}"
-
-distutils_enable_tests pytest


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-27 15:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-27 15:06 [gentoo-commits] repo/proj/guru:master commit in: dev-python/psycopg2cffi/, dev-python/psycopg2cffi/files/ Florian Schmaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox