From 8bb4ac0f8da1494efde63b0ef296132460274b3e Mon Sep 17 00:00:00 2001 From: Nowa Ammerlaan Date: Thu, 2 Jan 2025 15:14:31 +0100 Subject: [PATCH 1/5] type_hinting/utils.py: python3.13 removes collections.abc instead use _collections_abc for the alias Bug: https://github.com/python-rope/rope/issues/801 Signed-off-by: Nowa Ammerlaan --- rope/base/oi/type_hinting/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: From 90e2451d2dc67923f63ba66ea6e35718537bff9e Mon Sep 17 00:00:00 2001 From: Nowa Ammerlaan Date: Thu, 2 Jan 2025 15:15:46 +0100 Subject: [PATCH 2/5] autoimport/sqlite.py: python3.13 iterdir() raises PermissionError The PermissionError is now raised earlier when we initialize the iterdir object instead of when we attempt to get the next() Closes: https://github.com/python-rope/rope/issues/801 Signed-off-by: Nowa Ammerlaan --- rope/contrib/autoimport/sqlite.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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] = [ From 9064a974794931c05dce3f0578b3988de3c82b36 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Sun, 17 Nov 2024 23:20:35 +1100 Subject: [PATCH 3/5] Update GHA Python versions Remove 3.8, add 3.12 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d764ff437..c37c20ec9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false steps: From 5709c7f1116feb9460f52e2b2457f9906cf804a4 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Sun, 13 Jul 2025 02:14:53 +1000 Subject: [PATCH 4/5] Add explicit sphinx.configuration key This is now required according to "Deprecation of projects using Sphinx or MkDocs without an explicit configuration file" Ref: https://about.readthedocs.com/blog/2024/12/deprecate-config-files-without-sphinx-or-mkdocs-config/ --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d7fcbf8d0..badd01dd8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,3 +11,6 @@ python: path: . extra_requirements: - doc + +sphinx: + configuration: docs/conf.py From 10b00a592ebb857bc8ba52c81be43b695b547ab0 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Sun, 13 Jul 2025 02:17:37 +1000 Subject: [PATCH 5/5] Black formatting --- rope/contrib/autoimport/utils.py | 2 +- rope/refactor/importutils/module_imports.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rope/contrib/autoimport/utils.py b/rope/contrib/autoimport/utils.py index a16efba05..11ee6f20e 100644 --- a/rope/contrib/autoimport/utils.py +++ b/rope/contrib/autoimport/utils.py @@ -92,7 +92,7 @@ def sort_and_deduplicate(results: List[Tuple[str, int]]) -> List[str]: def sort_and_deduplicate_tuple( - results: List[Tuple[str, str, int]] + results: List[Tuple[str, str, int]], ) -> List[Tuple[str, str]]: """Sort and deduplicate a list of name, module, source entries.""" results = sorted(results, key=lambda y: y[-1]) diff --git a/rope/refactor/importutils/module_imports.py b/rope/refactor/importutils/module_imports.py index 8ccbb3663..f35b22521 100644 --- a/rope/refactor/importutils/module_imports.py +++ b/rope/refactor/importutils/module_imports.py @@ -31,7 +31,7 @@ def _get_unbound_names(self, defined_pyobject): def _get_all_star_list(self, pymodule): def _resolve_name( - name: Union[pynamesdef.AssignedName, pynames.ImportedName] + name: Union[pynamesdef.AssignedName, pynames.ImportedName], ) -> List: while isinstance(name, pynames.ImportedName): try: