Blob Blame History Raw
%global pypi_name markdown-it-py

Name:           python-%{pypi_name}
Version:        1.1.0
Release:        4%{?dist}
Summary:        Python port of markdown-it

License:        MIT
URL:            https://github.com/executablebooks/markdown-it-py
Source0:        %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3dist(setuptools)
BuildRequires:  pyproject-rpm-macros

# Test dependencies - upstream uses tox with complicated matrix
# mixed with coverage, it's easier to set the ones we want here
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(pytest-benchmark)
BuildRequires:  python3dist(pytest-regressions)
BuildRequires:  python3dist(psutil)

%global _description %{expand:
Markdown parser done right. Its features:
Follows the CommonMark spec for baseline parsing.
Has configurable syntax: you can add new rules and even replace existing ones.
Pluggable: Adds syntax extensions to extend the parser.
High speed & safe by default
}

%description %_description

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

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

%prep
%autosetup -p1 -n %{pypi_name}-%{version}

# Remove unnecessary shebang
sed -i '1{\@^#!/usr/bin/env python@d}' markdown_it/cli/parse.py

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files markdown_it

%check
# Skipped test uses linkify-it-py extra which we don't have
%pytest -k "not test_linkify"

%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE LICENSE.markdown-it
%doc README.md
%{_bindir}/markdown-it


%changelog
* Wed Aug 04 2021 Karolina Surma <ksurma@redhat.com> - 1.1.0-4
- Enable more tests in %%check using pytest-regressions

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

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

* Thu May 13 2021 Karolina Surma <ksurma@redhat.com> - 1.1.0-1
- Initial package.