## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 7;
    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:
Library for checking syntax of reStructuredText and code blocks nested within
it.}

Name:           python-rstcheck-core
Version:        1.0.3
Release:        %{autorelease}
Summary:        Checks syntax of reStructuredText and code blocks nested within it

License:        MIT
URL:            https://pypi.org/pypi/rstcheck-core
Source0:        %{pypi_source rstcheck_core}

BuildArch:      noarch

%description %_description

%package -n python3-rstcheck-core
Summary:        %{summary}
BuildRequires:  python3-devel
# for tests
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-mock
BuildRequires:  python3-sphinx
BuildRequires:  python3-tomli
BuildRequires:  python3-toml
BuildRequires:  gcc gcc-c++

%description -n python3-rstcheck-core %_description

%prep
%autosetup -n rstcheck_core-%{version}

# loosen dep versions
sed -i 's/docutils.*/docutils = ">=0.7"/' pyproject.toml
sed -i 's/types-docutils.*/types-docutils = ">=0.18"/' pyproject.toml

%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files rstcheck_core

%check
# https://github.com/rstcheck/rstcheck-core/issues/57
%{pytest} -k "not test_check_python_returns_error_on_syntax_warning"

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

%changelog
## START: Generated by rpmautospec
* Tue Aug 29 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 1.0.3-7
- fix: disable failing test, add extras for testing (fixes rhbz#2226320)

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

* Tue Jun 20 2023 Python Maint <python-maint@redhat.com> - 1.0.3-5
- Rebuilt for Python 3.12

* Tue Jun 20 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 1.0.3-4
- feat: import sources (fixes rhbz#2166009)

* Tue Jun 20 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 1.0.3-3
- feat: ready for review

* Tue Jun 20 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 1.0.3-2
- wip: waiting for https://bugzilla.redhat.com/show_bug.cgi?id=2160539

* Tue Jun 20 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 1.0.3-1
- init
## END: Generated by rpmautospec