## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%global pypi_name flask-compress
%global forgeurl https://github.com/colour-science/flask-compress

%bcond tests 1

%global _description %{expand:
Flask-Compress allows you to easily compress your Flask application's
responses with gzip.

The preferred solution is to have a server (like Nginx) automatically
compress the static files for you. If you don't have that option
Flask-Compress will solve the problem for you.}

Name:           python-%{pypi_name}
Version:        1.17
Release:        %autorelease
Summary:        Compress responses in your Flask app with gzip or brotli
%forgemeta
License:        MIT
URL:            %forgeurl
Source0:        %forgesource
# Relax setuptools_scm version requirement
Patch0:         flask-compress_setuptools-scm.patch

BuildArch:      noarch

BuildRequires:  make
BuildRequires:  python3-devel

%if %{with tests}
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(flask-caching)
%endif

%description %_description

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

Requires:       python3dist(brotli)
Requires:       python3dist(flask)
%description -n python3-%{pypi_name} %_description

%prep
%forgeautosetup -p1
rm -rf %{pypi_name}.egg-info

%generate_buildrequires
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%pyproject_buildrequires -r

%build
export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}'
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files flask_compress

%check
%if %{with tests}
# Skip tests requiring network
%pytest -v -k 'not UrlTests'
%endif

%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE.txt
%doc README.md

%changelog
## START: Generated by rpmautospec
* Mon Oct 14 2024 Sandro Mani <manisandro@gmail.com> - 1.17-1
- Update to 1.17

* Sun Oct 13 2024 Sandro Mani <manisandro@gmail.com> - 1.16-2
- BR: python3dist(flask-caching)

* Sun Oct 13 2024 Sandro Mani <manisandro@gmail.com> - 1.16-1
- Update to 1.16

* Fri Jul 19 2024 Sandro Mani <manisandro@gmail.com> - 1.15-2
- Add flask-compress_setuptools-scm.patch

* Thu Jul 18 2024 Sandro Mani <manisandro@gmail.com> - 1.15-1
- Update to 1.15

* Sun Jun 09 2024 Python Maint <python-maint@redhat.com> - 1.14-3
- Rebuilt for Python 3.13

* Fri Jan 26 2024 Sandro <devel@penguinpee.nl> - 1.14-2
- Enable and run tests
- Addded `%%bcond` defaulting to true.
- Dropped BR on `tox` (not required).
- Run tests with `pytest` instead of `setup.py`.
- Skip tests requiring network.

* Fri Jan 26 2024 Sandro <devel@penguinpee.nl> - 1.14-1
- Update to 1.14 (RHBZ#2238283)
- Use forge macros. I've done that primarily, because the Source: tag was a
  lie. On PyPI the project is called Flask-Compress and the tarball is
  named accordingly. I couldn't download it using `spectool -g`. This way I
  don't need to mess with `%%pypi_name`.

* Tue Jan 23 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.13-9
- Stop patching the build system
- Fix RHBZ#2259648 (fix setuptools 69.0.3 compatibility)

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 1.13-5
- Rebuilt for Python 3.12

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sat Oct 08 2022 Sandro Mani <manisandro@gmail.com> - 1.13-3
- Update 0001-Use-setuptools.patch to set version also in setup.py for
  setuptools based builds

* Fri Sep 23 2022 Sandro Mani <manisandro@gmail.com> - 1.13-2
- Manually write version to pyproject.toml

* Thu Sep 22 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 1.13-1
- New upstream's release

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 1.12-2
- Rebuilt for Python 3.11

* Sun May 1 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 1.12-1
- New upstream's release

* Tue Mar 1 2022 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 1.11-1
- New upstream's release

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sat Dec 11 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 1.10.1-4
- Use pyproject-rpm-project

* Mon Dec 6 2021 Iztok Fister Jr. <iztokf AT fedoraproject DOT org> - 1.10.1-3
- Use macro for descriptions

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Wed Jun 16 2021 Rafael Fontenelle <rafaelff@gnome.org> - 1.10.1-1
- Update to 1.10.1

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.9.0-3
- Rebuilt for Python 3.10

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Sun Oct 11 2020 Rafael Fontenelle <rafaelff@gnome.org> - 1.7.0-1
- Update to 1.7.0

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Thu Jul 02 2020 Rafael Fontenelle <rafaelff@gnome.org> - 1.5.0-2
- use macro for source0

* Tue May 12 2020 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 1.5.0-1
- Initial package.

## END: Generated by rpmautospec