[bumpversion]
-current_version = 65.1.0
+current_version = 65.1.1
commit = True
tag = True
steps:
- uses: actions/checkout@v3
- name: Setup Python
- uses: actions/setup-python@v3
+ uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v3
+v65.1.1
+-------
+
+
+Misc
+^^^^
+* #3551: Avoided circular imports in meta path finder for editable installs when a
+ missing module has the same name as its parent.
+
+
v65.1.0
-------
[metadata]
name = setuptools
-version = 65.1.0
+version = 65.1.1
author = Python Packaging Authority
author_email = distutils-sig@python.org
description = Easily download, build, install, upgrade, and uninstall Python packages
False
>>> _is_nested("a.b", "path/a/b", "c", "path/c")
False
+ >>> _is_nested("a.a", "path/a/a", "a", "path/a")
+ True
+ >>> _is_nested("b.a", "path/b/a", "a", "path/a")
+ False
"""
norm_pkg_path = _normalize_path(pkg_path)
- rest = pkg.replace(parent, "").strip(".").split(".")
+ rest = pkg.replace(parent, "", 1).strip(".").split(".")
return (
pkg.startswith(parent)
and norm_pkg_path == _normalize_path(Path(parent_path, *rest))
def find_spec(cls, fullname, path=None, target=None):
for pkg, pkg_path in reversed(list(MAPPING.items())):
if fullname.startswith(pkg):
- rest = fullname.replace(pkg, "").strip(".").split(".")
+ rest = fullname.replace(pkg, "", 1).strip(".").split(".")
return cls._find_spec(fullname, Path(pkg_path, *rest))
return None
three = import_module("parent.child.three")
assert three.x == 3
+ def test_no_recursion(self, tmp_path):
+ # See issue #3550
+ files = {
+ "pkg": {
+ "__init__.py": "from . import pkg",
+ },
+ }
+ jaraco.path.build(files, prefix=tmp_path)
+
+ mapping = {
+ "pkg": str(tmp_path / "pkg"),
+ }
+ template = _finder_template(str(uuid4()), mapping, {})
+
+ with contexts.save_paths(), contexts.save_sys_modules():
+ sys.modules.pop("pkg", None)
+
+ self.install_finder(template)
+ with pytest.raises(ImportError, match="pkg"):
+ import_module("pkg")
+
def test_pkg_roots(tmp_path):
"""This test focus in getting a particular implementation detail right.