Skip to content

Commit

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

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

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.

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: Idb765d09f9498bc13f952c055026e29a46cab8d3
  • Loading branch information
Elod Illes committed Mar 26, 2022
1 parent e82db3b commit 49970b3
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 +1,5 @@
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

0 comments on commit 49970b3

Please sign in to comment.