1SUMMARY="Python module for decorators, wrappers and monkey patching"
2DESCRIPTION="The aim of the wrapt module is to provide a transparent object \
3proxy for Python, which can be used as the basis for the construction of \
4function wrappers and decorator functions."
5HOMEPAGE="https://github.com/GrahamDumpleton"
6COPYRIGHT="2013-2023, Graham Dumpleton"
7LICENSE="BSD (2-clause)"
8REVISION="1"
9SOURCE_URI="https://pypi.io/packages/source/w/wrapt/wrapt-$portVersion.tar.gz"
10CHECKSUM_SHA256="d06730c6aed78cee4126234cf2d071e01b44b915e725a6cb439a879ec9754a3a"
11
12ARCHITECTURES="all !x86_gcc2"
13SECONDARY_ARCHITECTURES="x86"
14
15PROVIDES="
16	$portName = $portVersion
17	"
18REQUIRES="
19	haiku$secondaryArchSuffix
20	"
21
22BUILD_REQUIRES="
23	haiku${secondaryArchSuffix}_devel
24	"
25BUILD_PREREQUIRES="
26	cmd:gcc$secondaryArchSuffix
27	"
28
29PYTHON_PACKAGES=(python39 python310)
30PYTHON_VERSIONS=(3.9 3.10)
31for i in "${!PYTHON_PACKAGES[@]}"; do
32	pythonPackage=${PYTHON_PACKAGES[i]}
33	pythonVersion=${PYTHON_VERSIONS[$i]}
34
35	eval "PROVIDES_$pythonPackage=\"
36		${portName}_$pythonPackage = $portVersion
37		\""
38	if [ "$targetArchitecture" = x86_gcc2 ]; then
39		eval "PROVIDES_$pythonPackage+=\"
40			wrapt_$pythonPackage = $portVersion
41			\""
42	fi
43	eval "REQUIRES_$pythonPackage=\"
44		cmd:python$pythonVersion
45		\""
46	BUILD_REQUIRES+="
47		build_$pythonPackage
48		installer_$pythonPackage
49		setuptools_$pythonPackage
50		wheel_$pythonPackage
51		"
52	BUILD_PREREQUIRES+="
53		cmd:python$pythonVersion
54		"
55	TEST_REQUIRES+="
56		wrapt_$pythonPackage
57		pytest_$pythonPackage
58		"
59done
60
61
62INSTALL()
63{
64	for i in "${!PYTHON_PACKAGES[@]}"; do
65		pythonVersion=${PYTHON_VERSIONS[$i]}
66
67		python=python$pythonVersion
68
69		rm -rf dist
70
71		$python -m build --wheel --skip-dependency-check --no-isolation
72		$python -m installer --p $prefix dist/*.whl
73
74		packageEntries ${PYTHON_PACKAGES[i]} \
75			"$prefix"/lib/python*
76	done
77}
78
79
80TEST()
81{
82	for i in "${!PYTHON_VERSIONS[@]}"; do
83		python=python${PYTHON_VERSIONS[$i]}
84		$python -m pytest
85	done
86}
87