From 8afd3a3a61949aba151c9dc0c9d7520d73ee8b9e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Feb 2022 10:22:27 -0500 Subject: [PATCH] Ensure that _vendor/jaraco is available as a module. Fixes #3084. --- changelog.d/3084.misc.rst | 1 + pkg_resources/_vendor/jaraco/__init__.py | 0 setuptools/_vendor/jaraco/__init__.py | 0 tools/vendored.py | 2 ++ 4 files changed, 3 insertions(+) create mode 100644 changelog.d/3084.misc.rst create mode 100644 pkg_resources/_vendor/jaraco/__init__.py create mode 100644 setuptools/_vendor/jaraco/__init__.py diff --git a/changelog.d/3084.misc.rst b/changelog.d/3084.misc.rst new file mode 100644 index 0000000000..4e81fcafa5 --- /dev/null +++ b/changelog.d/3084.misc.rst @@ -0,0 +1 @@ +When vendoring jaraco packages, ensure the namespace package is converted to a simple package to support zip importer. diff --git a/pkg_resources/_vendor/jaraco/__init__.py b/pkg_resources/_vendor/jaraco/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/setuptools/_vendor/jaraco/__init__.py b/setuptools/_vendor/jaraco/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/vendored.py b/tools/vendored.py index 9d832a0850..57e28d53c4 100644 --- a/tools/vendored.py +++ b/tools/vendored.py @@ -50,6 +50,8 @@ def rewrite_jaraco(pkg_files, new_root): text = file.read_text() text = re.sub(r' (more_itertools)', rf' {new_root}.\1', text) file.write_text(text) + # required for zip-packaged setuptools #3084 + pkg_files.joinpath('__init__.py').write_text('') def rewrite_importlib_resources(pkg_files, new_root):