From 95d53aa40eff5790db23a6a163f2c35424f682e4 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 27 Jul 2022 05:41:20 +1000 Subject: [PATCH] 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']. ... ... 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 --- setup.py | 5 ++++- test-playbooks/python/fetch-subunit-output.yaml | 2 +- test-playbooks/python/fetch-tox-output.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5343f6d1d..3e9e1fedb 100644 --- a/setup.py +++ b/setup.py @@ -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=[]) diff --git a/test-playbooks/python/fetch-subunit-output.yaml b/test-playbooks/python/fetch-subunit-output.yaml index d6c4c98a8..c308241f9 100644 --- a/test-playbooks/python/fetch-subunit-output.yaml +++ b/test-playbooks/python/fetch-subunit-output.yaml @@ -25,7 +25,7 @@ dest: tox.ini - content: | import setuptools - setuptools.setup() + setuptools.setup(py_modules=[]) dest: setup.py - content: "" dest: setup.cfg diff --git a/test-playbooks/python/fetch-tox-output.yaml b/test-playbooks/python/fetch-tox-output.yaml index 4e10f5a97..3c3d3bfb1 100644 --- a/test-playbooks/python/fetch-tox-output.yaml +++ b/test-playbooks/python/fetch-tox-output.yaml @@ -19,7 +19,7 @@ dest: tox.ini - content: | import setuptools - setuptools.setup() + setuptools.setup(py_modules=[]) dest: setup.py - content: "" dest: setup.cfg