From ac3f658a202069d91f254bec7f65a40a9d5f1fae Mon Sep 17 00:00:00 2001
From: Jiri Podivin <jpodivin@redhat.com>
Date: Tue, 29 Mar 2022 10:37:24 +0200
Subject: [PATCH] setuptools: Disable auto discovery

The latest release of setuptools 61.0 made a breaking change[1] and
because of this change 'pip install' fails with the following error.

~~~
error: Multiple top-level packages discovered in a flat-layout:
['lib', 'spec', 'manifests', 'releasenotes'].
~~~

Users that don't set 'packages', 'py_modules', or configuration'
are still likely to observe the auto-discovery behavior, which may
halt the build if the project contains multiple directories and/or
multiple Python files directly under the project root.

To disable auto discovery, one can do below in setup.py

~~~
setuptools.setup(..,packages=[],..)
~~~

or

~~~
setuptools.setup(..,py_modules=[],..)
~~~

[1] https://github.com/pypa/setuptools/issues/3197

Note setup.py is not used to install puppet modules. However it is used
to generate a release note, thus should be fixed.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: I1777e91b28974980c3d32341435538128a66872c
---
 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index cd35c3c3..31d6ada1 100644
--- a/setup.py
+++ b/setup.py
@@ -17,4 +17,5 @@ import setuptools
 
 setuptools.setup(
     setup_requires=['pbr>=2.0.0'],
+    py_modules=[],
     pbr=True)