# -*- 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

name                py-click-extra
version             10.2.0
revision            0

categories-append   devel
platforms           {darwin any}
supported_archs     noarch
license             GPL-2+
maintainers         {deldycke.com:kevin @kdeldycke} openmaintainer

description         Drop-in replacement for Click to build user-friendly \
                    and colorful CLIs
long_description    Click Extra is a collection of helpers and utilities \
                    for Click, the Python CLI framework. It provides \
                    colorful help screens, configuration file loading, \
                    logging management, table rendering and platform \
                    detection to Click-based tools.

homepage            https://github.com/kdeldycke/click-extra

python.rootname     click_extra

checksums           rmd160  cf5fe5dff748e0a0250c6f8ed828fb16cf070bff \
                    sha256  499b8ad73f9fa9182f799fbb14ebbc7e61a6dde9c2977954173fdcef4b32994e \
                    size    1983138

python.versions     311 312 313 314
python.pep517_backend uv

if {${name} ne ${subport}} {
    depends_lib-append \
                    port:py${python.version}-click \
                    port:py${python.version}-cloup \
                    port:py${python.version}-extra-platforms \
                    port:py${python.version}-tabulate \
                    port:py${python.version}-wcmatch \
                    port:py${python.version}-wcwidth

    depends_test-append \
                    path:bin/git:git \
                    port:py${python.version}-hjson \
                    port:py${python.version}-jsonschema \
                    port:py${python.version}-myst-parser \
                    port:py${python.version}-pygments \
                    port:py${python.version}-pytest-httpserver \
                    port:py${python.version}-requests \
                    port:py${python.version}-sphinx \
                    port:py${python.version}-tomlrt \
                    port:py${python.version}-yaml

    # Exclude the network tests (marked "network") that reach external services,
    # and the tests that read the process table, which the build sandbox hides.
    test.run            yes
    test.args-append    -o addopts="-m 'not network'" \
                        --deselect tests/test_execution.py::test_interrupted_run_kills_grandchildren_ignoring_sigterm \
                        --deselect tests/test_execution.py::test_kill_signal_reaches_a_grandchild_holding_the_output \
                        --deselect tests/test_execution.py::test_posix_process_table_lists_this_process \
                        --deselect tests/test_execution.py::test_run_cli_timeout_kills_grandchildren_without_a_session \
                        --deselect tests/test_execution.py::test_run_cli_timeout_new_session_kills_grandchildren \
                        --deselect tests/test_execution.py::test_terminate_live_processes_signals_whole_group \
                        --deselect tests/test_recording.py::test_record_command_kills_what_its_command_started
    test.env-append     PYTHONPATH=${destroot}${python.pkgd}
}
