From 2d027c43375a04bfc113e92cefe120b69e092694 Mon Sep 17 00:00:00 2001 From: tkrabel Date: Wed, 1 Nov 2023 18:00:57 +0100 Subject: [PATCH 1/4] Remove site-packages from packages search tree --- rope/contrib/autoimport/sqlite.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rope/contrib/autoimport/sqlite.py b/rope/contrib/autoimport/sqlite.py index eb7c27ded..2943dc9ee 100644 --- a/rope/contrib/autoimport/sqlite.py +++ b/rope/contrib/autoimport/sqlite.py @@ -529,6 +529,7 @@ def _get_packages_from_cache(self) -> List[str]: chain(*self._execute(models.Package.objects.select_star()).fetchall()) ) existing.append(self.project_package.name) + existing.append("site-packages") return existing def _removed(self, resource): From 2bcb183d326ffae8f8ab7e7a13e8199e5d607145 Mon Sep 17 00:00:00 2001 From: tkrabel Date: Wed, 1 Nov 2023 18:04:06 +0100 Subject: [PATCH 2/4] add CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c0104fa..79fce5246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - #710, #561 Implement `except*` syntax (@lieryan) - #711 allow building documentation without having rope module installed (@kloczek) +- #722 speed up module cache generation by factor of 2 (@tkrabel) # Release 1.10.0 From 7884d9c9b68b4516657a39388cdf4fe205169950 Mon Sep 17 00:00:00 2001 From: tkrabel Date: Thu, 2 Nov 2023 16:12:20 +0100 Subject: [PATCH 3/4] move site-packages check to get_package_touple --- rope/contrib/autoimport/sqlite.py | 1 - rope/contrib/autoimport/utils.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/rope/contrib/autoimport/sqlite.py b/rope/contrib/autoimport/sqlite.py index 2943dc9ee..eb7c27ded 100644 --- a/rope/contrib/autoimport/sqlite.py +++ b/rope/contrib/autoimport/sqlite.py @@ -529,7 +529,6 @@ def _get_packages_from_cache(self) -> List[str]: chain(*self._execute(models.Package.objects.select_star()).fetchall()) ) existing.append(self.project_package.name) - existing.append("site-packages") return existing def _removed(self, resource): diff --git a/rope/contrib/autoimport/utils.py b/rope/contrib/autoimport/utils.py index f3f581159..5238339de 100644 --- a/rope/contrib/autoimport/utils.py +++ b/rope/contrib/autoimport/utils.py @@ -20,7 +20,7 @@ def get_package_tuple( """ package_name = package_path.name package_type: PackageType - if package_name.startswith(".") or package_name == "__pycache__": + if package_name.startswith(".") or package_name in ["__pycache__", "site-packages"]: return None if package_name.endswith((".egg-info", ".dist-info")): return None From 913d56eaa1c8f61a0d5baa919051bec0a3dff153 Mon Sep 17 00:00:00 2001 From: tkrabel Date: Thu, 2 Nov 2023 16:16:59 +0100 Subject: [PATCH 4/4] Fix typo --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79fce5246..a071a9bac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # **Upcoming release** - #710, #561 Implement `except*` syntax (@lieryan) -- #711 allow building documentation without having rope module installed (@kloczek) -- #722 speed up module cache generation by factor of 2 (@tkrabel) +- #711 Allow building documentation without having rope module installed (@kloczek) +- #722 Speed up module cache generation by factor of 2 (@tkrabel) # Release 1.10.0