# Template file for 'hatch'
pkgname=hatch
version=1.17.0
revision=1
build_style=python3-pep517
# ignore backend tests, because updating hatchling when there is no new hatch
# version yet breaks these in hatch.
# ignore all cli tests that assume that hatch was installed via pip
# ignore tests that create temporary files in /tmp, which doesn't work in the build env
# ignore tests that don't run on i686
make_check_args="--ignore tests/backend

 --deselect tests/cli/run/test_run.py::test_scripts_no_environment
 --deselect tests/cli/self/test_report.py::test_pyenv
 --deselect tests/cli/env/test_create.py::test_plugin_dependencies_met
 --deselect tests/cli/env/test_create.py::test_plugin_dependencies_met_as_app
 --deselect tests/cli/self/test_report.py::TestDefault::test_open
 --deselect tests/cli/self/test_report.py::TestDefault::test_no_open

 --deselect tests/cli/python/test_install.py::test_installation
 --deselect tests/cli/run/test_run.py::test_install_python_specific
 --deselect tests/cli/run/test_run.py::test_update_python_specific
 --deselect tests/cli/run/test_run.py::test_install_python_max_compatible
 --deselect tests/cli/run/test_run.py::test_update_python_max_compatible
 --deselect tests/cli/run/test_run.py::test_python_installation_with_metadata_hook
 --deselect tests/python/test_core.py::test_installation
 --deselect tests/workspaces/test_config.py::TestWorkspaceConfiguration::test_workspace_overrides_matrix_conditional_members
 --deselect tests/workspaces/test_config.py::TestWorkspaceConfiguration::test_workspace_overrides_combined_conditions

 --deselect tests/dep/test_sync.py::test_unknown_extra
 --deselect tests/dep/test_sync.py::test_extra_met
 --deselect tests/workspaces/test_config.py::TestWorkspaceConfiguration::test_workspace_development_workflow
"
_deps="python3-click python3-distro hatchling python3-httpx2 python3-hyperlink
 python3-keyring python3-packaging python3-pexpect python3-python-discovery
 python3-platformdirs python3-rich python3-shellingham python3-tomli-w
 python3-tomlkit python3-userpath uv python3-virtualenv python3-pyproject-hooks"
hostmakedepends="hatch-vcs ${_deps}"
depends="${_deps}"
checkdepends="${_deps} python3-pytest python3-pytest-mock python3-pytest-xdist
 git python3-pip python3-flit_core"
short_desc="Modern, extensible Python project management"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://hatch.pypa.io/latest/"
changelog="https://raw.githubusercontent.com/pypa/hatch/master/docs/history/hatch.md"
distfiles="${PYPI_SITE}/h/hatch/hatch-${version}.tar.gz"
checksum=2bbbf4aa8f6fda71a61fc24c22619261327b53d272b22d4cc16f4a6e9a8592bb
make_check_pre="env PYTHONPATH=./src"

post_install() {
	vlicense LICENSE.txt

	for shell in zsh bash fish; do
		PYTHONPATH="${DESTDIR}/${py3_sitelib}" PATH="${DESTDIR}/usr/bin:${PATH}" \
		  _HATCH_COMPLETE="${shell}_source" hatch > "hatch.${shell}"
		vcompletion "hatch.${shell}" "${shell}"
	done
}
