git: 05658249f9a1 - main - devel/py-tyro: new port

From: Michael Osipov <michaelo_at_FreeBSD.org>
Date: Sat, 26 Sep 2026 22:39:12 UTC
The branch main has been updated by michaelo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=05658249f9a1b3400429faf35426319bfaab6e94

commit 05658249f9a1b3400429faf35426319bfaab6e94
Author:     Pedro Ramos <pr9000@tutamail.com>
AuthorDate: 2026-08-13 20:51:09 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-09-26 22:38:34 +0000

    devel/py-tyro: new port
    
    tyro is a lightweight, ergonomic way to build CLI interfaces and
    config objects directly from Python type annotations. It wraps
    argparse with a clean, type-driven API and sensible defaults,
    letting you turn dataclasses, attrs classes, or Pydantic models
    into CLI interfaces.
    
    It provides automatic --help generation from docstrings, shell
    completion for bash/zsh/fish/PowerShell, and nested subcommands
    with minimal boilerplate.
    
    Signed-off-by:  Pedro Ramos <pr9000@tutamail.com>
    Co-authored-by: Michael Osipov <michaelo@FreeBSD.org>
    PR:             297523
---
 devel/Makefile          |  1 +
 devel/py-tyro/Makefile  | 36 ++++++++++++++++++++++++++++++++++++
 devel/py-tyro/distinfo  |  3 +++
 devel/py-tyro/pkg-descr | 11 +++++++++++
 4 files changed, 51 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 3bf8b0d1f6dd..1037f5cc49f1 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -6428,6 +6428,7 @@
     SUBDIR += py-typing-extensions
     SUBDIR += py-typing-inspect
     SUBDIR += py-typing-inspection
+    SUBDIR += py-tyro
     SUBDIR += py-tzdata
     SUBDIR += py-tzlocal
     SUBDIR += py-u-msgpack-python
diff --git a/devel/py-tyro/Makefile b/devel/py-tyro/Makefile
new file mode 100644
index 000000000000..bf571552b00b
--- /dev/null
+++ b/devel/py-tyro/Makefile
@@ -0,0 +1,36 @@
+PORTNAME=	tyro
+DISTVERSION=	1.0.16
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	pr9000@tutamail.com
+COMMENT=	CLI interfaces & config objects, from types
+WWW=		https://github.com/brentyi/tyro
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hatchling>=0:devel/py-hatchling@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}docstring_parser>=0.16:textproc/py-docstring_parser@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typeguard>=4.0.0:devel/py-typeguard@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.13.0:devel/py-typing-extensions@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}attrs>=21.4.0:devel/py-attrs@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pydantic2>=2.5.2:devel/py-pydantic2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyyaml>=6.0:devel/py-pyyaml@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ml-collections>=0.1.0:misc/py-ml-collections@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}msgspec>=0.18.6:devel/py-msgspec@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}omegaconf>=2.2.2:devel/py-omegaconf@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}shtab>=1.5.6:devel/py-shtab@${PY_FLAVOR} \
+		bash:shells/bash
+
+# FIXME Add port for TEST_DEPENDS
+# ${PYTHON_PKGNAMEPREFIX}universal-pathlib>=0.2.0:devel/py-universal-pathlib@${PY_FLAVOR}
+
+# Officially: 3.8-3.14
+USES=		python
+USE_PYTHON=	autoplist concurrent pep517 pytest
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-tyro/distinfo b/devel/py-tyro/distinfo
new file mode 100644
index 000000000000..d0d5b46d18a4
--- /dev/null
+++ b/devel/py-tyro/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1790458174
+SHA256 (tyro-1.0.16.tar.gz) = edf23c9c3eecba5a2b5af152df8f34a723b689a001ff5b7311f93eff1893a636
+SIZE (tyro-1.0.16.tar.gz) = 603382
diff --git a/devel/py-tyro/pkg-descr b/devel/py-tyro/pkg-descr
new file mode 100644
index 000000000000..3892d5468778
--- /dev/null
+++ b/devel/py-tyro/pkg-descr
@@ -0,0 +1,11 @@
+tyro provides a lightweight, ergonomic way to build CLI interfaces and
+config objects directly from Python type annotations. It wraps argparse
+with a clean, type-driven API and sensible defaults, letting you turn
+dataclasses, attrs classes, or Pydantic models into CLI interfaces.
+
+Features:
+- Declare CLI arguments with Python type hints and dataclasses
+- Automatic --help generation from docstrings
+- Shell completion for bash, zsh, fish, and PowerShell
+- Nested subcommands with minimal boilerplate
+- Hierarchical / modular configuration structures