From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1365712-garchives=archives.gentoo.org@lists.gentoo.org>
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 18ADF15808B
	for <garchives@archives.gentoo.org>; Tue,  8 Feb 2022 12:08:52 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C6B56E03EC;
	Tue,  8 Feb 2022 12:08:50 +0000 (UTC)
Received: from smtp.gentoo.org (dev.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 DBBF7E03EC
	for <gentoo-commits@lists.gentoo.org>; Tue,  8 Feb 2022 12:08:49 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(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 7EFCF342F06
	for <gentoo-commits@lists.gentoo.org>; Tue,  8 Feb 2022 12:08:48 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E04572CB
	for <gentoo-commits@lists.gentoo.org>; Tue,  8 Feb 2022 12:08:46 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
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" <mgorny@gentoo.org>
Message-ID: <1644320733.7102cd3c327a87f118b51cd6b01f0094c50249e4.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-python/twisted/twisted-22.1.0-r1.ebuild
X-VCS-Directories: dev-python/twisted/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 7102cd3c327a87f118b51cd6b01f0094c50249e4
X-VCS-Branch: master
Date: Tue,  8 Feb 2022 12:08:46 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: a33aecfa-b56c-40e3-ac63-8b2f83ffbefe
X-Archives-Hash: e0d6ce35bb7fd6f6b97dce378f34b92e

commit:     7102cd3c327a87f118b51cd6b01f0094c50249e4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  8 11:45:33 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb  8 11:45:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7102cd3c

dev-python/twisted: Add a PEP517/pypy3 22.1.0-r1

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/twisted/twisted-22.1.0-r1.ebuild | 160 ++++++++++++++++++++++++++++
 1 file changed, 160 insertions(+)

diff --git a/dev-python/twisted/twisted-22.1.0-r1.ebuild b/dev-python/twisted/twisted-22.1.0-r1.ebuild
new file mode 100644
index 000000000000..270ad15805d4
--- /dev/null
+++ b/dev-python/twisted/twisted-22.1.0-r1.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 virtualx
+
+DESCRIPTION="An asynchronous networking framework written in Python"
+HOMEPAGE="https://www.twistedmatrix.com/trac/"
+SRC_URI="
+	https://github.com/twisted/twisted/archive/${P}.tar.gz
+	https://dev.gentoo.org/~mgorny/dist/twisted-regen-cache.gz"
+S=${WORKDIR}/${PN}-${P}
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="conch crypt http2 serial test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-python/attrs-19.2.0[${PYTHON_USEDEP}]
+	>=dev-python/automat-0.3.0[${PYTHON_USEDEP}]
+	>=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+	>=dev-python/hyperlink-17.1.1[${PYTHON_USEDEP}]
+	>=dev-python/incremental-21.3.0[${PYTHON_USEDEP}]
+	>=dev-python/pyhamcrest-1.9.0[${PYTHON_USEDEP}]
+	>=dev-python/typing-extensions-3.6.5[${PYTHON_USEDEP}]
+	>=dev-python/zope-interface-4.4.2[${PYTHON_USEDEP}]
+	conch? (
+		>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+		dev-python/bcrypt[${PYTHON_USEDEP}]
+		>=dev-python/cryptography-1.5.0[${PYTHON_USEDEP}]
+		dev-python/pyasn1[${PYTHON_USEDEP}]
+	)
+	crypt? (
+		>=dev-python/pyopenssl-16.0.0[${PYTHON_USEDEP}]
+		dev-python/service_identity[${PYTHON_USEDEP}]
+		>=dev-python/idna-0.6[${PYTHON_USEDEP}]
+	)
+	serial? ( >=dev-python/pyserial-3.0[${PYTHON_USEDEP}] )
+	http2? (
+		>=dev-python/h2-3.0.0[${PYTHON_USEDEP}]
+		<dev-python/h2-4.0.0[${PYTHON_USEDEP}]
+		>=dev-python/priority-1.1.0[${PYTHON_USEDEP}]
+		<dev-python/priority-2.0[${PYTHON_USEDEP}]
+	)
+"
+BDEPEND="
+	>=dev-python/incremental-21.3.0[${PYTHON_USEDEP}]
+	test? (
+		>=dev-python/appdirs-1.4.0[${PYTHON_USEDEP}]
+		dev-python/bcrypt[${PYTHON_USEDEP}]
+		>=dev-python/constantly-15.1.0[${PYTHON_USEDEP}]
+		dev-python/cython-test-exception-raiser[${PYTHON_USEDEP}]
+		dev-python/idna[${PYTHON_USEDEP}]
+		dev-python/pyasn1[${PYTHON_USEDEP}]
+		dev-python/pyserial[${PYTHON_USEDEP}]
+		net-misc/openssh
+		$(python_gen_cond_dep '
+			dev-python/gmpy[${PYTHON_USEDEP}]
+		' 'python*')
+		!alpha? ( !hppa? ( !ia64? (
+			>=dev-python/cryptography-0.9.1[${PYTHON_USEDEP}]
+			>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
+			dev-python/service_identity[${PYTHON_USEDEP}]
+		) ) )
+	)
+"
+
+PATCHES=(
+	# https://twistedmatrix.com/trac/ticket/10200
+	"${FILESDIR}/${P}-force-gtk3.patch"
+)
+
+python_prepare_all() {
+	# upstream test for making releases; not very useful and requires
+	# sphinx (including on py2)
+	rm src/twisted/python/test/test_release.py || die
+
+	# puts system in EMFILE state, then the exception handler may fail
+	# trying to open more files due to some gi magic
+	sed -e '/SKIP_EMFILE/s:False:True:' \
+		-i src/twisted/internet/test/test_tcp.py || die
+
+	# multicast tests fail within network-sandbox
+	sed -e 's:test_joinLeave:_&:' \
+		-e 's:test_loopback:_&:' \
+		-e 's:test_multiListen:_&:' \
+		-e 's:test_multicast:_&:' \
+		-i src/twisted/test/test_udp.py || die
+
+	# These tests rely on warnings which seems work unreliably between python versions
+	sed -e 's:test_currentEUID:_&:' \
+		-e 's:test_currentUID:_&:' -i src/twisted/python/test/test_util.py || die
+
+	distutils-r1_python_prepare_all
+}
+
+src_test() {
+	# the test suite handles missing file & failing ioctl()s gracefully
+	# but not permission errors from sandbox
+	addwrite /dev/net/tun
+	virtx distutils-r1_src_test
+}
+
+python_test() {
+	"${EPYTHON}" -m twisted.trial twisted ||
+		die "Tests failed with ${EPYTHON}"
+}
+
+python_install() {
+	distutils-r1_python_install
+
+	# own the dropin.cache so we don't leave orphans
+	> "${D}$(python_get_sitedir)"/twisted/plugins/dropin.cache || die
+
+	python_doscript "${WORKDIR}"/twisted-regen-cache
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	newconfd "${FILESDIR}/twistd.conf" twistd
+	newinitd "${FILESDIR}/twistd.init" twistd
+}
+
+python_postinst() {
+	twisted-regen-cache || die
+}
+
+pkg_postinst() {
+	python_foreach_impl python_postinst
+
+	einfo "Install complete"
+	if use test ; then
+		einfo ""
+		einfo "Some tests have been disabled during testing due to"
+		einfo "known incompatibilities with the emerge sandboxes and/or"
+		einfo "not runnable as the root user."
+		einfo "For a complete test suite run on the code."
+		einfo "Run the tests as a normal user for each python it is installed to."
+		einfo "  ie:  $ python3.6 /usr/bin/trial twisted"
+	fi
+}
+
+python_postrm() {
+	rm -f "${ROOT}$(python_get_sitedir)/twisted/plugins/dropin.cache" || die
+}
+
+pkg_postrm() {
+	# if we're removing the last version, remove the cache file
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		python_foreach_impl python_postrm
+	fi
+}