Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# Copyright 2024 Arm Limited and/or its affiliates.
# All rights reserved.
Expand Down Expand Up @@ -550,6 +550,21 @@
a file to a different relative location under the output package directory.
"""

def analyze_manifest(self):
super().analyze_manifest()
# Recent versions of setuptools may include bare directory symlinks from version
# control (e.g. src/executorch/{backends,codegen,data,...} ->
# ../../<name>) in manifest_files. These exist for editable mode but
# break regular installs: build_package_data passes them to copy_file,
# which calls os.path.isfile() and gets False for a symlink-to-directory.
if not self.editable_mode:
_root = os.path.dirname(os.path.abspath(__file__))
for _pkg in list(self.manifest_files):
self.manifest_files[_pkg] = [
_f for _f in self.manifest_files[_pkg]
if os.path.isfile(os.path.join(_root, _f))
]

def run(self):
# Copy python files to the output directory. This set of files is
# defined by the py_module list and package_data patterns.
Expand Down
Loading