diff --git a/rope/contrib/autoimport/utils.py b/rope/contrib/autoimport/utils.py index f3f581159..5932f9bc2 100644 --- a/rope/contrib/autoimport/utils.py +++ b/rope/contrib/autoimport/utils.py @@ -22,6 +22,8 @@ def get_package_tuple( package_type: PackageType if package_name.startswith(".") or package_name == "__pycache__": return None + if "site-packages" in package_name: + return None if package_name.endswith((".egg-info", ".dist-info")): return None if package_path.is_file(): diff --git a/ropetest/contrib/autoimport/deptest.py b/ropetest/contrib/autoimport/deptest.py index 938e75606..9dcefd132 100644 --- a/ropetest/contrib/autoimport/deptest.py +++ b/ropetest/contrib/autoimport/deptest.py @@ -21,7 +21,7 @@ def project(request, tmp_path: Path) -> Iterable[Project]: @pytest.fixture def autoimport(project) -> Iterable[AutoImport]: - autoimport = AutoImport(project) + autoimport = AutoImport(project, memory=True) autoimport.generate_modules_cache() yield autoimport autoimport.close()