## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## 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

Name:           python-sphinx-lint
Version:        1.0.0
Release:        %autorelease
Summary:        Check stylistic and formal issues in .rst and .py files in the documentation
License:        PSF-2.0
URL:            https://github.com/sphinx-contrib/sphinx-lint
Source:         %{url}/archive/v%{version}/sphinx-lint-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python3-devel

%global _description %{expand:
Sphinx Lint should:

- be reasonably fast so it's comfortable to use as a linter in your editor.
- be usable on a single file.
- not give any false positives (probably a utopia, but let's try).
- not spend too much effort finding errors that sphinx-build already finds (or
can easily find).
- focus on finding errors that are not visible to sphinx-build.
}

%description %_description

%package -n     python3-sphinx-lint
Summary:        %{summary}

%description -n python3-sphinx-lint %_description

%pyproject_extras_subpkg -n python3-sphinx-lint tests

%prep
%autosetup -p1 -n sphinx-lint-%{version}

# adopted from python-sphinx-argparse-cli package
sed -i '/name = "sphinx-lint"/a version = "%{version}"' \
    pyproject.toml
sed -i '/version.source = "vcs"/d' pyproject.toml
sed -i '/"version",/{n;d;}' pyproject.toml
sed -i '/  "version",/d' pyproject.toml
sed -i '/^dynamic = \[/d' pyproject.toml

%generate_buildrequires
%pyproject_buildrequires -x tests

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files sphinxlint

%check
%pyproject_check_import
%pytest

%files -n python3-sphinx-lint -f %{pyproject_files}
%{_bindir}/sphinx-lint

%changelog
## START: Generated by rpmautospec
* Fri Sep 13 2024 topazus <topazus@outlook.com> - 1.0.0-1
- 1.0.0

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

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

* Sun Feb 18 2024 Felix Wang <topazus@outlook.com> - 0.9.1-1
- initial import; rhbz#2264739
## END: Generated by rpmautospec