## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 4;
    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 scikit-misc
# Use GitHub sources. PyPI sources are not suitable for rebuilding.
# https://github.com/has2k1/scikit-misc/issues/27
%global forgeurl https://github.com/has2k1/scikit-misc

# Enable tests
%bcond tests 1

Name:           python-%{pypi_name}
Version:        0.5.1
Release:        %autorelease
Summary:        Miscellaneous tools for data analysis and scientific computing

%forgemeta

# MIT License applies to doc/theme/static/bootstrap-3.4.1
# Python-2.0.1 license applies to doc/_static/copybutton.js
License:        BSD-3-Clause AND MIT AND Python-2.0.1
URL:            %forgeurl
Source:         %forgesource

ExcludeArch:    %{ix86}
BuildRequires:  gcc-gfortran
BuildRequires:  git-core
BuildRequires:  python3-devel
%if %{with tests}
BuildRequires:  python3-pytest
%endif

%global _description %{expand:
Miscellaneous tools for data analysis and scientific computing.}

%description %_description


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

%description -n python3-%{pypi_name} %_description


%prep
%forgeautosetup -S git
# Supply the version information to mesonpy
git tag v%{version}

%py3_shebang_fix spin skmisc/_build_utils/

# Disable coverage
sed -i -e 's/--cov=skmisc --cov-report=xml//' pyproject.toml

# Do not attempt to build with numpy>=2.0
sed -r -i 's/(numpy)>=2.0/\1/' pyproject.toml

%generate_buildrequires
%pyproject_buildrequires -p

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files skmisc


%check
%if %{with tests}
  # pytest >= 8 wants to import from the skmisc/ src dir
  mkdir empty && pushd empty
  ln -s ../skmisc/loess/tests .
  %pytest -v --pyargs --import-mode=importlib
%else
  %pyproject_check_import
%endif


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


%changelog
## START: Generated by rpmautospec
* Thu Jul 25 2024 Packit <hello@packit.dev> - 0.5.1-1
- Update to 0.5.1 upstream release
- Resolves: rhbz#2299973

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

* Mon Jun 24 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 0.4.0-3
- Numpy 1.x backwards-compatibility fix

* Mon Jun 24 2024 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 0.4.0-2
- chore: unpin numpy (fixes rh#2293779)

* Sat Jun 22 2024 Packit <hello@packit.dev> - 0.4.0-1
- Update to 0.4.0 upstream release
- Resolves: rhbz#2293779

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

* Mon Mar 25 2024 Sandro <devel@penguinpee.nl> - 0.3.1-6
- Allow building with Python>=3.12 (RHBZ#2260318)

* Wed Mar 13 2024 Sandro <devel@penguinpee.nl> - 0.3.1-5
- Fix Packit config

* Wed Jan 24 2024 Sandro <devel@penguinpee.nl> - 0.3.1-4
- Add Packit config

* Wed Jan 24 2024 Sandro <devel@penguinpee.nl> - 0.3.1-3
- Minor whitespace changes for better readability

* Wed Jan 24 2024 Sandro <devel@penguinpee.nl> - 0.3.1-2
- Use human friendly bcond

* Wed Jan 24 2024 Sandro <devel@penguinpee.nl> - 0.3.1-1
- Update to 0.3.1 (RHBZ#2254600)

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

* Tue Sep 12 2023 Miro Hrončok <miro@hroncok.cz> - 0.3.0-2
- Fix the provided python3dist(scikit-misc) version

* Mon Sep 11 2023 Sandro <devel@penguinpee.nl> - 0.3.0-1
- Update to 0.3.0 (RHBZ#2220846)
- Use GitHub sources (PyPI is not suitable)
- Fix PYTHON_PROVIDED_VERSION_NORMALIZES_TO_ZERO

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

* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.2.0-5
- Rebuilt for Python 3.12

* Sun Apr 30 2023 Sandro <devel@penguinpee.nl> - 0.2.0-4
- Use mesonpy for building

* Sat Apr 29 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 0.2.0-3
- Remove unversioned “python” BR
- Fix shebang

* Tue Apr 18 2023 Sandro <devel@penguinpee.nl> - 0.2.0-2
- Enable tests again
- Needs to be run with pytest not meson

* Sun Apr 16 2023 Sandro <devel@penguinpee.nl> - 0.2.0-1
- Update to 0.2.0
- Switch to Meson build system
- Use PyPI source
- Drop patch and associated BR (fixed upstream)

* Tue Feb 07 2023 Miro Hrončok <miro@hroncok.cz> - 0.1.4-5
- Drop a patch, %%pyproject_buildrequires is fixed

* Tue Feb 07 2023 Miro Hrončok <miro@hroncok.cz> - 0.1.4-4
- Fix wrong conversion to %%autochangelog

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

* Fri Oct 21 2022 Sandro <devel@penguinpee.nl> - 0.1.4-2
- Add patch to dist-git

* Fri Oct 21 2022 Sandro <devel@penguinpee.nl> - 0.1.4-1
- Initial release (RHBZ#2133438)
## END: Generated by rpmautospec