commit:     9eca25c48c05a415754882e34bf88d5961006bd5
Author:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  2 14:26:16 2025 +0000
Commit:     Nowa Ammerlaan <nowa <AT> gentoo <DOT> org>
CommitDate: Thu Jan  2 15:19:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9eca25c4

dev-python/rope: patch and enable python3.13

Signed-off-by: Nowa Ammerlaan <nowa <AT> gentoo.org>

 dev-python/rope/files/rope-1.13.0-python3.13.patch | 55 ++++++++++++++++++++++
 dev-python/rope/rope-1.13.0-r1.ebuild              | 48 +++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/dev-python/rope/files/rope-1.13.0-python3.13.patch 
b/dev-python/rope/files/rope-1.13.0-python3.13.patch
new file mode 100644
index 000000000000..6c1e6deb47a4
--- /dev/null
+++ b/dev-python/rope/files/rope-1.13.0-python3.13.patch
@@ -0,0 +1,55 @@
+diff --git a/rope/base/oi/type_hinting/utils.py 
b/rope/base/oi/type_hinting/utils.py
+index b0a7aff97..2381c8472 100644
+--- a/rope/base/oi/type_hinting/utils.py
++++ b/rope/base/oi/type_hinting/utils.py
+@@ -1,6 +1,7 @@
+ from __future__ import annotations
+ 
+ import logging
++import sys
+ from typing import TYPE_CHECKING, Optional, Union
+ 
+ import rope.base.utils as base_utils
+@@ -81,7 +82,10 @@ def resolve_type(
+     """
+     Find proper type object from its name.
+     """
+-    deprecated_aliases = {"collections": "collections.abc"}
++    if sys.version_info < (3, 13):
++        deprecated_aliases = {"collections": "collections.abc"}
++    else:
++        deprecated_aliases = {"collections": "_collections_abc"}
+     ret_type = None
+     logging.debug("Looking for %s", type_name)
+     if "." not in type_name:
+
+diff --git a/rope/contrib/autoimport/sqlite.py 
b/rope/contrib/autoimport/sqlite.py
+index 54a6d03cf..f06fdaca3 100644
+--- a/rope/contrib/autoimport/sqlite.py
++++ b/rope/contrib/autoimport/sqlite.py
+@@ -569,14 +569,17 @@ def filter_folders(folder: Path) -> bool:
+         return list(OrderedDict.fromkeys(folder_paths))
+ 
+     def _safe_iterdir(self, folder: Path):
+-        dirs = folder.iterdir()
+-        while True:
+-            try:
+-                yield next(dirs)
+-            except PermissionError:
+-                pass
+-            except StopIteration:
+-                break
++        try:
++            dirs = folder.iterdir()
++            while True:
++                try:
++                    yield next(dirs)
++                except PermissionError:
++                    pass
++                except StopIteration:
++                    break
++        except PermissionError:
++            pass
+ 
+     def _get_available_packages(self) -> List[Package]:
+         packages: List[Package] = [

diff --git a/dev-python/rope/rope-1.13.0-r1.ebuild 
b/dev-python/rope/rope-1.13.0-r1.ebuild
new file mode 100644
index 000000000000..33e3ad7738ee
--- /dev/null
+++ b/dev-python/rope/rope-1.13.0-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="Python refactoring library"
+HOMEPAGE="
+       https://pypi.org/project/rope/
+       https://github.com/python-rope/rope/
+"
+
+LICENSE="LGPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+IUSE="doc"
+
+RDEPEND="
+       >=dev-python/pytoolconfig-1.2.2[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       test? (
+               dev-python/build[${PYTHON_USEDEP}]
+               dev-python/pip[${PYTHON_USEDEP}]
+               dev-python/pytest-timeout[${PYTHON_USEDEP}]
+       )
+"
+
+PATCHES=(
+       # https://github.com/python-rope/rope/pull/809
+       "${FILESDIR}/${PN}-1.13.0-python3.13.patch"
+)
+
+distutils_enable_tests pytest
+
+EPYTEST_DESELECT=(
+       # our venv style confuses this comparison
+       ropetest/contrib/autoimport/utilstest.py::test_get_package_source_typing
+       ropetest/contrib/autoimport/utilstest.py::test_get_package_tuple_typing
+       
ropetest/contrib/autoimport/utilstest.py::test_get_package_tuple_compiled
+       # TODO
+       
ropetest/contrib/autoimport/autoimporttest.py::TestQueryUsesIndexes::test_search_by_name_like_uses_index
+       
ropetest/contrib/autoimport/autoimporttest.py::TestQueryUsesIndexes::test_search_module_like_uses_index
+)

Reply via email to