# -*- 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-black
version             25.11.0
revision            0

supported_archs     noarch
platforms           {darwin any}
license             MIT
maintainers         {danchr @danchr} openmaintainer

description         The uncompromising code formatter for Python.
long_description \
    By using Black, you agree to cede control over minutiae of \
    hand-formatting your Python source code. In return, Black gives \
    you speed, determinism, and freedom from pycodestyle nagging about \
    formatting. You will save time and mental energy for more \
    important matters. \
    \
    Black makes code review faster by producing the smallest diffs \
    possible. Blackened code looks the same regardless of the project \
    you’re reading. Formatting becomes transparent after a while and \
    you can focus on the content instead.

homepage            https://${python.rootname}.readthedocs.io/

checksums           rmd160  4f78e1b723b7ddd76266a354c62373302d4b2b04 \
                    sha256  9a323ac32f5dc75ce7470501b887250be5005a01602e931a15e45593f70f6e08 \
                    size    655669

python.versions     310 311 312 313
python.pep517_backend   hatch

if {${subport} ne ${name}} {
    depends_build-append \
                    port:py${python.version}-hatch-vcs \
                    port:py${python.version}-hatch-fancy-pypi-readme

    depends_lib-append \
                    port:py${python.version}-click \
                    port:py${python.version}-mypy_extensions \
                    port:py${python.version}-packaging \
                    port:py${python.version}-pathspec \
                    port:py${python.version}-platformdirs \
                    port:py${python.version}-pytokens

    if {${python.version} < 311} {
        depends_lib-append \
                    port:py${python.version}-tomli \
                    port:py${python.version}-typing_extensions
    }

    depends_run-append \
                    port:black_select

    test.run        yes
    test.env-append PYTHONPATH=${destroot}${python.pkgd}

    select.group    black
    select.file     ${filespath}/${python.rootname}${python.version}

    notes "
To make the Python ${python.branch} version of black the one that is run\
when you execute the commands without a version suffix, e.g. 'black', run:

port select --set ${select.group} [file tail ${select.file}]
"
}
