Convert to pyproject-rpm-macros

This commit is contained in:
Miro Hrončok 2022-01-31 17:01:03 +01:00
parent b42ee23f79
commit d19cca56dd

View File

@ -12,6 +12,13 @@ Patch: %{url}/pull/506.patch
BuildArch: noarch
BuildRequires: python3-devel
# Test deps
# Upstream uses requirements-test.txt but it has tox, coverage, mock, flake8 in it
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-expect)
%description
A python based HTML parser/tokenizer based on the WHATWG HTML5
specification for maximum compatibility with major desktop web browsers.
@ -19,19 +26,6 @@ specification for maximum compatibility with major desktop web browsers.
%package -n python3-html5lib
Summary: %{summary}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
# Test deps
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-expect)
BuildRequires: python3dist(six)
BuildRequires: python3dist(webencodings)
# Optional test deps:
BuildRequires: python3dist(chardet)
BuildRequires: python3dist(genshi)
BuildRequires: python3dist(lxml)
%description -n python3-html5lib
A python based HTML parser/tokenizer based on the WHATWG HTML5
@ -45,23 +39,25 @@ specification for maximum compatibility with major desktop web browsers.
# From https://github.com/html5lib/html5lib-python/pull/536
sed -i 's/from mock import/from unittest.mock import/' html5lib/tests/test_meta.py
%generate_buildrequires
%pyproject_buildrequires -x all
%build
%py3_build
%pyproject_wheel
%install
%py3_install
%pyproject_install
%pyproject_save_files html5lib
%check
%pytest
%files -n python3-html5lib
%license LICENSE
%files -n python3-html5lib -f %{pyproject_files}
%doc CHANGES.rst README.rst
%{python3_sitelib}/html5lib-*.egg-info/
%{python3_sitelib}/html5lib/
%changelog