Package python3-module-linkify-it-py: Specfile

%define _unpackaged_files_terminate_build 1
%define pypi_name linkify-it-py
%define mod_name linkify_it

%def_with check

Name: python3-module-%pypi_name
Version: 2.0.2
Release: alt0.p10.1
Summary: Links recognition library with FULL unicode support
License: MIT
Group: Development/Python3
Url: https://pypi.org/project/linkify-it-py
Vcs: https://github.com/tsutsu3/linkify-it-py.git
BuildArch: noarch
Source: %name-%version.tar
Source1: %pyproject_deps_config_name
Source2: setuptools-69.1.1-py3-none-any.whl
Patch: %name-%version-alt.patch

%pyproject_runtimedeps_metadata
BuildRequires(pre): rpm-build-pyproject
%pyproject_builddeps_build
%if_with check
%pyproject_builddeps_metadata_extra test
%endif

%description
This is Python port of linkify-it.

%prep
%setup
%autopatch -p1
# https://bugzilla.altlinux.org/47647
# build with bundled setuptools
mkdir dist
cp %SOURCE2 dist/
echo "$(basename '%SOURCE2')" > dist/.wheeltracker
%pyproject_run -- bash -s <<-'ENDSETUP'
# redefine __python3 to python3 instead of /usr/bin/python3 to point to virt one
%global __python3_orig %__python3
%define __python3 python3
%pyproject_deps_resync_build
%pyproject_deps_resync_metadata
ENDUSETUP

%build
%pyproject_run -- bash -s <<-'ENDBUILD'
%pyproject_build
# redefine __python3 back
%define __python3 %__python3_orig
ENDBUILD

%install
%pyproject_install

%check
%pyproject_run_pytest -ra

%files
%doc README.*
%python3_sitelibdir/%mod_name/
%python3_sitelibdir/%{pyproject_distinfo %pypi_name}

%changelog
* Tue Mar 05 2024 Alexander Kuznetsov <kuznetsovam@altlinux.org> 2.0.2-alt0.p10.1
- Backport for p10 with bundled setuptools.

* Wed May 03 2023 Stanislav Levin <slev@altlinux.org> 2.0.2-alt1
- 2.0.0 -> 2.0.2.

* Mon Apr 24 2023 Stanislav Levin <slev@altlinux.org> 2.0.0-alt1
- Initial build for Sisyphus.