# -*- 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-incremental
version             24.11.0
revision            0

categories-append   devel
license             MIT
platforms           {darwin any}
supported_archs     noarch
maintainers         {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description         A small library that versions your Python projects
long_description    Incremental is a small library that versions your Python projects.

homepage            https://github.com/twisted/incremental

checksums           rmd160  7c7a2de9c98b927f9f58df75c093042578897752 \
                    sha256  87d3480dbb083c1d736222511a8cf380012a8176c2456d01ef483242abbbcf8c \
                    size    24000

python.versions     27 310 311 312 313 314

if {${name} ne ${subport}} {
    if {${python.version} == 27} {
        version     22.10.0
        revision    0
        checksums   rmd160  7f1f7ddbe346e726abd21c96ff72487c55298db0 \
                    sha256  912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0 \
                    size    18305

        depends_lib-append      port:py${python.version}-click
    } else {
        python.pep517_backend   hatch

        depends_lib-append      port:py${python.version}-packaging

        if {${python.version} < 312} {
            depends_lib-append  port:py${python.version}-tomli
        }
    }
    # see https://pypi.python.org/pypi/incremental/
    #depends_lib-append port:py${python.version}-twisted
    if {[catch {set installed [lindex [registry_active py${python.version}-twisted] 0]}]} {
        notes "
        ${subport} depends on py${python.version}-twisted to run properly, but py${python.version}-twisted depends on ${subport} to both build and run correctly.
        Please install py${python.version}-twisted manually for correct functionality.
        "
    }
}
