Blob Blame History Raw
%global pypi_name typeguard

Name:           python-%{pypi_name}
Version:        2.12.1
Release:        %autorelease
Summary:        Run-time type checker for Python
License:        MIT
URL:            https://github.com/agronholm/%{pypi_name}
Source0:        https://pypi.io/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%package -n python3-%{pypi_name}

Summary:          %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}

BuildRequires:    python3-setuptools
BuildRequires:    python3-setuptools_scm
BuildRequires:    python3-devel
BuildRequires:    python3-pbr
BuildRequires:    python3-six >= 1.9.0
BuildRequires:    python3-tornado >= 4.5
BuildRequires:    python3-pytest
BuildRequires:    python3-pytest-cov
BuildRequires:    python3-typing-extensions
BuildRequires:    python3-mypy
%if %{undefined __pythondist_requires}
Requires:         python3-six >= 1.9.0
%endif


%description -n python3-%{pypi_name}
This library provides run-time type checking for functions defined with PEP
484 argument (and return) type annotations.

%description
This library provides run-time type checking for functions defined with PEP
484 argument (and return) type annotations.

%prep
%autosetup -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info
%if 0%{?fedora} < 33 || 0%{?rhel} < 9
# older setuptools generates PKG-INFO with version=='0.0.0' unless specified
sed -i '/name = typeguard/a version = %{version}' setup.cfg
%endif

%build
%py3_build

%install
%py3_install

%check
%pytest \
  --deselect tests/test_importhook.py::test_cached_module \
  --deselect tests/test_typeguard.py::TestTypeChecked::test_literal \
  --ignore tests/mypy/test_type_annotations.py

%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}/
%{python3_sitelib}/%{pypi_name}-*.egg-info/

%changelog
%autochangelog