[Bug 294723] devel/py-typer: Cannot import typer since 0.24.1

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 23 Apr 2026 11:58:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294723

            Bug ID: 294723
           Summary: devel/py-typer: Cannot import typer since 0.24.1
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: monwarez@mailoo.org
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

The following commit:
https://github.com/fastapi/typer/commit/829576c56cd359c2757087a6080983235d67aed5#diff-5e54fe136b6700ee95a604d79f2aea249e8dceaf7c53439b41d4c8b6169e1d63

Induced the following error which may be due to a too old click version:

  File "/usr/local/lib/python3.11/site-packages/searx/enginelib/__init__.py",
line 33, in <module>
    import typer
  File "/usr/local/lib/python3.11/site-packages/typer/__init__.py", line 29, in
<module>
    from .main import Typer as Typer
  File "/usr/local/lib/python3.11/site-packages/typer/main.py", line 20, in
<module>
    from typer._types import TyperChoice
  File "/usr/local/lib/python3.11/site-packages/typer/_types.py", line 9, in
<module>
    class TyperChoice(click.Choice[ParamTypeValue]):
                      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: type 'Choice' is not subscriptable


The current version of click which is 8.1.7 in ports have this:

class Choice(ParamType):
    """The choice type allows a value to be checked against a fixed set
    of supported values. All of these values have to be strings.

    You should only pass a list or tuple of choices. Other iterables
    (like generators) may lead to surprising results.

    The resulting value will always be one of the originally passed choices
    regardless of ``case_sensitive`` or any ``ctx.token_normalize_func``
    being specified.

    See :ref:`choice-opts` for an example.

    :param case_sensitive: Set to false to make choices case
        insensitive. Defaults to true.
    """

    name = "choice"

While after 8.2.0 we got:


class Choice(ParamType, t.Generic[ParamTypeValue]):
    """The choice type allows a value to be checked against a fixed set
    of supported values.

    You may pass any iterable value which will be converted to a tuple
    and thus will only be iterated once.

    The resulting value will always be one of the originally passed choices.
    See :meth:`normalize_choice` for more info on the mapping of strings
    to choices. See :ref:`choice-opts` for an example.

    :param case_sensitive: Set to false to make choices case
        insensitive. Defaults to true.

    .. versionchanged:: 8.2.0
        Non-``str`` ``choices`` are now supported. It can additionally be any
        iterable. Before you were not recommended to pass anything but a list
or
        tuple.

    .. versionadded:: 8.2.0
        Choice normalization can be overridden via :meth:`normalize_choice`.
    """

    name = "choice"

-- 
You are receiving this mail because:
You are the assignee for the bug.