# Template file for 'python3-argparse-manpage'
pkgname=python3-argparse-manpage
version=4.7
revision=1
build_style=python3-pep517
hostmakedepends="python3-setuptools"
depends="python3 "
checkdepends="python3-pytest python3-pip"
short_desc="Build manual page from python's ArgumentParser object"
maintainer="Duncaen <duncaen@voidlinux.org>"
license="Apache-2.0"
homepage="https://github.com/praiskup/argparse-manpage"
distfiles="https://github.com/praiskup/argparse-manpage/archive/refs/tags/v${version}.tar.gz"
checksum=b36103537d0f5b018f25b13b9cec94fdba0a99697e20d158cfe66931b7f45d57

# The default do_check installs packages into a temporary directory
# and adds that to PYTHONPATH. But in the tests here, pip is executed
# to test setup.py files that use `build_manpages`. pip sets its own PYTHONPATH
# variable when executing some setup.py stuff and completely overwrites
# our's, resulting in the `build_manpages` module not being available.
# We work around this by using a venv for the temporary install
# and to run the tests instead.
do_check() {
	python3 -m venv --system-site-packages venv
	venv/bin/python3 -m installer --overwrite-existing dist/*.whl
	venv/bin/python3 -m pytest
}
