## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 5;
    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 _description %{expand:
Formulaic is a high-performance implementation of Wilkinson formulas for
Python.

It provides:

- high-performance dataframe to model-matrix conversions.
- support for reusing the encoding choices made during conversion of one
  data-set on other datasets.
- extensible formula parsing.
- extensible data input/output plugins, with implementations for:
  - input:
    - pandas.DataFrame
    - pyarrow.Table
  - output:
    - pandas.DataFrame
    - numpy.ndarray
    - scipy.sparse.CSCMatrix
- support for symbolic differentiation of formulas (and hence model matrices).}

Name:           python-formulaic
Version:        0.5.2
Release:        %{autorelease}
Summary:        A high-performance implementation of Wilkinson formulas

License:        MIT
URL:            https://github.com/matthewwardrop/formulaic
Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Backports https://github.com/matthewwardrop/formulaic/commit/e5dedcb0feed39f5ff6e2326d727ca65d247f26d to v0.5.2
# fork lives at https://github.com/sanjayankur31/formulaic/tree/fedora-0.5.2
Patch0:         0001-fix-correct-pytest-usage.patch

BuildArch:      noarch

%description %_description

%package -n python3-formulaic
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  python3-pytest
BuildRequires:  python3-sympy
BuildRequires:  git-core

%description -n python3-formulaic %_description

%prep
%autosetup -n formulaic-%{version} -S git

%generate_buildrequires
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_buildrequires

%build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_wheel

%install
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_install
%pyproject_save_files formulaic

%check
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%{pytest}

%files -n python3-formulaic -f %{pyproject_files}
%doc README.md

%changelog
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> 0.5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Nov 10 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> 0.5.2-3
- feat: backport patch to enable all tests

* Thu Nov 10 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> 0.5.2-2
- feat: ready for review

* Thu Nov 10 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> 0.5.2-1
- init