From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A832D1581C1 for ; Tue, 9 Jul 2024 15:30:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D09142BC013; Tue, 9 Jul 2024 15:30:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A58FA2BC013 for ; Tue, 9 Jul 2024 15:30:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D4F63335DC2 for ; Tue, 9 Jul 2024 15:30:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2F1661DFB for ; Tue, 9 Jul 2024 15:30:56 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1720539045.01478d2b293c6ae5dd7308809de9b65259605373.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/psycopg/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/psycopg/psycopg-2.9.9-r1.ebuild X-VCS-Directories: dev-python/psycopg/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 01478d2b293c6ae5dd7308809de9b65259605373 X-VCS-Branch: master Date: Tue, 9 Jul 2024 15:30:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7f99d47c-90bb-49ad-a757-53f766ca0c3d X-Archives-Hash: 2c2737a865beb5a5afc8108c6619adff commit: 01478d2b293c6ae5dd7308809de9b65259605373 Author: Michał Górny gentoo org> AuthorDate: Tue Jul 9 14:59:44 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Tue Jul 9 15:30:45 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01478d2b dev-python/psycopg: Enable py3.13 in :2 Signed-off-by: Michał Górny gentoo.org> dev-python/psycopg/psycopg-2.9.9-r1.ebuild | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/dev-python/psycopg/psycopg-2.9.9-r1.ebuild b/dev-python/psycopg/psycopg-2.9.9-r1.ebuild new file mode 100644 index 000000000000..ff0b6852789f --- /dev/null +++ b/dev-python/psycopg/psycopg-2.9.9-r1.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYPI_PN="psycopg2" +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 pypi + +DESCRIPTION="PostgreSQL database adapter for Python" +HOMEPAGE=" + https://www.psycopg.org/ + https://github.com/psycopg/psycopg2/ + https://pypi.org/project/psycopg2/ +" + +LICENSE="LGPL-3+" +SLOT="2" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="debug test" +RESTRICT="!test? ( test )" + +RDEPEND=">=dev-db/postgresql-8.1:*" +DEPEND="${RDEPEND}" +BDEPEND=" + test? ( >=dev-db/postgresql-8.1[server] ) +" + +python_prepare_all() { + distutils-r1_python_prepare_all + + # fix for py3.13 + sed -e 's:_PyInterpreterState_Get:PyInterpreterState_Get:' \ + -i psycopg/utils.c || die + # broken by different encoding of IPv4-mapped addresses + sed -e 's:test_\(cidr\|inet\)_adapt:_&:' \ + -i tests/test_ipaddress.py || die + + if use debug; then + sed -i 's/^\(define=\)/\1PSYCOPG_DEBUG,/' setup.cfg || die + fi +} + +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}" +}