klayout
klayout copied to clipboard
Better python integration with klayout
This PR is designed to address #660 . So far, I have done the following changes to the macbuild installation:
- shipping a python binary alongside klayout, which imports the same libraries that the python interpreter within klayout does
- within that instance, I replaced
sys.executablewith that python binary rather than the klayout binary.
The motivation for this is to allow packages to install python packages with pip install by using a thread-safe subprocess call, e.g.:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'numpy'])
With this PR, in the "heavyweight" HW distribution, this command places numpy into the klayout.app. It also does not crash klayout's python interpreter in case this fails.