From 008b0d7e83bb75d89fed85db0a4a422519fd246b Mon Sep 17 00:00:00 2001 From: Elod Illes Date: Sat, 26 Mar 2022 11:33:35 +0100 Subject: [PATCH] Disable auto-discovery for setuptools With setuptools release 61.0.0 sahara-image-elements' package build command (python3 setup.py sdist bdist_wheel) started to fail: error: Multiple top-level packages discovered in a flat-layout: ['roles', 'elements', 'playbooks']. This bug is mentioned in setuptools issue 3197 [1], and the suggested workaround is to disable auto-discovery by adding 'py_modules=[]' in setup.py. To unblock the gate the following needed to be updated as well: - requirements constraints - fix lower-constraints job constraints (only the 1st constraints is used by pip, which was upper-constraints.txt from install command) [1] https://github.com/pypa/setuptools/issues/3197 Change-Id: Ib2d3e296e6d405671594dfd630e381ae414a2709 --- lower-constraints.txt | 16 ++++++++-------- setup.py | 3 ++- test-requirements.txt | 4 ++-- tox.ini | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index d4424463..7144c01b 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,15 +1,15 @@ Babel==2.5.3 -bashate==0.5.1 +bashate==2.1.0 decorator==4.2.1 -dib-utils==0.0.11 -diskimage-builder==2.11.0 -flake8==2.5.5 -hacking==0.12.0 -mccabe==0.2.1 +dib-utils==0.0.8 +diskimage-builder==1.1.2 +flake8==3.6.0 +hacking==3.0.1 +mccabe==0.6.0 networkx==1.11 -pbr==3.1.1 +pbr==2.0.0 pep8==1.5.7 -pyflakes==0.8.1 +pyflakes==2.0.0 pytz==2018.3 PyYAML==3.12 six==1.11.0 diff --git a/setup.py b/setup.py index cd35c3c3..5019c359 100644 --- a/setup.py +++ b/setup.py @@ -17,4 +17,5 @@ import setuptools setuptools.setup( setup_requires=['pbr>=2.0.0'], - pbr=True) + pbr=True, + py_modules=[]) diff --git a/test-requirements.txt b/test-requirements.txt index 8be03c25..8567cf5a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,5 +2,5 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -bashate>=0.5.1 # Apache-2.0 -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +bashate>=2.1.0 # Apache-2.0 +hacking>=3.0.1,<3.1.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 40d4f927..9795272c 100644 --- a/tox.ini +++ b/tox.ini @@ -6,10 +6,10 @@ skipsdist = True [testenv] basepython = python3 usedevelop = True -install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY