=====<<< Pymod for MacPorts >>>=====================================================================
==
== The following lines capture the steps I followed to install
== 'pymod' to 'MacPorts' on macOS Catalina using 'pip3'.
==
== Two kinds of "KLayout Python Module" are available under:
==      /Applications/klayout.app/Contents/pymod-dist
==
==   (1) 'klayout-*.whl' : for 'pip3' users
==   (2) 'klayout-*.egg' : for legacy 'easy_install' users (not described in this document)
==
== Ref: https://github.com/KLayout/klayout/issues/1040
==
== File: pymod-pip3-mp38.txt
== Author: kazzz-S
== Last modified: 2022-04-30
====================================================================================================

####################
### 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  4 27 07:57 .
drwxr-xr-x 9 kazzz-s admin     288  4 27 07:57 ..
-rwxr-xr-x 1 kazzz-s admin 9365021  4 27 07:57 klayout-0.27.9-cp38-cp38-macosx_10_15_x86_64.whl
-rwxr-xr-x 1 kazzz-s admin 9363765  4 27 07:57 klayout-0.27.9-py3.8-macosx-10.15-x86_64.egg

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.27.9-cp38-cp38-macosx_10_15_x86_64.whl
:
Processing ./klayout-0.27.9-cp38-cp38-macosx_10_15_x86_64.whl
Installing collected packages: klayout
Successfully installed klayout-0.27.9
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.27.9

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

MacBookPro2{kazzz-s}(8)$ ll -rt
:
:
drwxr-xr-x  19 root wheel    608  4 28 19:01 klayout
drwxr-xr-x   4 root wheel    128  4 28 19:01 pya
drwxr-xr-x  10 root wheel    320  4 28 19:01 klayout-0.27.9.dist-info

MacBookPro2{kazzz-s}(9)$ python3
Python 3.8.13 (default, Mar 17 2022, 16:58:33)
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pya
>>> help(pya)


Help on package pya:

NAME
    pya

DESCRIPTION
    # import all packages from klayout, such as klayout.db and klayout.tl
    # WARNING: doing it manually until it becomes impractical
    # TODO: We need a specification document explaining what should go into pya

PACKAGE CONTENTS


FILE
    /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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   5 kazzz-s staff  160  4 28 18:05 .
drwxr-xr-x+ 99 kazzz-s staff 3168  4 28 18:20 ..
-rw-r--r--   1 kazzz-s staff 1142  4 27 21:38 sample.py

MacBookPro2{kazzz-s}(2)$ python3 sample.py
MacBookPro2{kazzz-s}(3)$ ll -rt
:
drwxr-xr-x   6 kazzz-s staff  192  4 28 18:21 .
drwxr-xr-x+ 99 kazzz-s staff 3168  4 28 18:20 ..
drwxr-xr-x   7 kazzz-s staff  224  4 28 19:07 .
-rw-r--r--   1 kazzz-s staff 1142  4 27 21:38 sample.py
-rw-r--r--   1 kazzz-s staff 6316  4 28 19:07 basic.gds <=== generated

[EOF]
