Skip to content

Commit e610877

Browse files
authored
Ignore UNIX socket files (#1318)
1 parent 0ef704b commit e610877

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

backend/src/hatchling/builders/sdist.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def create_file(self, contents: str | bytes, *relative_paths: str) -> None:
5454
with closing(BytesIO(contents)) as buffer:
5555
self.tf.addfile(tar_info, buffer)
5656

57-
def normalize_tar_metadata(self, tar_info: tarfile.TarInfo) -> tarfile.TarInfo:
58-
if not self.reproducible:
57+
def normalize_tar_metadata(self, tar_info: tarfile.TarInfo | None) -> tarfile.TarInfo | None:
58+
if not self.reproducible or tar_info is None:
5959
return tar_info
6060

6161
tar_info = copy(tar_info)
@@ -178,6 +178,8 @@ def build_standard(self, directory: str, **build_data: Any) -> str:
178178
os.path.join(self.artifact_project_id, included_file.distribution_path)
179179
),
180180
)
181+
if tar_info is None: # no cov
182+
continue
181183

182184
if tar_info.isfile():
183185
with open(included_file.path, 'rb') as f:

docs/history/hatchling.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2525
- Fix default wheel tag when the supported Python version declaration is strict
2626
- Load VCS ignore patterns first so that whitelisted patterns can be excluded by project configuration
2727
- Don't consider VCS ignore files that are outside of the VCS boundary
28+
- The `sdist` build target now gracefully ignores UNIX socket files
2829
- Metadata for the `wheel` target now defaults to the `PKG-INFO` metadata within source distributions
2930
- Properly support core metadata version 2.2
3031

0 commit comments

Comments
 (0)