# Copyright 2026 Nadeŭka <me+oss@nadevko.cc>
# Distributed under the terms of the GNU General Public License v2
EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..15} )

inherit distutils-r1 pypi shell-completion

DESCRIPTION='Tool to test ebuild emerging in a clean stage3 container'
HOMEPAGE='
	https://ebuildtester.readthedocs.io
	https://github.com/nicolasbock/ebuildtester
	https://pypi.org/project/ebuildtester
	https://snapcraft.io/ebuildtester
'
LICENSE=BSD

SLOT=0
KEYWORDS=amd64

BDEPEND="dev-python/setuptools-scm[${PYTHON_USEDEP}]"
RDEPEND="
	virtual/docker-cli
	sys-fs/fuse
	dev-python/platformdirs[${PYTHON_USEDEP}]
	$(python_gen_cond_dep "dev-python/tomli[${PYTHON_USEDEP}]" python3_10)
"

distutils_enable_sphinx docs dev-python/sphinx-rtd-theme
distutils_enable_tests unittest

src_prepare() {
	default
	has_version '>=dev-python/setuptools-82' &&
		eapply "${FILESDIR}"/0001-fix-docs-build-with-setuptools-82.patch
}

src_install() {
	distutils-r1_src_install
	newbashcomp ${PN}.bash-completion ${PN}
}