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

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() {
	archs=noarch
	depends="python3-ptyprocess"
	pycompile_module="pexpect"
	short_desc="${short_desc/Python2/Python3}"
	pkg_install() {
		vmove usr/lib/python3*
		vlicense LICENSE
	}
}
