Blob Blame History Raw
# We do not build Sphinx documentation because current versions of
# python-autoclasstoc bring in a large tree of unpackaged dependencies via the
# python-parametrized-from-file test dependency, so we have elected to retire
# rather than upgrade python-autoclasstoc.
Name:           python-signature-dispatch
Version:        1.0.1
Release:        %autorelease
Summary:        Overload functions based on their call signature and type annotations

License:        MIT
Source:         %{pypi_source signature_dispatch}

# Migrate to typeguard v4.0
# Rebased on the PyPI sdist, which has different whitespace in pyproject.toml,
# and version specification loosened to allow rc3 or later.
Patch:          typeguard-v4.patch

BuildArch:      noarch

BuildRequires:  python3-devel

%global common_description %{expand:
This package provides a simple python library for overloading functions based
on their call signature and type annotations.}

%description %{common_description}

%package -n python3-signature-dispatch
Summary:        %{summary}

Obsoletes:      python-signature-dispatch-doc < 1.0.0-4

%description -n python3-signature-dispatch %{common_description}

%autosetup -n signature_dispatch-%{version} -p1

# Patch out coverage dependencies
sed -r -i '/\b(pytest-cov|coveralls)\b/d' pyproject.toml

# Remove useless shebang lines.
# Originally sent upstream,
#, but this author
# wants to keep them; see:
# Script version instead of patch for forward-compatibility.
# The find-then-modify pattern keeps us from discarding mtimes on any sources
# that do not need modification.
find . -type f -name '*.py' -exec \
    gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' |
  xargs -r -t sed -r -i '1{/^#!/d}'

%pyproject_buildrequires -x test


%pyproject_save_files signature_dispatch

%pytest tests

%files -n python3-signature-dispatch -f %{pyproject_files}
%license LICENSE.txt
%doc README.rst