%global upstream_name flasgger

Name:           python-%{upstream_name}
Version:        0.9.7.1
Release:        %autorelease
Summary:        Easy OpenAPI specs and Swagger UI for your Flask API
License:        MIT
URL:            https://github.com/flasgger/flasgger
Source0:        %{url}/archive/refs/tags/v%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3dist(pytest)

%description
%{summary}.

%package -n     python3-%{upstream_name}
Summary:        %{summary}

%description -n python3-%{upstream_name}
%{summary}.

%prep
%autosetup -p1 -n %{upstream_name}-%{version}

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files %{upstream_name}

%check
# requires flex module for tests and module doesn't seem maintained
rm -rf tests/test_examples.py
%pytest -k 'not test_swag'

%files -n python3-%{upstream_name} -f %{pyproject_files}
%doc README.md HISTORY
%license LICENSE

%changelog
%autochangelog