# -*- 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-isort
version             8.0.1
revision            0

categories-append   devel
platforms           {darwin any}
supported_archs     noarch
license             MIT
maintainers         {reneeotten @reneeotten} openmaintainer

description         A Python utility / library to sort Python imports.
long_description    isort is a Python utility / library to sort imports \
                    alphabetically, and automatically separated into sections. \
                    It provides a command line utility, Python library and \
                    plugins for various editors to quickly sort all your \
                    imports.

homepage            https://github.com/PyCQA/isort

checksums           rmd160  5c7fea64188cfdfe8c99ecbf26fcb2407df5c397 \
                    sha256  171ac4ff559cdc060bcfff550bc8404a486fee0caab245679c2abe7cb253c78d \
                    size    769592

python.versions     310 311 312 313 314
python.pep517_backend hatch

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

    depends_run-append \
                    port:isort_select

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

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

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

    test.run        no
    # three tests fail, but only when run under MacPorts; skip them for now
    test.args       -k \"not test_other_file_encodings and not test_new_lines_are_preserved and not test_settings_path_skip_issue_909\"
    test.target     test_isort.py
}
