# Template file for 'python-pexpect'
pkgname=python-pexpect
version=4.6.0
revision=1
noarch=yes
wrksrc="${pkgname/python-}-${version}"
build_style=python-module
hostmakedepends="python-setuptools python3-setuptools"
depends="python-ptyprocess"
checkdepends="python3-pytest python3-ptyprocess mdocml"
pycompile_module="pexpect"
short_desc="Python2 module for spawning child applications and controlling them"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://pexpect.readthedocs.io/"
license="ISC"
distfiles="${PYPI_SITE}/p/pexpect/pexpect-${version}.tar.gz"
checksum=2a8e88259839571d1251d278476f3eec5db26deb73a70be5ed5dc5435e418aba

do_check() {
	# the mdcocml is for test
	# REPLWrapTestCase.test_pager_as_cat
	python3 -m pytest
}

post_install() {
	# drop asyncio stuff from python2
	# https://github.com/pexpect/pexpect/issues/290
	rm -f ${DESTDIR}/usr/lib/python2*/site-packages/pexpect/_async.py
	vlicense LICENSE
}

python3-pexpect_package() {
	noarch=yes
	depends="python3-ptyprocess"
	pycompile_module="pexpect"
	short_desc="${short_desc/Python2/Python3}"
	pkg_install() {
		vmove usr/lib/python3*
		vlicense LICENSE
	}
}
