summaryrefslogtreecommitdiff
path: root/setuptools/build_meta.py
diff options
context:
space:
mode:
authorlayday <layday@protonmail.com>2021-03-16 18:58:11 +0200
committerlayday <layday@protonmail.com>2021-03-16 19:06:29 +0200
commit024b1e13b644cc9829d2a15cd5867920e11c9a9e (patch)
treef9036b027b5541e7e5c7fd1d44a616d3d02d8535 /setuptools/build_meta.py
parent8230bbf82b07d25bcc65e612e0e936dce269e463 (diff)
downloadpython-setuptools-git-024b1e13b644cc9829d2a15cd5867920e11c9a9e.tar.gz
build_meta: produce informative error when a dist is not found
Previously, when `build_sdist` or `build_wheel` were unable to build a distribution (and were therefore unable to find the distribution file), they would throw a ValueError: not enough values to unpack (expected 1, got 0) which did not offer any clues as to where the issue might lie.
Diffstat (limited to 'setuptools/build_meta.py')
-rw-r--r--setuptools/build_meta.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py
index b9e8a2b3..3c45db72 100644
--- a/setuptools/build_meta.py
+++ b/setuptools/build_meta.py
@@ -101,8 +101,12 @@ def _file_with_extension(directory, extension):
f for f in os.listdir(directory)
if f.endswith(extension)
)
- file, = matching
- return file
+ try:
+ return next(matching)
+ except StopIteration:
+ raise ValueError('No distribution was found. The distribution was '
+ 'possibly not built. Ensure that your `setup.py` '
+ 'is not empty and that it calls `setup()`.')
def _open_setup_script(setup_script):