## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 6;
    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

Name:           python-frozenlist
Version:        1.4.1
Release:        %autorelease
Summary:        List-like structure which can be made immutable

License:        Apache-2.0
URL:            https://github.com/aio-libs/frozenlist
Source:         %{pypi_source frozenlist}

# Downstream-only: Build normal wheels in-place
#
# Upstream wants to build only editable wheels in-place, building normal
# wheels in a temporary directory. This is reasonable in principle, but
# the implementation conflicts with the pyproject-rpm-macros, resulting in
# an unbounded recursion of nested temporary directories.
Patch:          0001-Downstream-only-Build-normal-wheels-in-place.patch

# Work around the failing test in Python 3.13+ - skip the new
# __static_attributes__ and __firstlineno__ methods
# Reported upstream: https://github.com/aio-libs/frozenlist/issues/588
Patch:          Skip-some-attributes-when-testing.patch

BuildRequires:  python3-devel

BuildRequires:  gcc

BuildRequires:  %{py3_dist pytest}

%global common_description %{expand:
FrozenList is a list-like structure which implements
collections.abc.MutableSequence, and which can be made immutable.}

%description %{common_description}


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

%description -n python3-frozenlist %{common_description}


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

# Remove Cython-generated sources; we must ensure they are regenerated.
find . -type f -name '*.c' -print -delete

# Patch out coverage-related pytest options:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -r -i 's/^([[:blank:]]*)(.*[-_]cov)/\1# \2/' pytest.ini


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files -l frozenlist


%check
%pytest -v


%files -n python3-frozenlist -f %{pyproject_files}
%doc CHANGES.rst
%doc CONTRIBUTORS.txt
%doc README.rst


%changelog
## START: Generated by rpmautospec
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 1.4.1-5
- Rebuilt for Python 3.13

* Thu May 30 2024 Karolina Surma <ksurma@redhat.com> - 1.4.1-4
- Fix compatibility with Python 3.13+

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

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

* Mon Dec 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.1-1
- Update to 1.4.1 (close RHBZ#2254700)
- Drop the -doc subpackage due to missing new dependencies

* Mon Dec 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.0-3
- Assert that %%pyproject_files contains a license file

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

* Thu Jul 13 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.4.0-1
- Update to 1.4.0 (close RHBZ#2222472)

* Tue Jul 11 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.3-7
- When PDF docs are disabled, omit the -doc subpackage

* Fri Jul 07 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.3-6
- Use new (rpm 4.17.1+) bcond style

* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 1.3.3-5
- Rebuilt for Python 3.12

* Fri Mar 17 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.3-3
- Don’t assume %%_smp_mflags is -j%%_smp_build_ncpus

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

* Thu Nov 10 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.3-1
- Update to 1.3.3 (close RHBZ#2141069)

* Wed Aug 03 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.1-1
- Update to 1.3.1 (close RHBZ#2114752)

* Wed Aug 03 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.0-5
- Convert License to SPDX (ASL 2.0 becomes Apache-2.0)

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

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.3.0-3
- Rebuilt for Python 3.11

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

* Tue Jan 18 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.3.0-1
- Update to 1.3.0 (fix RHBZ#2041998)

* Fri Jan 07 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.2.0-2
- Drop intersphinx mappings

* Mon Dec 13 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.2.0-1
- Initial package (close RHBZ#2029651)
## END: Generated by rpmautospec