python-typeguard fails to build with Python 3.14.0b1. test_positive and test_negative fail with TypeError: AugmentedHelpFormatter.__init__() got an unexpected keyword argument 'prefix_chars'. This is an issue with Python 3.14.0b1 and is expected to be fixed in b2. And then there's a bunch of genuine issues: ______________________ TestUnion.test_raw_uniontype_fail _______________________ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_checkers.py:903: in test_raw_uniontype_fail check_type(str, types.UnionType) /builddir/build/BUILD/python-typeguard-4.4.2-build/BUILDROOT/usr/lib/python3.14/site-packages/typeguard/_functions.py:107: in check_type check_type_internal(value, expected_type, memo) /builddir/build/BUILD/python-typeguard-4.4.2-build/BUILDROOT/usr/lib/python3.14/site-packages/typeguard/_checkers.py:951: in check_type_internal checker(value, origin_type, args, memo) /builddir/build/BUILD/python-typeguard-4.4.2-build/BUILDROOT/usr/lib/python3.14/site-packages/typeguard/_checkers.py:437: in check_uniontype return check_instance(value, types.UnionType, (), memo) /builddir/build/BUILD/python-typeguard-4.4.2-build/BUILDROOT/usr/lib/python3.14/site-packages/typeguard/_checkers.py:523: in check_instance raise TypeCheckError(f"is not an instance of {qualified_name(origin_type)}") E typeguard.TypeCheckError: class str is not an instance of Union During handling of the above exception, another exception occurred: /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_checkers.py:900: in test_raw_uniontype_fail with pytest.raises( E AssertionError: Regex pattern did not match. E Regex: 'class str is not an instance of \\w+\\.UnionType$' E Input: 'class str is not an instance of Union' ______________ test_union_transformer[str | int-Union[str, int]] _______________ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int' == 'Union[str, int]' E E - Union[str, int] E + str | int _______ test_union_transformer[str | int | bytes-Union[str, int, bytes]] _______ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | bytes' == 'Union[str, int, bytes]' E E - Union[str, int, bytes] E + str | int | bytes _ test_union_transformer[str | Union[int | bytes, set]-Union[str, int, bytes, set]] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | bytes | set' == 'Union[str, int, bytes, set]' E E - Union[str, int, bytes, set] E + str | int | bytes | set _ test_union_transformer[str | int | Callable[..., bytes]-Union[str, int, Callable[..., bytes]]] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | ...e[..., bytes]' == 'Union[str, i...[..., bytes]]' E E - Union[str, int, Callable[..., bytes]] E ? ------ ^ ^ - E + str | int | Callable[..., bytes] E ? ^^ ^^ _ test_union_transformer[str | int | Callable[[], bytes]-Union[str, int, Callable[[], bytes]]] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | ...le[[], bytes]' == 'Union[str, i...e[[], bytes]]' E E - Union[str, int, Callable[[], bytes]] E ? ------ ^ ^ - E + str | int | Callable[[], bytes] E ? ^^ ^^ _ test_union_transformer[str | int | Callable[[], bytes | set]-Union[str, int, Callable[[], Union[bytes, set]]]] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | ... bytes | set]' == 'Union[str, i...bytes, set]]]' E E - Union[str, int, Callable[[], Union[bytes, set]]] E + str | int | Callable[[], bytes | set] _ test_union_transformer[str | int | Literal['foo']-Union[str, int, Literal['foo']]] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E assert "str | int | Literal['foo']" == "Union[str, i...teral['foo']]" E E - Union[str, int, Literal['foo']] E ? ------ ^ ^ - E + str | int | Literal['foo'] E ? ^^ ^^ _ test_union_transformer[str | int | Literal[-1]-Union[str, int, Literal[-1]]0] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | Literal[-1]' == 'Union[str, int, Literal[-1]]' E E - Union[str, int, Literal[-1]] E + str | int | Literal[-1] _ test_union_transformer[str | int | Literal[-1]-Union[str, int, Literal[-1]]1] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E AssertionError: assert 'str | int | Literal[-1]' == 'Union[str, int, Literal[-1]]' E E - Union[str, int, Literal[-1]] E + str | int | Literal[-1] _ test_union_transformer[str | int | Literal["It's a string '\\""]-Union[str, int, Literal['It\\'s a string \\'"']]] _ /builddir/build/BUILD/python-typeguard-4.4.2-build/python-typeguard-4.4.2/tests/test_union_transformer.py:44: in test_union_transformer assert evaluated_repr == expected E assert 'str | int | ...ring \\\'"\']' == 'Union[str, i...ing \\\'"\']]' E E - Union[str, int, Literal['It\'s a string \'"']] E ? ------ ^ ^ - E + str | int | Literal['It\'s a string \'"'] E ? ^^ ^^ ============= 13 failed, 470 passed, 4 skipped, 9 xfailed in 2.25s ============= https://docs.python.org/3.14/whatsnew/3.14.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.14-b1/fedora-rawhide-x86_64/09033264-python-typeguard/ For all our attempts to build python-typeguard with Python 3.14, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.14-b1/package/python-typeguard/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.14: https://copr.fedorainfracloud.org/coprs/g/python/python3.14-b1/ Let us know here if you have any questions. Python 3.14 is planned to be included in Fedora 43. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
These are a bit more gnarly than I want to try to patch, but upstream is now aware (https://github.com/agronholm/typeguard/issues/522), and based on past experience I expect they will get around to doing the necessary work before this becomes a serious problem for us.
As noted in https://github.com/agronholm/typeguard/issues/522#issuecomment-2939727278, I updated to a *very recent* snapshot and am now able to build this for Python 3.14. Now building in the f43-python side tag as https://koji.fedoraproject.org/koji/taskinfo?taskID=133543829.