summaryrefslogtreecommitdiff
path: root/setuptools/command/build_py.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-04-10 03:07:33 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-06-15 16:43:53 +0100
commit50afbf41f470e75f67afe957023b3e03e3d41edc (patch)
tree0976da37cc7eefde137ffd33fca1fb42f1ee618d /setuptools/command/build_py.py
parentf5643f55398742ce63264e42c4232faa420e18c4 (diff)
downloadpython-setuptools-git-50afbf41f470e75f67afe957023b3e03e3d41edc.tar.gz
Add LinkTree strategy for build executable
Diffstat (limited to 'setuptools/command/build_py.py')
-rw-r--r--setuptools/command/build_py.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py
index 2fced3d6..9575cdf8 100644
--- a/setuptools/command/build_py.py
+++ b/setuptools/command/build_py.py
@@ -36,6 +36,17 @@ class build_py(orig.build_py):
if 'data_files' in self.__dict__:
del self.__dict__['data_files']
self.__updated_files = []
+ self.use_links = None
+
+ def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1,
+ link=None, level=1):
+ # Overwrite base class to allow using links
+ link = getattr(self, "use_links", None) if link is None else link
+ if link:
+ infile = str(Path(infile).resolve())
+ outfile = str(Path(outfile).resolve())
+ return super().copy_file(infile, outfile, preserve_mode,
+ preserve_times, link, level)
def run(self):
"""Build modules, packages, and copy data files to build directory"""