1SUMMARY="Hatch plugin for versioning with your preferred VCS"
2DESCRIPTION="This provides a plugin for Hatch that uses your preferred version control system \
3(like Git) to determine project versions."
4HOMEPAGE="https://github.com/ofek/hatch-vcs"
5COPYRIGHT="2022-present Ofek Lev"
6LICENSE="MIT"
7REVISION="1"
8SOURCE_URI="https://pypi.python.org/packages/source/h/hatch-vcs/hatch_vcs-$portVersion.tar.gz"
9CHECKSUM_SHA256="cec5107cfce482c67f8bc96f18bbc320c9aa0d068180e14ad317bbee5a153fee"
10PATCHES="26.patch" # from upstream
11
12ARCHITECTURES="any"
13
14PROVIDES="
15	$portName = $portVersion
16	"
17REQUIRES="
18	haiku
19	"
20
21BUILD_REQUIRES="
22	haiku_devel
23	"
24
25PYTHON_PACKAGES=(python39 python310)
26PYTHON_VERSIONS=(3.9 3.10)
27defaultTestVersion="python39"
28for i in "${!PYTHON_PACKAGES[@]}"; do
29	pythonPackage=${PYTHON_PACKAGES[i]}
30	pythonVersion=${PYTHON_VERSIONS[$i]}
31
32	eval "PROVIDES_$pythonPackage=\"
33		${portName}_$pythonPackage = $portVersion
34		\""
35	eval "REQUIRES_$pythonPackage=\"
36		haiku
37		hatchling_$pythonPackage
38		setuptools_scm_$pythonPackage
39		cmd:python$pythonVersion
40		\""
41	BUILD_REQUIRES+="
42		build_$pythonPackage
43		hatchling_$pythonPackage
44		installer_$pythonPackage
45		"
46	BUILD_PREREQUIRES+="
47		cmd:python$pythonVersion
48		"
49done
50
51TEST_REQUIRES="
52	hatch_vcs_$defaultTestVersion
53	cmd:git
54	cmd:pytest
55	"
56
57INSTALL()
58{
59	for i in "${!PYTHON_PACKAGES[@]}"; do
60		pythonVersion=${PYTHON_VERSIONS[$i]}
61
62		python=python$pythonVersion
63
64		$python -m build --wheel --skip-dependency-check --no-isolation
65		$python -m installer -p $prefix dist/*.whl
66
67		packageEntries ${PYTHON_PACKAGES[i]} \
68			$prefix/lib/python*
69	done
70}
71
72TEST()
73{
74	pytest -v
75}
76