# -*- 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-spopt
version             0.7.0
revision            0

categories-append   gis

platforms           {darwin any}
supported_archs     noarch
license             BSD
maintainers         nomaintainer

description         Spatial Optimization (spopt)
long_description    {*}${description} is an open-source Python library for \
                    solving optimization problems with spatial data. \
                    Originating from the region module in PySAL (Python \
                    Spatial Analysis Library), it is under active development \
                    for the inclusion of newly proposed models and methods \
                    for regionalization, facility location, and \
                    transportation-oriented solutions.

homepage            https://github.com/pysal/spopt

checksums           rmd160  d1c6f430775646f11329d2b194e9f49690d6c2c9 \
                    sha256  ed599b8c0e219682e48e85852b615dbc6f122ef2907d73c11894ad3ffdb39d47 \
                    size    32372541

python.versions     310 311 312 313

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

    depends_test-append \
                    port:py${python.version}-pytest-cov \
                    port:py${python.version}-pytest-xdist \
                    port:py${python.version}-codecov \
                    port:py${python.version}-coverage \
                    port:py${python.version}-folium \
                    port:py${python.version}-matplotlib \
                    port:py${python.version}-mapclassify

    depends_run-append \
                    port:py${python.version}-geopandas \
                    port:py${python.version}-libpysal \
                    port:py${python.version}-mapclassify \
                    port:py${python.version}-networkx \
                    port:py${python.version}-numpy \
                    port:py${python.version}-pandas \
                    port:py${python.version}-pointpats \
                    port:py${python.version}-pulp \
                    port:py${python.version}-scikit-learn \
                    port:py${python.version}-scipy \
                    port:py${python.version}-shapely \
                    port:py${python.version}-spaghetti \
                    port:py${python.version}-tqdm

    if {${python.version} == 39} {
        PortGroup       github 1.0

        github.setup    pysal spopt 0.5.0 v
        # Change github.tarball_from to 'releases' or 'archive' next update
        github.tarball_from tarball

        version         0.5.0
        revision        0
        checksums       rmd160  4d387eb900763e5e49b41b1f68ace0c0aa3a029e \
                        sha256  c3d6572c1167b5d59a98781f8697cc6ba10f1fbf65ecf1ca1bad1aaa9d4ce511 \
                        size    29182492

        depends_run-delete   port:py${python.version}-pointpats
    } elseif {${python.version} == 310} {
        version         0.6.1
        revision        0
        checksums       rmd160  c2c47b0126db97afff4171fcafea35c2517b5a5d \
                        sha256  22fd867543cd04325d11d7d75a68dcdf8fba4c2c2fe959ba60ccef13dc54acf7 \
                        size    30537353
    }

    test.run        yes
}
