Skip to content

Feature: Install klayout/pya python module as a system-level python module

Description:

Currently, the python module(s) are not installed at a system level, which causes issues in the case where one runs scripts that depend on being launched outside of klayout.

Additional info:

  • package version(s): 0.30.4-1
  • config and/or log files:
  • link to upstream bug report, if any:

Steps to reproduce:

  1. Launch python
  2. import klayout --> ModuleNotFoundError: No module named 'klayout'
  3. import pya --> ModuleNotFoundError: No module named 'pya'

Proposal

In klayout-qt6 (which I will remove, due to being redundant now) I did the following:

package_python-klayout-qt6() {
  depends=("${pkgbase}=${pkgver}")

  local site="$(python -c 'import site; print(site.getsitepackages()[0])')"
  install -d "${pkgdir}${site}"

  # Symlink from the base package to site installation
  for lib in klayout pya; do
    ln -s "/usr/lib/pymod/${lib}" "${pkgdir}${site}/${lib}"
  done

Thanks in advance!

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information