From 17d620876e76489d41f33357919ae27c6e8e3dd6 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Tue, 5 Jan 2016 16:58:04 -0500 Subject: [PATCH] Add __init__.py to packages. This is required for my particular use case -- running pytest on the generated code directory -- due to . It ought to be abstracted out, especially if we ever support non-python code blocks. --- mkcodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkcodes.py b/mkcodes.py index e9011e1..32ff3ab 100644 --- a/mkcodes.py +++ b/mkcodes.py @@ -110,6 +110,8 @@ def main(inputs, output, github, safe): outputdir = os.path.dirname(outputfilename) if not os.path.exists(outputdir): os.makedirs(outputdir) + with open(os.path.join(outputdir, '__init__.py'), 'w'): + pass with open(outputfilename, 'w') as outputfile: outputfile.write(code)