SUMMARY="Add parameterized testing with any Python test framework"
DESCRIPTION="Parameterized testing for nose, \
parameterized testing for py.test, parameterized testing for unittest."
HOMEPAGE="https://github.com/wolever/parameterized"
COPYRIGHT="2010 David Wolever"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://pypi.io/packages/source/p/parameterized/parameterized-$portVersion.tar.gz"
CHECKSUM_SHA256="41bbff37d6186430f77f900d777e5bb6a24928a1c46fb1de692f8b52b8833b5c"

ARCHITECTURES="any"

PROVIDES="
	parameterized = $portVersion
	"
REQUIRES="
	haiku
	"
BUILD_REQUIRES="
	haiku_devel
	"

PYTHON_PACKAGES=(python3 python38 python39)
PYTHON_VERSIONS=(3.7 3.8 3.9)
for i in "${!PYTHON_PACKAGES[@]}"; do
	pythonPackage=${PYTHON_PACKAGES[i]}
	pythonVersion=${PYTHON_VERSIONS[i]}
	eval "PROVIDES_$pythonPackage=\"
		parameterized_$pythonPackage = $portVersion
		\""
	eval "REQUIRES_$pythonPackage=\"
		haiku
		cmd:python$pythonVersion
		\""
BUILD_REQUIRES="$BUILD_REQUIRES
	setuptools_$pythonPackage
	"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
	cmd:python$pythonVersion"
done

BUILD()
{
	for i in "${!PYTHON_PACKAGES[@]}"; do
		pythonPackage=${PYTHON_PACKAGES[i]}
		pythonVersion=${PYTHON_VERSIONS[i]}

		rm -rf "$sourceDir"-$pythonPackage
		cp -a "$sourceDir" "$sourceDir"-$pythonPackage
		cd "$sourceDir"-$pythonPackage

		python=python$pythonVersion
		$python setup.py build
	done
}

INSTALL()
{
	for i in "${!PYTHON_PACKAGES[@]}"; do
		pythonPackage=${PYTHON_PACKAGES[i]}
		pythonVersion=${PYTHON_VERSIONS[i]}

		cd "$sourceDir"-$pythonPackage

		python=python$pythonVersion
		installLocation=$prefix/lib/$python/vendor-packages
		export PYTHONPATH=$installLocation
		mkdir -p "$installLocation"
		$python setup.py install \
			--root=/ --prefix="$prefix" --skip-build

		packageEntries $pythonPackage \
			"$prefix"/lib/$python
	done
}
