# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim: fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-ipython
version             8.21.0
revision            0
categories-append   devel science
license             BSD
supported_archs     noarch
platforms           {darwin any}

python.versions     38 39 310 311 312

maintainers         {aronnax @lpsinger} {stromnov @stromnov} openmaintainer

description         An enhanced interactive Python shell.
long_description    {*}${description}

homepage            https://ipython.org/

checksums           rmd160  e119b7b313587830181ed3566e33ba6ba6889e1d \
                    sha256  48fbc236fbe0e138b88773fa0437751f14c3645fb483f1d4c5dee58b37e5ce73 \
                    size    5490331

if {${name} ne ${subport}} {
    set python_major [string index ${python.version} 0]

    depends_run-append  port:ipython_select \
                        port:ipython${python_major}_select

    depends_lib-append  port:py${python.version}-decorator \
                        port:py${python.version}-jedi \
                        port:py${python.version}-matplotlib-inline \
                        port:py${python.version}-pexpect \
                        port:py${python.version}-prompt_toolkit \
                        port:py${python.version}-pygments \
                        port:py${python.version}-stack_data \
                        port:py${python.version}-traitlets

    if {${python.version} eq 38} {
        version             8.12.3
        revision            0
        distname            ${python.rootname}-${version}
        checksums           rmd160  daa3d063bff985b885c55c8e9847d22524f7def6 \
                            sha256  c7b80eb7f5a855a88efc971fda506ff7a91c280b42cdae26643e0f601ea281ea \
                            size    5466964
        depends_lib-append  port:py${python.version}-appnope \
                            port:py${python.version}-backcall \
                            port:py${python.version}-pickleshare \
                            port:py${python.version}-typing_extensions
    } elseif {${python.version} eq 39} {
        version             8.18.1
        revision            0
        distname            ${python.rootname}-${version}
        checksums           rmd160  115537ce4b2b7bbb4ea2bc391f4875cf437c3856 \
                            sha256  ca6f079bb33457c66e233e4580ebfc4128855b4cf6370dddd73842a9563e8a27 \
                            size    5486330
        depends_lib-append  port:py${python.version}-exceptiongroup \
                            port:py${python.version}-typing_extensions
    } else {
        if {${python.version} < 311} {
            depends_lib-append  port:py${python.version}-exceptiongroup
        }
    }

    select.entries      [list ipython py${python.version}-ipython py${python.version}-ipython] \
                        [list ipython${python_major} py${python.version}-ipython py${python.version}-ipython]

    notes-append "
To make this the default IPython or IPython${python_major} (i.e., the version run by\
the 'ipython' or 'ipython${python_major}' commands), run one or both of:

    sudo port select --set ipython py${python.version}-ipython
    sudo port select --set ipython${python_major} py${python.version}-ipython
    "

    livecheck.type      none
}
