Files
haikuports/dev-python/pytest/pytest-7.1.3.recipe

78 lines
1.9 KiB
Bash

SUMMARY="A Python testing framework"
DESCRIPTION="The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries."
HOMEPAGE="https://pytest.org"
COPYRIGHT="2010-2020 Holger Krekel and others."
LICENSE="MIT"
REVISION="3"
SOURCE_URI="https://pypi.io/packages/source/p/pytest/pytest-$portVersion.tar.gz"
CHECKSUM_SHA256="4f365fec2dff9c1162f834d9f18af1ba13062db0c708bf7b946f8a5c76180c39"
ARCHITECTURES="any"
PROVIDES="
pytest=$portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\n\
cmd:py.test$pythonVersion\n\
cmd:pytest$pythonVersion\n\
\"; \
REQUIRES_$pythonPackage=\"\
haiku\n\
cmd:python$pythonVersion\n\
attrs_$pythonPackage\n\
importlib_metadata_$pythonPackage\n\
iniconfig_$pythonPackage\n\
packaging_$pythonPackage\n\
pluggy_$pythonPackage\n\
py_$pythonPackage\n\
tomli_$pythonPackage\n\
zipp_$pythonPackage\n\
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_scm_$pythonPackage
"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion
pip_$pythonPackage
"
done
INSTALL()
{
export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
mv $prefix/bin/pytest $prefix/bin/pytest$pythonVersion
mv $prefix/bin/py.test $prefix/bin/py.test$pythonVersion
packageEntries $pythonPackage \
$prefix/lib/python* \
$prefix/bin
done
}