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
This commit is contained in:
Elod Illes 2022-03-26 11:33:35 +01:00
parent ded80db266
commit 008b0d7e83
4 changed files with 13 additions and 12 deletions

View File

@ -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

View File

@ -17,4 +17,5 @@ import setuptools
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
pbr=True)
pbr=True,
py_modules=[])

View File

@ -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

View File

@ -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