Skip to content

Commit

Permalink
Merge pull request #69 from dylanmccall/compile-kolibri-python-code
Browse files Browse the repository at this point in the history
Compile Kolibri Python code after pew build
  • Loading branch information
kollivier committed Dec 1, 2020
2 parents 2bdad9d + 91749e9 commit bb55271
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions build_tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def do_build():

stdlib.generate_stdlib_imports()
subprocess.call(['pew', 'build'])
stdlib.generate_python_bytecode(kolibri_dest_dir)

except Exception as e:
raise e
4 changes: 4 additions & 0 deletions build_tools/stdlib.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import compileall
import distutils.sysconfig as sysconfig
import os
import sys
Expand Down Expand Up @@ -33,6 +34,9 @@
'termios',
])

def generate_python_bytecode(module_dir):
compileall.compile_dir(module_dir)

def generate_stdlib_imports():
"""
Packagers like py2app and pyinstaller work by running through the app looking for dependencies and packaging
Expand Down

0 comments on commit bb55271

Please sign in to comment.