<div dir="ltr"><div dir="ltr">On Fri, May 10, 2019 at 5:48 AM Stephen Finucane <<a href="mailto:sfinucan@redhat.com">sfinucan@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We've noticed a spate of recent test failures within the 'pep8' jobs in<br>
oslo recently. It seems these are because of the release of bandit<br>
1.6.0. The root cause is that the '-x' (exclude) option seems to have<br>
changed behavior. Previously, to match a path like 'oslo_log/tests/*',<br>
you could state '-x test'. This option now expects a glob patterns,<br>
such as '-x oslo_log/tests/*'. If you use bandit, you probably have to<br>
update your 'tox.ini' accordingly. See [1] for an example.<br></blockquote><div><br></div><div>As a note, it looks like you have to catch every .py file in this glob,</div><div>so this won't work for more complex directory layouts. e.g. in Keystone,</div><div>`-x keystone/tests/*` still fails, as does `-x keystone/tests/**/*`, etc.</div><div>I've just blacklisted this version there.[3]</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
It's worth noting that bandit is one of the few packages we don't<br>
manage the version for [2], so if you're not already limiting yourself<br>
to a version, perhaps it would be a good idea to do so to avoid stable<br>
branches breaking periodically. Also, this is something that really<br>
shouldn't have happened in a minor version (backwards incompatible<br>
behavior change, yo) but it has so we'll live with it. I would ask<br>
though that the bandit maintainers, whoever ye be, be more careful<br>
about this kind of stuff in the future. Thanks :)<br></blockquote><div><br></div><div>FWIW, looks like this was an unintentional regression[4] that they're</div><div>working on fixing[5] in 1.6.1.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Stephen<br>
<br>
[1] <a href="https://review.opendev.org/#/c/658249/" rel="noreferrer" target="_blank">https://review.opendev.org/#/c/658249/</a><br>
[2] <a href="https://github.com/openstack/requirements/blob/master/blacklist.txt" rel="noreferrer" target="_blank">https://github.com/openstack/requirements/blob/master/blacklist.txt</a><br>
<br>
<br></blockquote><div><br></div><div>// jim</div><div><br></div><div>[3] <a href="https://review.opendev.org/#/c/658107/">https://review.opendev.org/#/c/658107/</a> </div><div>[4] <a href="https://github.com/PyCQA/bandit/issues/488">https://github.com/PyCQA/bandit/issues/488</a></div><div>[5] <a href="https://github.com/PyCQA/bandit/pull/489">https://github.com/PyCQA/bandit/pull/489</a></div></div></div>