Skip to content

Commit 7297000

Browse files
pipcl.py: build_sdist(): assert-fail if sdist not specified.
Previously we would create empty sdist with just the metadata.
1 parent 8f0e5cc commit 7297000

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pipcl.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ def build_sdist(self,
796796
797797
Returns leafname of generated archive within `sdist_directory`.
798798
'''
799+
assert self.fn_sdist, f'fn_sdist() not provided.'
799800
log2(
800801
f' sdist_directory={sdist_directory!r}'
801802
f' formats={formats!r}'
@@ -804,11 +805,10 @@ def build_sdist(self,
804805
if formats and formats != 'gztar':
805806
raise Exception( f'Unsupported: formats={formats}')
806807
items = list()
807-
if self.fn_sdist:
808-
if inspect.signature(self.fn_sdist).parameters:
809-
items = self.fn_sdist(config_settings)
810-
else:
811-
items = self.fn_sdist()
808+
if inspect.signature(self.fn_sdist).parameters:
809+
items = self.fn_sdist(config_settings)
810+
else:
811+
items = self.fn_sdist()
812812

813813
prefix = f'{_normalise2(self.name)}-{self.version}'
814814
os.makedirs(sdist_directory, exist_ok=True)

0 commit comments

Comments
 (0)