public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/
Date: Thu, 10 Sep 2020 08:48:59 +0000 (UTC)	[thread overview]
Message-ID: <1599727731.1d7713cdc9b273e52d8a0b14e84d0fdb63c9966e.mgorny@gentoo> (raw)

commit:     1d7713cdc9b273e52d8a0b14e84d0fdb63c9966e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 10 07:32:38 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 10 08:48:51 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d7713cd

dev-python/astroid: Enable py3.9

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

 dev-python/astroid/astroid-2.4.2-r1.ebuild        | 68 +++++++++++++++++++++++
 dev-python/astroid/files/astroid-2.4.2-py39.patch | 42 ++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/dev-python/astroid/astroid-2.4.2-r1.ebuild b/dev-python/astroid/astroid-2.4.2-r1.ebuild
new file mode 100644
index 00000000000..60e1cbbb76d
--- /dev/null
+++ b/dev-python/astroid/astroid-2.4.2-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+
+inherit distutils-r1
+
+DESCRIPTION="Abstract Syntax Tree for logilab packages"
+HOMEPAGE="https://github.com/PyCQA/astroid https://pypi.org/project/astroid/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+# Version specified in __pkginfo__.py.
+RDEPEND="
+	dev-python/lazy-object-proxy[${PYTHON_USEDEP}]
+	dev-python/six[${PYTHON_USEDEP}]
+	>=dev-python/wrapt-1.11.2[${PYTHON_USEDEP}]
+	>=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]"
+DEPEND="
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	test? (
+		${RDEPEND}
+		dev-python/nose[${PYTHON_USEDEP}]
+		dev-python/numpy[${PYTHON_USEDEP}]
+		dev-python/pytest[${PYTHON_USEDEP}]
+		dev-python/python-dateutil[${PYTHON_USEDEP}]
+	)"
+
+PATCHES=(
+	"${FILESDIR}"/astroid-2.4.2-no-pytest-runner.patch
+	"${FILESDIR}"/astroid-2.4.2-py39.patch
+)
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+	sed -r -e 's:"(wrapt|six|lazy_object_proxy)(~|=)=.+":"\1":' \
+		-i astroid/__pkginfo__.py || die
+
+	distutils-r1_python_prepare_all
+}
+
+python_test() {
+	local deselect=(
+		# no clue why it's broken
+		--deselect
+		tests/unittest_modutils.py::GetModulePartTest::test_knownValues_get_builtin_module_part
+	)
+	[[ ${EPYTHON} == python3.9 ]] && deselect+=(
+		--deselect
+		tests/unittest_brain.py::TypingBrain::test_namedtuple_few_args
+		--deselect
+		tests/unittest_brain.py::TypingBrain::test_namedtuple_few_fields
+		--deselect
+		tests/unittest_brain.py::TypingBrain::test_namedtuple_inference_nonliteral
+		--deselect
+		tests/unittest_inference.py::test_dataclasses_subscript_inference_recursion_error
+	)
+
+	pytest -vv "${deselect[@]}" || die "Tests failed with ${EPYTHON}"
+}

diff --git a/dev-python/astroid/files/astroid-2.4.2-py39.patch b/dev-python/astroid/files/astroid-2.4.2-py39.patch
new file mode 100644
index 00000000000..0f838b7214a
--- /dev/null
+++ b/dev-python/astroid/files/astroid-2.4.2-py39.patch
@@ -0,0 +1,42 @@
+From 3ffe25f8e3cdb30f0dcfb68f4373370828894727 Mon Sep 17 00:00:00 2001
+From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
+Date: Tue, 4 Aug 2020 10:11:44 +0000
+Subject: [PATCH] Skip test for | in dictionaries due to PEP-584 in Python 3.9+
+
+---
+ tests/unittest_inference.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py
+index 76c7e879..b7bc732d 100644
+--- a/tests/unittest_inference.py
++++ b/tests/unittest_inference.py
+@@ -2455,7 +2455,6 @@ def test_binary_op_type_errors(self):
+         1 ** (lambda x: x) #@
+         {} * {} #@
+         {} - {} #@
+-        {} | {} #@
+         {} >> {} #@
+         [] + () #@
+         () + [] #@
+@@ -2500,7 +2499,6 @@ def __radd__(self, other):
+             msg.format(op="**", lhs="int", rhs="function"),
+             msg.format(op="*", lhs="dict", rhs="dict"),
+             msg.format(op="-", lhs="dict", rhs="dict"),
+-            msg.format(op="|", lhs="dict", rhs="dict"),
+             msg.format(op=">>", lhs="dict", rhs="dict"),
+             msg.format(op="+", lhs="list", rhs="tuple"),
+             msg.format(op="+", lhs="tuple", rhs="list"),
+@@ -2515,6 +2513,12 @@ def __radd__(self, other):
+             msg.format(op="+=", lhs="int", rhs="A"),
+             msg.format(op="+=", lhs="int", rhs="list"),
+         ]
++
++        # PEP-584 supports | for dictionary union
++        if sys.version_info < (3, 9):
++            ast_nodes.append(extract_node("{} | {} #@"))
++            expected.append(msg.format(op="|", lhs="dict", rhs="dict"))
++
+         for node, expected_value in zip(ast_nodes, expected):
+             errors = node.type_errors()
+             self.assertEqual(len(errors), 1)


             reply	other threads:[~2020-09-10  8:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-10  8:48 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-08 19:22 [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/ Michał Górny
2021-06-05 21:01 Michał Górny
2020-06-16 22:54 Patrick McLean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1599727731.1d7713cdc9b273e52d8a0b14e84d0fdb63c9966e.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox