Skip to content

Commit 5207a30

Browse files
authored
Merge pull request #159 from cmake-wheel/lnk
Handle symlinks and hardlinks in sdist
2 parents 1f54ada + 5a6ee11 commit 5207a30

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.mergify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pull_request_rules:
1515
- check-success = "Editable 3.9 on macos-latest"
1616
- check-success = "Editable 3.9 on ubuntu-latest"
1717
- check-success = "lint"
18-
- check-success = "Nix build on linux"
1918
- check-success = "Nix build on macos"
19+
- check-success = "Nix build on ubuntu"
2020
- check-success = "Test 3.10 on macos-latest"
2121
- check-success = "Test 3.10 on ubuntu-latest"
2222
- check-success = "Test 3.11 on macos-latest"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- Handle symlinks and hardlinks in sdist
11+
1012
## [v0.57.2] - 2025-03-19
1113

1214
- Fix symlink issue in sdist

cmeel/sdist.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ def sdist_impl(sdist_directory) -> str:
5252
LOG.info("create final archive with previous one + PKG-INFO")
5353
with tarfile.open(tmp_tar, "r") as tr, tarfile.open(def_tar, "w:gz") as tw:
5454
for member in tr.getmembers():
55-
tw.addfile(member, tr.extractfile(member))
55+
fileobj = None
56+
if member.type not in [tarfile.LNKTYPE, tarfile.SYMTYPE]:
57+
fileobj = tr.extractfile(member)
58+
tw.addfile(member, fileobj)
5659
tw.add(str(tmp_pkg), f"{distribution}/PKG-INFO")
5760

5861
return distribution

0 commit comments

Comments
 (0)