Files
haikuports/dev-python/freezegun/freezegun-1.2.2.recipe
2023-06-04 16:32:07 +02:00

78 lines
1.6 KiB
Bash

SUMMARY="Let your Python tests travel through time"
DESCRIPTION="FreezeGun is a library that allows your Python tests to travel through time by \
mocking the datetime module."
HOMEPAGE="https://github.com/spulec/freezegun"
COPYRIGHT="2023 Steve Pulec"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://pypi.python.org/packages/source/f/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="cd22d1ba06941384410cd967d8a99d5ae2442f57dfafeff2fda5de8dc5c05446"
PATCHES="397.patch" # from upstream
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
defaultTestVersion="python39"
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
dateutil_$pythonPackage
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
TEST_REQUIRES="
dateutil_$defaultTestVersion
cmd:pytest
"
INSTALL()
{
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
packageEntries $pythonPackage \
$prefix/lib/python*
done
}
TEST()
{
pytest -v
}