%global python3_pkgversion 3.11 Name: python-typeguard Version: 4.2.1 Release: 2.ac8.py3.11%{?dist} Summary: Run-time type checker for Python # SPDX License: MIT URL: https://github.com/agronholm/typeguard Source: %{pypi_source typeguard} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: tomcli %global common_description %{expand: This library provides run-time type checking for functions defined with PEP 484 argument (and return) type annotations.} %description %{common_description} %package -n python%{python3_pkgversion}-typeguard Summary: %{summary} # Removed for F41: Obsoletes: python-typeguard-doc < 4.2.1-2 %description -n python%{python3_pkgversion}-typeguard %{common_description} %prep %autosetup -n typeguard-%{version} # Downstream-only: do not treat warnings in tests as errors # # This makes sense for upstream development and CI, but is too strict for # distribution packaging. tomcli set pyproject.toml lists delitem \ 'tool.pytest.ini_options.filterwarnings' error # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters tomcli set pyproject.toml lists delitem --type regex \ 'project.optional-dependencies.test' 'coverage\b.*' # Note that we *do* need mypy for some of the tests; it is not just a # “typechecking linter.” %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_buildrequires -x test %build export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_wheel %install export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' %pyproject_install %pyproject_save_files typeguard %check for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s/(.*).mo$/\1%{python3_pkgversion}.mo/"<<<"$m"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s/(.*).([1-8]([^.]+)?)$/\1%{python3_pkgversion}.\2/"<<<"$m"); done for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s/(.*)$/\1%{python3_pkgversion}/"<<<"$b"); done #pytest -v -rs %files -n python%{python3_pkgversion}-typeguard -f %{pyproject_files} %doc README.rst %changelog * Sat Mar 30 2024 Ding-Yi Chen - 4.2.1-2.ac8.py3.11 - Cut corner packaging