* [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/
@ 2020-06-16 22:54 Patrick McLean
0 siblings, 0 replies; 4+ messages in thread
From: Patrick McLean @ 2020-06-16 22:54 UTC (permalink / raw
To: gentoo-commits
commit: 6a05452c981425c033199dc3c767f5ab97ba3bcf
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Tue Jun 16 22:03:08 2020 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Jun 16 22:43:38 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a05452c
dev-python/astroid-2.4.2: Version bump
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.101, Repoman-2.3.22
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-python/astroid/Manifest | 1 +
dev-python/astroid/astroid-2.4.2.ebuild | 53 ++++++++++++++++++++++
.../files/astroid-2.4.2-no-pytest-runner.patch | 21 +++++++++
3 files changed, 75 insertions(+)
diff --git a/dev-python/astroid/Manifest b/dev-python/astroid/Manifest
index 11d953d01e2..b1c74fae7c6 100644
--- a/dev-python/astroid/Manifest
+++ b/dev-python/astroid/Manifest
@@ -1 +1,2 @@
DIST astroid-2.3.3.tar.gz 297350 BLAKE2B 7ac5cf028fa0263998271d23128b1bfd127fedafab2f6b3cc465867b9668942e1edc79bed62eb34bcce31b6892e4c5a31dbdd68d20fb92a1f134dc9e78a76920 SHA512 72011f3eb312ea7ce7dd55f7615972f6bfc152d8f16f9052b405f44fe17e594d5da22e0502b4c3034881b9783be9e808509d4ded3d679182ddf6d34eb90748f1
+DIST astroid-2.4.2.tar.gz 310972 BLAKE2B 23ebe5ef418ce19b64eb1c0f8d711c3f0d86ae32cff112d9a99db48d20a34c73cfa97c96229fd0f0f1169720d24e2cfd0b5a327c29ea0fc0f54a57ede45fcebe SHA512 f5d759c07a13e06d3d071faacff2dc775924566aaef8bdb6e526c4ebf723b6b561f5824b711b33e33a2a69df0a2ff4cbf0f4302c9a0d55610e031e81c4a4be91
diff --git a/dev-python/astroid/astroid-2.4.2.ebuild b/dev-python/astroid/astroid-2.4.2.ebuild
new file mode 100644
index 00000000000..4b6254b039d
--- /dev/null
+++ b/dev-python/astroid/astroid-2.4.2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+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}/${PN}-2.4.2-no-pytest-runner.patch"
+)
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ # Disable failing tests
+
+ sed -r -e 's:"(wrapt|six|lazy_object_proxy)(~|=)=.+":"\1":' \
+ -i astroid/__pkginfo__.py || die
+
+ # no idea why this test fails
+ sed -i -e "s/test_knownValues_get_builtin_module_part/_&/" \
+ tests/unittest_modutils.py || die
+
+ distutils-r1_python_prepare_all
+}
diff --git a/dev-python/astroid/files/astroid-2.4.2-no-pytest-runner.patch b/dev-python/astroid/files/astroid-2.4.2-no-pytest-runner.patch
new file mode 100644
index 00000000000..cae04e05a33
--- /dev/null
+++ b/dev-python/astroid/files/astroid-2.4.2-no-pytest-runner.patch
@@ -0,0 +1,21 @@
+diff --git a/setup.py b/setup.py
+index 016fce18..a6825d8b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -30,8 +30,6 @@ with open(os.path.join(astroid_dir, "README.rst")) as fobj:
+
+
+ needs_pytest = set(["pytest", "test", "ptr"]).intersection(sys.argv)
+-pytest_runner = ["pytest-runner"] if needs_pytest else []
+-
+
+ def install():
+ return setup(
+@@ -48,7 +46,6 @@ def install():
+ install_requires=install_requires,
+ extras_require=extras_require,
+ packages=find_packages(exclude=["tests"]) + ["astroid.brain"],
+- setup_requires=pytest_runner,
+ test_suite="test",
+ tests_require=["pytest"],
+ )
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/
@ 2020-09-10 8:48 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2020-09-10 8:48 UTC (permalink / raw
To: gentoo-commits
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)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/
@ 2021-06-05 21:01 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2021-06-05 21:01 UTC (permalink / raw
To: gentoo-commits
commit: 6cc851e7b3a167217ad2fe43ab75d11867030655
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 5 20:59:00 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 5 20:59:00 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cc851e7
dev-python/astroid: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/astroid/Manifest | 2 -
dev-python/astroid/astroid-2.5.3.ebuild | 42 --------------
dev-python/astroid/astroid-2.5.ebuild | 67 ----------------------
.../files/astroid-2.4.2-no-pytest-runner.patch | 21 -------
4 files changed, 132 deletions(-)
diff --git a/dev-python/astroid/Manifest b/dev-python/astroid/Manifest
index cefaa26dd37..11e7d42bc6f 100644
--- a/dev-python/astroid/Manifest
+++ b/dev-python/astroid/Manifest
@@ -1,4 +1,2 @@
-DIST astroid-2.5.3.tar.gz 317721 BLAKE2B 66566287fa65489064056d6dba65fd7c59cbe9e4e3d88ba5a33d08dbcf6af48b6f1eb4aafb4f7483a1fc0eb6fdd92a7bc8f1991d05cd4d589fbcc6ed6f5db769 SHA512 dbf480e86023f7d093386cc68b259d5b721717638927a893b3ade0a397b212f5f24a17c753b705cf499b47e12ab255d51126b41b5af167d5c3018f5aade1abcb
DIST astroid-2.5.6.tar.gz 345014 BLAKE2B 13916663aef712449a842e50b74ecd2e1b82817e1c128fdf9a4d5779d391deab7f806300cb6597b29920222ff041b13eb985aa395dff024af6fee628a84f883f SHA512 3d10d0f92c4b4c2d7d5e0035f23ae554b512f34ddd55b4c1c4032b328643dfe60cb4aa675a3824423fcd12baea7961847435f1894a47fafa99802f3e17a5605f
DIST astroid-2.5.7.tar.gz 352082 BLAKE2B ca52339422da3a35cbe34e4b216dbfed3979dce96a8d5fcc508083c0ef9509c491e78dcfea281b79b07fcb7289a9f40aade0da21ca38b6abcf7025b84909a4fd SHA512 17fc185752510396fda9cce842df8ba72473e469b61c037195a9d6ff72af3ec8d3df01bdcf61d6059d4f90c95278928eba3e3380048bf5c6b4fa2a3c9b267176
-DIST astroid-2.5.tar.gz 304788 BLAKE2B 3d9304dcfff72aa8172fe88b5ee53b723b47b3e602b7c30cae15a61d0cff7d578ccfde4885b56c09c8254ca3fe185fcf297bf85184d68798eb51f1860c516db6 SHA512 eba7e757a12f89a74bff579731a157fda3c8d8dd1b5a4369791d47f7f6e321b23e167260d0988d389428222c8c98929e66ad26f379ff937e274dcd1abdb3b3d2
diff --git a/dev-python/astroid/astroid-2.5.3.ebuild b/dev-python/astroid/astroid-2.5.3.ebuild
deleted file mode 100644
index 2622684a306..00000000000
--- a/dev-python/astroid/astroid-2.5.3.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..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"
-
-# Version specified in __pkginfo__.py.
-RDEPEND="
- >=dev-python/lazy-object-proxy-1.4.0[${PYTHON_USEDEP}]
- >=dev-python/wrapt-1.11.2[${PYTHON_USEDEP}]
- >=dev-python/typed-ast-1.4.0[${PYTHON_USEDEP}]"
-BDEPEND="
- test? (
- dev-python/nose[${PYTHON_USEDEP}]
- dev-python/numpy[${PYTHON_USEDEP}]
- dev-python/python-dateutil[${PYTHON_USEDEP}]
- )"
-
-distutils_enable_tests pytest
-
-python_test() {
- local deselect=(
- # no clue why it's broken
- --deselect
- tests/unittest_modutils.py::GetModulePartTest::test_knownValues_get_builtin_module_part
- )
-
- # Faker causes sys.path_importer_cache keys to be overwritten
- # with PosixPaths
- epytest -p no:faker "${deselect[@]}"
-}
diff --git a/dev-python/astroid/astroid-2.5.ebuild b/dev-python/astroid/astroid-2.5.ebuild
deleted file mode 100644
index 54a703340a6..00000000000
--- a/dev-python/astroid/astroid-2.5.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..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
-)
-
-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-no-pytest-runner.patch b/dev-python/astroid/files/astroid-2.4.2-no-pytest-runner.patch
deleted file mode 100644
index cae04e05a33..00000000000
--- a/dev-python/astroid/files/astroid-2.4.2-no-pytest-runner.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/setup.py b/setup.py
-index 016fce18..a6825d8b 100644
---- a/setup.py
-+++ b/setup.py
-@@ -30,8 +30,6 @@ with open(os.path.join(astroid_dir, "README.rst")) as fobj:
-
-
- needs_pytest = set(["pytest", "test", "ptr"]).intersection(sys.argv)
--pytest_runner = ["pytest-runner"] if needs_pytest else []
--
-
- def install():
- return setup(
-@@ -48,7 +46,6 @@ def install():
- install_requires=install_requires,
- extras_require=extras_require,
- packages=find_packages(exclude=["tests"]) + ["astroid.brain"],
-- setup_requires=pytest_runner,
- test_suite="test",
- tests_require=["pytest"],
- )
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/
@ 2024-07-08 19:22 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-07-08 19:22 UTC (permalink / raw
To: gentoo-commits
commit: 20db5ba2a46661b821c63c7a2f9c65f46bc16ffe
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 8 19:04:22 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 8 19:22:28 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20db5ba2
dev-python/astroid: Enable py3.13
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/astroid/astroid-3.2.2-r1.ebuild | 86 ++++++++++
dev-python/astroid/files/astroid-3.2.2-py313.patch | 177 +++++++++++++++++++++
2 files changed, 263 insertions(+)
diff --git a/dev-python/astroid/astroid-3.2.2-r1.ebuild b/dev-python/astroid/astroid-3.2.2-r1.ebuild
new file mode 100644
index 000000000000..a3d9b680035d
--- /dev/null
+++ b/dev-python/astroid/astroid-3.2.2-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( pypy3 python3_{10..13} )
+
+inherit distutils-r1
+
+DESCRIPTION="Abstract Syntax Tree for logilab packages"
+HOMEPAGE="
+ https://github.com/pylint-dev/astroid/
+ https://pypi.org/project/astroid/
+"
+SRC_URI="
+ https://github.com/pylint-dev/astroid/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+
+# Version specified in pyproject.toml
+RDEPEND="
+ $(python_gen_cond_dep '
+ >=dev-python/typing-extensions-4.0.0[${PYTHON_USEDEP}]
+ ' 3.10)
+"
+# dev-python/regex isn't available for pypy
+BDEPEND="
+ dev-python/setuptools-scm[${PYTHON_USEDEP}]
+ test? (
+ dev-python/attrs[${PYTHON_USEDEP}]
+ >=dev-python/numpy-1.17.0[${PYTHON_USEDEP}]
+ dev-python/python-dateutil[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/regex[${PYTHON_USEDEP}]
+ ' 'python*')
+ )
+"
+
+distutils_enable_tests pytest
+
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+
+PATCHES=(
+ # https://github.com/pylint-dev/astroid/pull/2424 (rebased)
+ "${FILESDIR}/${P}-py313.patch"
+)
+
+python_test() {
+ local EPYTEST_DESELECT=(
+ # no clue why they're broken
+ tests/test_modutils.py::GetModulePartTest::test_known_values_get_builtin_module_part
+ tests/test_regrtest.py::NonRegressionTests::test_numpy_distutils
+ # pydantic-2?
+ tests/brain/test_dataclasses.py::test_pydantic_field
+ # requires urllib3 with bundled six (skipped with urllib3>=2)
+ tests/test_modutils.py::test_file_info_from_modpath__SixMetaPathImporter
+ # hangs
+ tests/test_nodes.py::AsStringTest::test_recursion_error_trapped
+ # TODO
+ tests/test_builder.py::BuilderTest::test_data_build_error_filename
+ # numpy-2 (https://github.com/pylint-dev/astroid/issues/2442)
+ tests/brain/numpy/test_core_einsumfunc.py::test_numpy_function_calls_inferred_as_ndarray
+ tests/brain/numpy/test_core_fromnumeric.py::BrainNumpyCoreFromNumericTest::test_numpy_function_calls_inferred_as_ndarray
+ tests/brain/numpy/test_core_multiarray.py::BrainNumpyCoreMultiarrayTest::test_numpy_function_calls_inferred_as_ndarray
+ tests/brain/numpy/test_core_numerictypes.py::NumpyBrainCoreNumericTypesTest::test_datetime_astype_return
+ tests/brain/numpy/test_core_numerictypes.py::NumpyBrainCoreNumericTypesTest::test_generic_types_are_subscriptables
+ tests/brain/numpy/test_core_umath.py::NumpyBrainCoreUmathTest::test_numpy_core_umath_functions_return_type
+ tests/brain/numpy/test_core_umath.py::NumpyBrainCoreUmathTest::test_numpy_core_umath_functions_return_type_tuple
+ )
+
+ case ${EPYTHON} in
+ pypy3)
+ EPYTEST_DESELECT+=(
+ tests/test_transforms.py::TestTransforms::test_transform_aborted_if_recursion_limited
+ )
+ ;;
+ esac
+
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest
+}
diff --git a/dev-python/astroid/files/astroid-3.2.2-py313.patch b/dev-python/astroid/files/astroid-3.2.2-py313.patch
new file mode 100644
index 000000000000..f8addfe9ef7c
--- /dev/null
+++ b/dev-python/astroid/files/astroid-3.2.2-py313.patch
@@ -0,0 +1,177 @@
+diff --git a/astroid/brain/brain_dataclasses.py b/astroid/brain/brain_dataclasses.py
+index 88a4385f..743dfe96 100644
+--- a/astroid/brain/brain_dataclasses.py
++++ b/astroid/brain/brain_dataclasses.py
+@@ -19,7 +19,7 @@ from typing import Literal, Tuple, Union
+
+ from astroid import bases, context, nodes
+ from astroid.builder import parse
+-from astroid.const import PY39_PLUS, PY310_PLUS
++from astroid.const import PY39_PLUS, PY310_PLUS, PY313_PLUS
+ from astroid.exceptions import AstroidSyntaxError, InferenceError, UseInferenceDefault
+ from astroid.inference_tip import inference_tip
+ from astroid.manager import AstroidManager
+@@ -503,6 +503,15 @@ def _looks_like_dataclass_field_call(
+ return inferred.name == FIELD_NAME and inferred.root().name in DATACLASS_MODULES
+
+
++def _looks_like_dataclasses(node: nodes.Module) -> bool:
++ return node.qname() == "dataclasses"
++
++
++def _resolve_private_replace_to_public(node: nodes.Module) -> None:
++ if "_replace" in node.locals:
++ node.locals["replace"] = node.locals["_replace"]
++
++
+ def _get_field_default(field_call: nodes.Call) -> _FieldDefaultReturn:
+ """Return a the default value of a field call, and the corresponding keyword
+ argument name.
+@@ -618,6 +627,13 @@ def _infer_instance_from_annotation(
+
+
+ def register(manager: AstroidManager) -> None:
++ if PY313_PLUS:
++ manager.register_transform(
++ nodes.Module,
++ _resolve_private_replace_to_public,
++ _looks_like_dataclasses,
++ )
++
+ manager.register_transform(
+ nodes.ClassDef, dataclass_transform, is_decorated_with_dataclass
+ )
+diff --git a/astroid/brain/brain_pathlib.py b/astroid/brain/brain_pathlib.py
+index 116cd2ee..d0f53132 100644
+--- a/astroid/brain/brain_pathlib.py
++++ b/astroid/brain/brain_pathlib.py
+@@ -8,6 +8,7 @@ from collections.abc import Iterator
+
+ from astroid import bases, context, inference_tip, nodes
+ from astroid.builder import _extract_single_node
++from astroid.const import PY313_PLUS
+ from astroid.exceptions import InferenceError, UseInferenceDefault
+ from astroid.manager import AstroidManager
+
+@@ -27,10 +28,11 @@ def _looks_like_parents_subscript(node: nodes.Subscript) -> bool:
+ value = next(node.value.infer())
+ except (InferenceError, StopIteration):
+ return False
++ parents = "builtins.tuple" if PY313_PLUS else "pathlib._PathParents"
+ return (
+ isinstance(value, bases.Instance)
+ and isinstance(value._proxied, nodes.ClassDef)
+- and value.qname() == "pathlib._PathParents"
++ and value.qname() == parents
+ )
+
+
+diff --git a/astroid/brain/brain_typing.py b/astroid/brain/brain_typing.py
+index 9965abc2..7a7c7183 100644
+--- a/astroid/brain/brain_typing.py
++++ b/astroid/brain/brain_typing.py
+@@ -15,7 +15,7 @@ from typing import Final
+ from astroid import context, extract_node, inference_tip
+ from astroid.brain.helpers import register_module_extender
+ from astroid.builder import AstroidBuilder, _extract_single_node
+-from astroid.const import PY39_PLUS, PY312_PLUS
++from astroid.const import PY39_PLUS, PY312_PLUS, PY313_PLUS
+ from astroid.exceptions import (
+ AstroidSyntaxError,
+ AttributeInferenceError,
+@@ -168,6 +168,15 @@ def infer_typing_attr(
+ # If typing subscript belongs to an alias handle it separately.
+ raise UseInferenceDefault
+
++ if (
++ PY313_PLUS
++ and isinstance(value, FunctionDef)
++ and value.qname() == "typing.Annotated"
++ ):
++ # typing.Annotated is a FunctionDef on 3.13+
++ node._explicit_inference = lambda node, context: iter([value])
++ return iter([value])
++
+ if isinstance(value, ClassDef) and value.qname() in {
+ "typing.Generic",
+ "typing.Annotated",
+diff --git a/tests/brain/test_brain.py b/tests/brain/test_brain.py
+index b8bc84e3..78b6f8b3 100644
+--- a/tests/brain/test_brain.py
++++ b/tests/brain/test_brain.py
+@@ -647,7 +647,7 @@ class TypingBrain(unittest.TestCase):
+
+ @test_utils.require_version(minver="3.9")
+ def test_typing_annotated_subscriptable(self):
+- """Test typing.Annotated is subscriptable with __class_getitem__"""
++ """typing.Annotated is subscriptable with __class_getitem__ below 3.13."""
+ node = builder.extract_node(
+ """
+ import typing
+@@ -655,8 +655,13 @@ class TypingBrain(unittest.TestCase):
+ """
+ )
+ inferred = next(node.infer())
+- assert isinstance(inferred, nodes.ClassDef)
+- assert isinstance(inferred.getattr("__class_getitem__")[0], nodes.FunctionDef)
++ if PY313_PLUS:
++ assert isinstance(inferred, nodes.FunctionDef)
++ else:
++ assert isinstance(inferred, nodes.ClassDef)
++ assert isinstance(
++ inferred.getattr("__class_getitem__")[0], nodes.FunctionDef
++ )
+
+ def test_typing_generic_slots(self):
+ """Test slots for Generic subclass."""
+diff --git a/tests/brain/test_pathlib.py b/tests/brain/test_pathlib.py
+index d935d964..5aea8d37 100644
+--- a/tests/brain/test_pathlib.py
++++ b/tests/brain/test_pathlib.py
+@@ -5,7 +5,7 @@
+
+ import astroid
+ from astroid import bases
+-from astroid.const import PY310_PLUS
++from astroid.const import PY310_PLUS, PY313_PLUS
+ from astroid.util import Uninferable
+
+
+@@ -23,7 +23,10 @@ def test_inference_parents() -> None:
+ inferred = name_node.inferred()
+ assert len(inferred) == 1
+ assert isinstance(inferred[0], bases.Instance)
+- assert inferred[0].qname() == "pathlib._PathParents"
++ if PY313_PLUS:
++ assert inferred[0].qname() == "builtins.tuple"
++ else:
++ assert inferred[0].qname() == "pathlib._PathParents"
+
+
+ def test_inference_parents_subscript_index() -> None:
+@@ -40,7 +43,10 @@ def test_inference_parents_subscript_index() -> None:
+ inferred = path.inferred()
+ assert len(inferred) == 1
+ assert isinstance(inferred[0], bases.Instance)
+- assert inferred[0].qname() == "pathlib.Path"
++ if PY313_PLUS:
++ assert inferred[0].qname() == "pathlib._local.Path"
++ else:
++ assert inferred[0].qname() == "pathlib.Path"
+
+
+ def test_inference_parents_subscript_slice() -> None:
+diff --git a/tests/test_inference.py b/tests/test_inference.py
+index ec8fc71b..95f00821 100644
+--- a/tests/test_inference.py
++++ b/tests/test_inference.py
+@@ -4458,8 +4458,7 @@ class InferenceTest(resources.SysPathSetup, unittest.TestCase):
+ # and reraise it as a TypeError in Class.getitem
+ node = extract_node(
+ """
+- def test():
+- yield
++ def test(): ...
+ test()
+ """
+ )
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-08 19:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-05 21:01 [gentoo-commits] repo/gentoo:master commit in: dev-python/astroid/files/, dev-python/astroid/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-07-08 19:22 Michał Górny
2020-09-10 8:48 Michał Górny
2020-06-16 22:54 Patrick McLean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox