Imported Upstream version 54.2.0 upstream/54.2.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 18 Jul 2022 06:38:59 +0000 (15:38 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 18 Jul 2022 06:38:59 +0000 (15:38 +0900)
CHANGES.rst
PKG-INFO
setup.cfg
setuptools.egg-info/PKG-INFO
setuptools/build_meta.py
setuptools/tests/test_build_meta.py

index 8612991..dca490b 100644 (file)
@@ -1,3 +1,13 @@
+v54.2.0
+-------
+
+
+Changes
+^^^^^^^
+* #2608: Added informative error message to PEP 517 build failures owing to
+  an empty ``setup.py`` -- by :user:`layday`
+
+
 v54.1.3
 -------
 
index 12b2bc2..a613902 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: setuptools
-Version: 54.1.3
+Version: 54.2.0
 Summary: Easily download, build, install, upgrade, and uninstall Python packages
 Home-page: https://github.com/pypa/setuptools
 Author: Python Packaging Authority
index 2fafa64..111a0cd 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
 license_files = 
        LICENSE
 name = setuptools
-version = 54.1.3
+version = 54.2.0
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
 description = Easily download, build, install, upgrade, and uninstall Python packages
index 12b2bc2..a613902 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: setuptools
-Version: 54.1.3
+Version: 54.2.0
 Summary: Easily download, build, install, upgrade, and uninstall Python packages
 Home-page: https://github.com/pypa/setuptools
 Author: Python Packaging Authority
index b9e8a2b..9dfb2f2 100644 (file)
@@ -101,7 +101,12 @@ def _file_with_extension(directory, extension):
         f for f in os.listdir(directory)
         if f.endswith(extension)
     )
-    file, = matching
+    try:
+        file, = matching
+    except ValueError:
+        raise ValueError(
+            'No distribution was found. Ensure that `setup.py` '
+            'is not empty and that it calls `setup()`.')
     return file
 
 
index f33a696..ab75a18 100644 (file)
@@ -3,6 +3,7 @@ import shutil
 import tarfile
 import importlib
 from concurrent import futures
+import re
 
 import pytest
 from jaraco import path
@@ -442,6 +443,16 @@ class TestBuildMetaBackend:
         with pytest.raises(AssertionError):
             build_backend.build_sdist("temp")
 
+    @pytest.mark.parametrize('build_hook', ('build_sdist', 'build_wheel'))
+    def test_build_with_empty_setuppy(self, build_backend, build_hook):
+        files = {'setup.py': ''}
+        path.build(files)
+
+        with pytest.raises(
+                ValueError,
+                match=re.escape('No distribution was found.')):
+            getattr(build_backend, build_hook)("temp")
+
 
 class TestBuildMetaLegacyBackend(TestBuildMetaBackend):
     backend_name = 'setuptools.build_meta:__legacy__'