From 9970f16541a478e5d80be8e5c62ae2ffd320a0bb Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 26 Aug 2024 17:50:16 +1200 Subject: [PATCH 1/2] Ignore vendored .dist-info folders. --- changes/1970.bugfix.rst | 1 + src/briefcase/platforms/macOS/utils.py | 2 +- ...est_AppPackagesMergeMixin__find_binary_packages.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 changes/1970.bugfix.rst diff --git a/changes/1970.bugfix.rst b/changes/1970.bugfix.rst new file mode 100644 index 000000000..890b2fcdf --- /dev/null +++ b/changes/1970.bugfix.rst @@ -0,0 +1 @@ +Packages that include ``.dist-info`` content in vendored dependencies are now ignored as part of the binary widening process on macOS. If a binary package has vendored subpackages, it is assumed that the top-level package includes the vendored package's files in it's wheel manifest. diff --git a/src/briefcase/platforms/macOS/utils.py b/src/briefcase/platforms/macOS/utils.py index 16c90b1cf..d08624619 100644 --- a/src/briefcase/platforms/macOS/utils.py +++ b/src/briefcase/platforms/macOS/utils.py @@ -41,7 +41,7 @@ def find_binary_packages( are in the install path that are non-universal and non-pure. """ binary_packages = [] - for distinfo in install_path.glob("**/*.dist-info"): + for distinfo in install_path.glob("*.dist-info"): # Read the WHEEL file in the dist-info folder. # Use this to determine if the wheel is "pure", and the tag # for the wheel. diff --git a/tests/platforms/macOS/test_AppPackagesMergeMixin__find_binary_packages.py b/tests/platforms/macOS/test_AppPackagesMergeMixin__find_binary_packages.py index 9a7c145c5..7f8088572 100644 --- a/tests/platforms/macOS/test_AppPackagesMergeMixin__find_binary_packages.py +++ b/tests/platforms/macOS/test_AppPackagesMergeMixin__find_binary_packages.py @@ -37,6 +37,17 @@ def test_find_binary_packages(dummy_command, tmp_path): "binary-package-2", version="3.4.6", tag="macOS_13_arm64", + extra_content=[ + # A vendored, but incomplete .dist-info folder. See #1970 + ("vendored/nested-incomplete.dist-info/LICENSE", "Nested License", 0o644), + ], + ) + # A vendored .dist-info folder. This *isn't* found and processed. + create_installed_package( + tmp_path / "app-packages/binary-package-2/vendored", + "nested-package", + version="9.9.9", + tag="macOS_13_arm64", ) binary_packages = dummy_command.find_binary_packages( From 438c6ff177d44eebd970036201094c1541b9117d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 27 Aug 2024 11:57:06 +0800 Subject: [PATCH 2/2] Correct punctuation in release note. Co-authored-by: Russell Martin --- changes/1970.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes/1970.bugfix.rst b/changes/1970.bugfix.rst index 890b2fcdf..6010aab56 100644 --- a/changes/1970.bugfix.rst +++ b/changes/1970.bugfix.rst @@ -1 +1 @@ -Packages that include ``.dist-info`` content in vendored dependencies are now ignored as part of the binary widening process on macOS. If a binary package has vendored subpackages, it is assumed that the top-level package includes the vendored package's files in it's wheel manifest. +Packages that include ``.dist-info`` content in vendored dependencies are now ignored as part of the binary widening process on macOS. If a binary package has vendored subpackages, it is assumed that the top-level package includes the vendored packages' files in its wheel manifest.