1SUMMARY="A platform independent file lock"
2DESCRIPTION="This package contains a single module, which implements a platform independent file \
3lock in Python, which provides a simple way of inter-process communication."
4HOMEPAGE="https://github.com/tox-dev/py-filelock"
5COPYRIGHT="2023 Bern��t G��bor"
6LICENSE="Unlicense"
7REVISION="1"
8SOURCE_URI="$HOMEPAGE/archive/refs/tags/$portVersion.tar.gz"
9CHECKSUM_SHA256="4a26dad7207539e765a1f7a3cdbce868b5a266120366b660f1736f8955bc3ccb"
10SOURCE_FILENAME="filelock-$portVersion.tar.gz"
11SOURCE_DIR="py-filelock-$portVersion"
12
13ARCHITECTURES="any"
14
15PROVIDES="
16	$portName = $portVersion
17	"
18REQUIRES="
19	haiku
20	"
21
22BUILD_REQUIRES="
23	haiku_devel
24	"
25
26PYTHON_PACKAGES=(python39 python310)
27PYTHON_VERSIONS=(3.9 3.10)
28defaultTestVersion="python39"
29for i in "${!PYTHON_PACKAGES[@]}"; do
30	pythonPackage=${PYTHON_PACKAGES[i]}
31	pythonVersion=${PYTHON_VERSIONS[$i]}
32
33	eval "PROVIDES_$pythonPackage=\"
34		${portName}_$pythonPackage = $portVersion
35		\""
36	eval "REQUIRES_$pythonPackage=\"
37		haiku
38		cmd:python$pythonVersion
39		\""
40	BUILD_REQUIRES+="
41		build_$pythonPackage
42		hatch_vcs_$pythonPackage
43		hatchling_$pythonPackage
44		installer_$pythonPackage
45		"
46	BUILD_PREREQUIRES+="
47		cmd:python$pythonVersion
48		"
49done
50
51TEST_REQUIRES="
52	filelock_$defaultTestVersion
53	pytest_mock_$defaultTestVersion
54	cmd:pytest
55	"
56
57INSTALL()
58{
59	export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion
60
61	for i in "${!PYTHON_PACKAGES[@]}"; do
62		pythonVersion=${PYTHON_VERSIONS[$i]}
63
64		python=python$pythonVersion
65
66		$python -m build --wheel --skip-dependency-check --no-isolation
67		$python -m installer -p $prefix dist/*.whl
68
69		packageEntries ${PYTHON_PACKAGES[i]} \
70			$prefix/lib/python*
71	done
72}
73
74TEST()
75{
76	pytest -v
77}
78