%global commit 8f43b7ec8c9d02179f5f38e0ea08cb5000fb9c9e %global shortcommit %(c=%{commit}; echo ${c:0:7}) Summary: Pure Python HTML5 parser that just works Name: python-justhtml Version: 0.10.0 Release: %autorelease License: MIT URL: https://github.com/emilstenstrom/justhtml Source: %{pypi_source justhtml} # Tests Source1: https://github.com/html5lib/html5lib-tests/archive/%{commit}/html5libtests-%{shortcommit}.tar.gz BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: A pure Python HTML5 parser that just works. No C extensions to compile. No system dependencies to install. No complex API to learn. } %description %_description %package -n python3-justhtml Summary: %{summary} %description -n python3-justhtml %_description %prep %autosetup -a1 -p1 -n justhtml-%{version} # Remove shebang sed -i -e '1d' src/justhtml/__main__.py # Setup test infra mv html5lib-tests-%{commit} html5lib-tests mv html5lib-tests/tree-construction html5lib-tests/tree cd tests for suite in encoding serializer tokenizer tree ; do ln -s ../html5lib-tests/$suite html5lib-tests-$suite done %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l justhtml %check %pyproject_check_import PYTHONPATH=$(pwd)/src %{__python3} run_tests.py %files -n python3-justhtml -f %{pyproject_files} %{_bindir}/justhtml %changelog %autochangelog