# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{12..14} )

# upstream PyPI sdist filename uses underscore (math_verify-x.y.z.tar.gz),
# project page is /pypi/math-verify/
PYPI_PN="math_verify"
PYPI_NO_NORMALIZE=1

inherit distutils-r1 pypi

DESCRIPTION="HuggingFace library for verifying mathematical answers"
HOMEPAGE="
	https://github.com/huggingface/math-verify
	https://pypi.org/project/math-verify/
"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

# Upstream pins latex2sympy2_extended==1.11.0 exactly in pyproject.toml.
# The ~ form matches that version regardless of revision.
RDEPEND="
	$(python_gen_cond_dep '
		~dev-python/latex2sympy2-extended-1.11.0[${PYTHON_USEDEP}]
	')
"

# Tests not wired: 290/291 pass at 0.9.0 (verified 2026-05-11), but one
# parametrized case in tests/test_all.py::test_latex_notation_math fails
# on a malformed-LLM-output gold/pred pair. Per-parameter deselection by
# index is brittle and the failure isn't packaging-related, so we skip
# distutils_enable_tests pytest. Re-evaluate on bumps if upstream prunes
# or fixes the case.