Skip to content

Commit

Permalink
Disable auto-discovery for setuptools
Browse files Browse the repository at this point in the history
With the latest setuptools release (61.0.0) ansible-role-atos-hsm's
package build command (python3 setup.py sdist bdist_wheel) started to
fail:

error: Multiple top-level packages discovered in a flat-layout:
['defaults', 'handlers', 'templates', 'releasenotes'].

This issue is mentioned in setuptools bug 3197 [1], and the suggested
workaround is to disable auto-discovery by adding 'py_modules=[]' in
setup.py.

ansible-lint also released a new version (6.0.0), which has new rules
that blocks the gate. As a workaround, this patch caps ansible-lint
version <6.0.0 to unblock the gate.

[1] pypa/setuptools#3197

Change-Id: I3f827b3ed855ff46292dee7b21b74a622adc472d
(cherry picked from commit f5c86df)
(cherry picked from commit 6a02873)
(cherry picked from commit ebd5421)
  • Loading branch information
Elod Illes authored and dmendiza committed Sep 26, 2023
1 parent ccd3896 commit 8618a22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

setuptools.setup(
setup_requires=['pbr'],
pbr=True)
pbr=True,
py_modules=[])
6 changes: 5 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
ansible-lint
# NOTE(elod.illes): ansible 6.0.0 introduced new rules that needs to be
# fixed, like fqcn-builtins, etc. Due to Yoga release happens soon
# let's just cap ansible-lint. This needs a separate fix in the future
# to be able to remove the cap.
ansible-lint<6.0.0
reno

0 comments on commit 8618a22

Please sign in to comment.