# -*- 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           github 1.0
PortGroup           python 1.0

name                py-pyftdi

github.setup        eblot pyftdi 0.55.4 v
github.tarball_from archive

revision            0
maintainers         nomaintainer
platforms           {darwin any}
supported_archs     noarch
license             BSD

description         PyFtdi aims at providing a user-space driver for popular \
                    FTDI devices, implemented in pure Python language.
long_description    {*}${description}

checksums           rmd160  e896d433b107fe6cfcc0a6358fc481a408ccd0ae \
                    sha256  11871e245310a5787a3064af356e1fb7d32e6f7ffedfdd17e82e5082ec91c174 \
                    size    186949
python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    patchfiles-append \
                    0001-tests-Fix-for-Python-3.13-unittest.makeSuite-was-rem.patch
    depends_run-append \
                    port:py${python.version}-pyusb \
                    port:py${python.version}-serial
    depends_test-append \
                    port:py${python.version}-ruamel-yaml
    test.run        yes
    test.env-append FTDI_VIRTUAL=1

    # This isn't all tests, because many tests require specific devices to be
    # connected. This only includes tests that don't require specific devices,
    # and tests that can be mocked (some via FTDI_VIRTUAL above) so that they
    # don't require specific devices. See pyftdi/.github/workflows.
    test.target     pyftdi/tests/toolsimport.py \
                    pyftdi/tests/mockusb.py \
                    pyftdi/tests/gpio.py \
                    pyftdi/tests/eeprom_mock.py
}
