From e32f4e11f0d6d01b008bbe641b60acbd299ca282 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 30 Mar 2020 15:10:03 +1100 Subject: [PATCH] Ignore __pycache__ directory when looking at roles For some reason, locally "tox -e docs" on zuul-jobs creates a roles/__pycache__ directory; I think because it has a __init__.py because we need that to correctly find unit-tests (I9a653666e8a083fb7f3fbb92589fe0467a41e6e6). I can not seem to convince it to not write this directory. Ignore __pycache__ directories when matching. Change-Id: If7e70456a31554317c419fcb2ad3aad1ad19c6bf --- zuul_sphinx/zuul.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zuul_sphinx/zuul.py b/zuul_sphinx/zuul.py index 43f0970..1a7a477 100644 --- a/zuul_sphinx/zuul.py +++ b/zuul_sphinx/zuul.py @@ -188,6 +188,8 @@ class ZuulDirective(Directive): for p in os.listdir(d): if not os.path.isdir(os.path.join(d, p)): continue + if p in ('__pycache__',): + continue role_readme = os.path.join(d, p, 'README.rst') if os.path.exists(role_readme): roles[p] = role_readme