setup.py: override modules to stop auto-detection

Some of our jobs have started failing with

   error: Multiple top-level packages discovered in a flat-layout:
   ['roles', 'playbooks'].
   ... <and so on> ...

which seems to be a combination of jobs that don't run often and some
recent-ish version of setuptools/pip.  From what I can tell, what we
want to do here is disable autodetection as what we have isn't really
a python distributable package.

Also fix the two places this is monkey-patched in over the existing
file.

Change-Id: I2a0dfbbedbb9bddd34b6af691118cf7c422a82b0
This commit is contained in:
Ian Wienand 2022-07-27 05:41:20 +10:00
parent e0a2b647a6
commit 95d53aa40e
3 changed files with 6 additions and 3 deletions

View File

@ -25,4 +25,7 @@ except ImportError:
setuptools.setup(
setup_requires=['pbr>=2.0'],
pbr=True)
pbr=True,
# Override this to avoid trying to autodetect modules for
# packaging, as some roles have .py files
py_modules=[])

View File

@ -25,7 +25,7 @@
dest: tox.ini
- content: |
import setuptools
setuptools.setup()
setuptools.setup(py_modules=[])
dest: setup.py
- content: ""
dest: setup.cfg

View File

@ -19,7 +19,7 @@
dest: tox.ini
- content: |
import setuptools
setuptools.setup()
setuptools.setup(py_modules=[])
dest: setup.py
- content: ""
dest: setup.cfg