# Template file for 'python3-ansible-lint'
pkgname=python3-ansible-lint
version=6.3.0
revision=1
wrksrc="${pkgname/python3-/}-${version}"
build_style=python3-pep517
# These require ansible-lint installed properly, or they are flaky
make_check_args="--deselect test/test_eco.py::test_eco
 --deselect test/test_main.py::test_call_from_outside_venv
 --deselect test/test_cli_role_paths.py::test_run_single_role_path_no_trailing_slash_script
 --deselect test/test_cli_role_paths.py::test_run_multiple_role_path_with_trailing_slash
 --deselect test/test_cli_role_paths.py::test_run_role_name_with_prefix
 --deselect test/test_cli_role_paths.py::test_run_role_name_from_meta
 --deselect test/test_cli_role_paths.py::test_run_invalid_role_name_from_meta
 --deselect test/test_cli_role_paths.py::test_run_role_three_dir_deep
 --deselect test/test_cli_role_paths.py::test_run_playbook
 --deselect test/test_cli_role_paths.py::test_run_role_name_invalid
 --deselect test/test_cli_role_paths.py::test_run_single_role_path_no_trailing_slash_module
 --deselect test/test_cli_role_paths.py::test_run_inside_role_dir
 --deselect test/test_cli_role_paths.py::test_run_single_role_path_with_trailing_slash
 --deselect test/test_cli_role_paths.py::test_run_multiple_role_path_no_trailing_slash
 --deselect test/test_cli_role_paths.py::test_run_single_role_path_with_roles_path_env
 --deselect test/test_verbosity.py::test_default_verbosity
 --deselect test/test_task_includes.py::test_included_tasks
 --deselect test/test_utils.py::test_cli_auto_detect
 --deselect test/test_list_rules.py::test_list_rules_includes_opt_in_rules
 --deselect test/test_formatter_json.py::test_code_climate_parsable_ignored
 --deselect test/test_examples.py::test_custom_kinds
 --deselect src/ansiblelint/rules/only_builtins.py::test_only_builtin_fail
 --deselect test/test_import_playbook.py::test_task_hook_import_playbook
 --deselect test/test_rules_collection.py::test_rich_rule_listing"
make_install_target="ansible_lint-*-*-*-*.whl"
hostmakedepends="python3-wheel python3-setuptools_scm"
depends="ansible-core python3-yamllint python3-six python3-yaml
 python3-ruamel.yaml python3-tenacity python3-enrich python3-wcmatch
 python3-ansible-compat python3-jsonschema"
checkdepends="${depends} python3-pytest black python3-flake8 python3-flaky
 python3-mypy pylint python3-pytest-cov python3-pytest-xdist
 python3-pytest-forked"
short_desc="Linter for Ansible files"
maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz>"
# Note about licensing from upstream:
# The ansible-lint project is distributed as GPLv3 due to use of GPLv3 runtime
# dependencies, like ansible and yamllint. For historical reasons, its own
# code-base remains licensed under a more liberal MIT license and any
# contributions made are accepted as being made under original MIT license.
license="GPL-3.0-only"
homepage="https://github.com/ansible-community/ansible-lint"
distfiles="${PYPI_SITE}/a/${pkgname/python3-/}/${pkgname/python3-/}-${version}.tar.gz"
checksum=f57f520ae5d810ce062157dc7d633990ad2fbec81bbbb34ccc4ce3a0c21fcd38
make_check_pre="env PYTHONPATH=src"

post_patch() {
	vsed -e "/setuptools_scm_git_archive/d" -i pyproject.toml
	export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
}
