klayout icon indicating copy to clipboard operation
klayout copied to clipboard

Better python integration with klayout

Open thomaslima opened this issue 5 years ago • 0 comments

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.executable with 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.

thomaslima avatar Nov 28 '20 18:11 thomaslima