summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-06-24 23:23:59 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-06-25 20:07:27 +0100
commit0a82048ee585efbd85656047843e29792cf84a3a (patch)
treeff26f4041107b0aa88e75264eb5bf9bf4ddd3803 /setuptools/command
parent2ee94e7e40379d348cdadbb747fbbcf5a6f228c6 (diff)
downloadpython-setuptools-git-0a82048ee585efbd85656047843e29792cf84a3a.tar.gz
Test symlinks in the target directory
Improve chances that symlinks are tested directly on the relevant file system (some machines might have multiple disks with different link support).
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/editable_wheel.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/setuptools/command/editable_wheel.py b/setuptools/command/editable_wheel.py
index bd580acb..8a0fb8bc 100644
--- a/setuptools/command/editable_wheel.py
+++ b/setuptools/command/editable_wheel.py
@@ -339,7 +339,8 @@ class _LinkTree(_StaticPth):
self._file(src_file, dest, link=link)
def _create_links(self, outputs, output_mapping):
- link_type = "sym" if _can_symlink_files() else "hard"
+ self.auxiliary_dir.mkdir(parents=True, exist_ok=True)
+ link_type = "sym" if _can_symlink_files(self.auxiliary_dir) else "hard"
mappings = {
self._normalize_output(k): v
for k, v in output_mapping.items()
@@ -403,8 +404,8 @@ class _TopLevelFinder:
...
-def _can_symlink_files() -> bool:
- with TemporaryDirectory() as tmp:
+def _can_symlink_files(base_dir: Path) -> bool:
+ with TemporaryDirectory(dir=str(base_dir.resolve())) as tmp:
path1, path2 = Path(tmp, "file1.txt"), Path(tmp, "file2.txt")
path1.write_text("file1", encoding="utf-8")
with suppress(AttributeError, NotImplementedError, OSError):