=====<<< Pymod for MacPorts >>>=====================================================================
==
== The following lines capture the steps I followed to install
== 'pymod' to 'MacPorts' on macOS Monterey using 'pip3'.
==
== A "KLayout Python Module" is available under '/Applications/klayout.app/Contents/pymod-dist'
== as 'klayout-*.whl' for the 'pip3' tool.
==
== Ref: https://github.com/KLayout/klayout/issues/1040
==
== File: pymod-pip3-mp39.txt
== Author: kazzz-S
== Last modified: 2023-03-19 (as of KLayout version 0.28.6)
====================================================================================================

####################
### Installation ###
####################

MacBookPro2{kazzz-s}(1)$ pwd
/Applications/klayout.app/Contents/pymod-dist

MacBookPro2{kazzz-s}(2)$ ll
:
drwxr-xr-x 4 kazzz-s admin      128  1  1 22:14 .
drwxr-xr-x 9 kazzz-s admin      288  1  1 22:14 ..
-rwxr-xr-x 1 kazzz-s admin 17561656  3 19 00:43 klayout-0.28.6-cp39-cp39-macosx_12_0_x86_64.whl

MacBookPro2{kazzz-s}(3)$ which python3
/opt/local/bin/python3

MacBookPro2{kazzz-s}(4)$ which pip3
/opt/local/bin/pip3

MacBookPro2{kazzz-s}(5)$ sudo -H pip3 install klayout-0.28.6-cp39-cp39-macosx_12_0_x86_64.whl
:
Processing ./klayout-0.28.6-cp39-cp39-macosx_12_0_x86_64.whl
Installing collected packages: klayout
  Attempting uninstall: klayout
    Found existing installation: klayout 0.28.6
    Uninstalling klayout-0.28.6:
      Successfully uninstalled klayout-0.28.6
Successfully installed klayout-0.28.6
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour
with the system package manager. It is recommended to use a virtual environment
instead: https://pip.pypa.io/warnings/venv

MacBookPro2{kazzz-s}(6)$ sudo -H pip3 list | grep klayout
klayout           0.28.6

MacBookPro2{kazzz-s}(7)$ pwd
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages

MacBookPro2{kazzz-s}(8)$ ll -rt
:
:
drwxr-xr-x  35 root wheel  1120  3 19 07:22 klayout
drwxr-xr-x   4 root wheel   128  3 19 07:22 pya
drwxr-xr-x  10 root wheel   320  3 19 07:22 klayout-0.28.6.dist-info

MacBookPro2{kazzz-s}(9)$ python3
Python 3.9.16 (main, Dec  7 2022, 02:41:07)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pya
>>> pya.__version__
'0.28.6'
>>> help(pya)

Help on package pya:

NAME
    pya - KLayout core module 'lay'

PACKAGE CONTENTS


VERSION
    0.28.6

FILE
    /opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pya/__init__.py
================================================================================

####################
###   Testing    ###
####################
Visit "https://www.klayout.org/klayout-pypi/" and save the Code in the name of "sample.py".

MacBookPro2{kazzz-s}(1)$ ll
:
drwxr-xr-x    3 kazzz-s admin   96  1  2 13:15 .
drwxr-xr-x+ 109 kazzz-s staff 3488  1  2 13:15 ..
-rw-r--r--    1 kazzz-s admin 1081  3 19 06:58 sample.py

MacBookPro2{kazzz-s}(2)$ python3 sample.py
MacBookPro2{kazzz-s}(3)$ ll -rt
:
drwxr-xr-x    4 kazzz-s admin  128  1  2 13:15 .
drwxr-xr-x+ 109 kazzz-s staff 3488  1  2 13:15 ..
-rw-r--r--    1 kazzz-s admin 1081  3 19 06:58 sample.py
-rw-r--r--    1 kazzz-s admin 6316  3 19 07:27 basic.gds <=== generated

[EOF]
