Name: python-eval-type-backport Version: 0.4.0 Release: %autorelease Summary: Newer typing features for older Python versions License: MIT URL: https://github.com/alexmojaki/eval_type_backport Source: %{pypi_source eval_type_backport} BuildSystem: pyproject BuildOption(install): --assert-license eval_type_backport BuildOption(generate_buildrequires): --extras tests BuildArch: noarch BuildRequires: python3-devel # Fill in the actual package description to submit package to Fedora %global _description %{expand: This package makes runtime typing inspection with the typing module possible with newer syntax in older Python versions. Specifically, this transforms X | Y into typing.Union[X, Y] and list[X] into typing.List[X] etc. (for all the types made generic in PEP 585) if the original syntax is not supported in the current Python version. For users of Pydantic, merely having this package installed should make Pydantic models with newer syntax work in older Python versions. } %description %_description %package -n python3-eval-type-backport Summary: %{summary} %description -n python3-eval-type-backport %_description %files -n python3-eval-type-backport -f %{pyproject_files} %check -a # These fail on Python 3.15+: typing._eval_type() gained a required # positional "type_params" argument that eval_type_backport does not pass. # https://github.com/alexmojaki/eval_type_backport/issues/38 %pytest \ --deselect tests/test_eval_type_backport.py::test_eval_type_backport \ --deselect tests/test_eval_type_backport.py::test_other_or_type_error \ --deselect tests/test_eval_type_backport.py::test_working_or \ --deselect tests/test_eval_type_backport.py::test_subscript \ --deselect tests/test_eval_type_backport.py::test_unsupported_subscript_type_error \ --deselect tests/test_eval_type_backport.py::test_subscript_other_error \ --deselect tests/test_eval_type_backport.py::test_copy_forward_ref_attrs %changelog %autochangelog