## 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 pyhaversion
%global pkg_name haversion

Name:           python-%{pkg_name}
Version:        24.6.1
Release:        %autorelease
Summary:        Python module to get the version number of Home Assistant

License:        MIT
URL:            https://github.com/ludeeus/pyhaversion
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%description
A Python module to get the version number of Home Assistant.

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

BuildRequires:  python3-devel
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-asyncio
BuildRequires:  python3-aresponses

%description -n python3-%{pkg_name}
A Python module to get the version number of Home Assistant.

%prep
%autosetup -n %{pypi_name}-%{version}
sed -i -e 's/"0"/"%{version}"/g' pyproject.toml

%generate_buildrequires
%pyproject_buildrequires -t

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files %{pypi_name}

%check
%pytest -v tests -k "not test_stable_version and not test_etag" 

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

%changelog
## START: Generated by rpmautospec
* Mon Sep 30 2024 Fabian Affolter <mail@fabian-affolter.ch> - 24.6.1-1
- Update to latest upstream release (closes rhbz#2291168)

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 23.1.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 23.1.0-6
- Rebuilt for Python 3.13

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

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

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

* Thu Jun 29 2023 Python Maint <python-maint@redhat.com> - 23.1.0-2
- Rebuilt for Python 3.12

* Sun Feb 19 2023 Fabian Affolter <mail@fabian-affolter.ch> - 23.1.0-1
- Upgrade to latest upstream release 23.1.0 (closes rhbz#2165235)

* Tue Jan 24 2023 Miro Hrončok <miro@hroncok.cz> - 22.8.0-3
- Upstream has switched from master to main, adjust the sed in %%prep
- This makes the package provide python3dist(pyhaversion) = 22.8 instead of
  python3dist(pyhaversion) = main
- This makes the package build with packaging 22+

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

* Wed Sep 14 2022 Fabian Affolter <mail@fabian-affolter.ch> - 22.8.0-1
- Update to latest upstream release 22.8.0 (closes rhbz#2072726) Fix FTBFS
  (closes rhbz#2098967)

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

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

* Wed Apr 06 2022 Fabian Affolter <mail@fabian-affolter.ch> - 22.04.0-1
- Update to latest upstream release 22.04.0 (closes rhbz#2071924)

* Wed Feb 23 2022 Fabian Affolter <mail@fabian-affolter.ch> - 22.02.0-1
- Update to latest upstream release 22.02.2 (closes rhbz#2057470)

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

* Sun Nov 07 2021 Fabian Affolter <mail@fabian-affolter.ch> - 21.11.1-1
- Update to latest upstream release 21.11.1 (closes rhbz#2020587)

* Fri Nov 05 2021 Fabian Affolter <mail@fabian-affolter.ch> - 21.11.0-1
- Update to latest upstream release 21.11.0 (closes rhbz#2020545)

* Wed Oct 13 2021 Fabian Affolter <mail@fabian-affolter.ch> - 21.10.1-1
- Update to latest upstream release 21.10.1 (closes rhbz#2012464)

* Thu Aug 26 2021 Fabian Affolter <mail@fabian-affolter.ch> - 21.07.0-1
- * Thu Aug 26 2021 Fabian Affolter <mail@fabian-affolter.ch> - 21.07.0-1 -
  Update to latest upstream release 21.7.0 (rhbz#1914191)

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

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

* Tue Feb 02 2021 Fabian Affolter <mail@fabian-affolter.ch> - 20.12.1-5
- Fix upstream versioning issue

* Tue Feb 02 2021 Fabian Affolter <mail@fabian-affolter.ch> - 20.12.1-4
- Update %%files section

* Tue Feb 02 2021 Fabian Affolter <mail@fabian-affolter.ch> - 20.12.1-3
- Update BR

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

* Fri Jan 08 2021 Fabian Affolter <mail@fabian-affolter.ch> - 20.12.1-1
- * Fri Jan 01 2021 Fabian Affolter <mail@fabian-affolter.ch> - 20.12.1 -
  UPdate to latest upstream release 20.12.1

* Sat Sep 12 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.3.0-1
- * Thu Sep 03 2020 Fabian Affolter <mail@fabian-affolter.ch> - 3.3.0-1 -
  Initial package for Fedora
## END: Generated by rpmautospec