Skip to content

Commit 7a56163

Browse files
committed
Updated setup file so that code generation is done automatically, thus fixing #3 for good (hopefully).
1 parent 7320f59 commit 7a56163

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

setup.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010

1111
here = path.abspath(path.dirname(__file__))
1212

13+
# Check that code generation has been run, otherwise run it
14+
generated_files = ['generated.py', 'generated2.py', 'goodies_generated.py']
15+
generated_file_paths = [path.join(here, 'mini_lambda', file_name) for file_name in generated_files]
16+
17+
if not all(path.exists(file_path) for file_path in generated_file_paths):
18+
print('Generated files not found. Executing code generation...')
19+
from code_generation.mini_lambda_methods_generation import generate_code
20+
generate_code()
21+
22+
if not all(path.exists(file_path) for file_path in generated_file_paths):
23+
raise Exception('Generated files not found even after executing code generation. Something is wrong, exiting.')
24+
25+
1326
# *************** Dependencies *********
1427
INSTALL_REQUIRES = []
1528
DEPENDENCY_LINKS = []

0 commit comments

Comments
 (0)