commit:     e0d3330271f1fc33cd4e500757f9874d9c8415ec
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 13 09:46:26 2022 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 09:46:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0d33302

app-admin/ansible-lint: add 6.8.1

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 app-admin/ansible-lint/Manifest                    |  1 +
 app-admin/ansible-lint/ansible-lint-6.8.1.ebuild   | 80 ++++++++++++++++++++++
 .../ansible-lint-6.8.1_test-module-check.patch     | 43 ++++++++++++
 3 files changed, 124 insertions(+)

diff --git a/app-admin/ansible-lint/Manifest b/app-admin/ansible-lint/Manifest
index f9eaa3509efc..a06483ebca57 100644
--- a/app-admin/ansible-lint/Manifest
+++ b/app-admin/ansible-lint/Manifest
@@ -1,2 +1,3 @@
 DIST ansible-lint-6.5.2.gh.tar.gz 248425 BLAKE2B 
02fe3f0cb410831ee7913c5f5ae434678ff183f9c60f0355988d69b516324513fd417439f9ceee4a38192c1e593d7bc00c8fd1aafdff6ba904cdb4ba56257657
 SHA512 
36a8d7b746bbb0c0f4d85a63180432b9165b1e59ff9da07f6b9477aa02d8998c5c682a317a04c4971a08f0691a10f420d9fd0e7d396d7d1b7f49979c7faf41f5
 DIST ansible-lint-6.7.0.gh.tar.gz 275573 BLAKE2B 
56788efbd44f6c2d8f1dd946d26f4c784c5c9e077355823d143a7b95196a3b5ce672a987639da6f051832320585fe7106d92c293a0707c9886142eebdaa812f5
 SHA512 
39d5292c5d262a6ee6fe60b41d531d362c95b466fe28524d314c0f2554e50906db050df93c7dc6374b99e6ef283754844e08484d24570bbbaf637d08e0af4ae2
+DIST ansible-lint-6.8.1.gh.tar.gz 287839 BLAKE2B 
21421d7254a63b1460ce3f36529967a988c2835761f7ff1973b62c3210fffabc0eb95ede09fc5e582586782f7e258bd0b7534cf786671bc628631bf8d815644c
 SHA512 
cd368d568f33a9711299b8a563f99f3d5eb6bed8334cb63e60fa43239716013a7d47e42e059c521a687d2e7cfc4c6d60621f1123050428f9ede0865c60d3ace0

diff --git a/app-admin/ansible-lint/ansible-lint-6.8.1.ebuild 
b/app-admin/ansible-lint/ansible-lint-6.8.1.ebuild
new file mode 100644
index 000000000000..1632b2104f54
--- /dev/null
+++ b/app-admin/ansible-lint/ansible-lint-6.8.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_USE_PEP517=setuptools
+
+inherit distutils-r1
+
+DESCRIPTION="Checks ansible playbooks for practices and behaviour that can be 
improved"
+HOMEPAGE="https://github.com/ansible/ansible-lint";
+# PyPI tarballs do not contain all the data files needed by the tests
+SRC_URI="https://github.com/ansible/${PN}/archive/refs/tags/v${PV}.tar.gz -> 
${P}.gh.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~riscv"
+
+RDEPEND="
+       >=app-admin/ansible-core-2.12.0[${PYTHON_USEDEP}]
+       >=dev-python/ansible-compat-2.2.0[${PYTHON_USEDEP}]
+       dev-python/black[${PYTHON_USEDEP}]
+       >=dev-python/enrich-1.2.6[${PYTHON_USEDEP}]
+       dev-python/filelock[${PYTHON_USEDEP}]
+       >=dev-python/jsonschema-4.9.0[${PYTHON_USEDEP}]
+       dev-python/packaging[${PYTHON_USEDEP}]
+       dev-python/pyyaml[${PYTHON_USEDEP}]
+       >=dev-python/rich-9.5.1[${PYTHON_USEDEP}]
+       >=dev-python/ruamel-yaml-0.15.37[${PYTHON_USEDEP}]
+       >=dev-python/wcmatch-7.0[${PYTHON_USEDEP}]
+       >=dev-util/yamllint-1.25.0[${PYTHON_USEDEP}]"
+BDEPEND="
+       >=dev-python/setuptools_scm-3.5.0[${PYTHON_USEDEP}]
+       >=dev-python/setuptools_scm_git_archive-1.0[${PYTHON_USEDEP}]
+       test? (
+               >=dev-python/flaky-3.7.0[${PYTHON_USEDEP}]
+               >=dev-python/pytest-plus-0.2[${PYTHON_USEDEP}]
+               >=dev-python/pytest-xdist-2.5.0[${PYTHON_USEDEP}]
+       )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.8.1_test-module-check.patch
+)
+
+# Skip problematic tests:
+#  - test_rules_id_format has been giving an internal error since 6.5.4 or so 
(TODO: follow this up with upstream)
+#  - test_call_from_outside_venv doesn't play nicely with the sandbox
+#  - all the others require Internet access, mostly in order to access Ansible 
Galaxy
+EPYTEST_DESELECT=(
+       test/test_cli_role_paths.py::test_run_playbook_github
+       test/test_eco.py
+       test/test_examples.py::test_custom_kinds
+       test/test_import_playbook.py::test_task_hook_import_playbook
+       test/test_list_rules.py::test_list_rules_includes_opt_in_rules
+       test/test_list_rules.py::test_list_rules_with_format_option
+       test/test_list_rules.py::test_list_tags_includes_opt_in_rules
+       test/test_main.py::test_call_from_outside_venv
+       test/test_prerun.py::test_install_collection
+       test/test_prerun.py::test_prerun_reqs_v1
+       test/test_prerun.py::test_prerun_reqs_v2
+       test/test_prerun.py::test_require_collection_wrong_version
+       test/test_profiles.py::test_profile_listing
+       test/test_rules_collection.py::test_rich_rule_listing
+       test/test_rules_collection.py::test_rules_id_format
+       test/test_skip_inside_yaml.py::test_role_meta
+       test/test_utils.py::test_cli_auto_detect
+       test/test_utils.py::test_template_lookup
+       test/test_verbosity.py::test_default_verbosity
+)
+
+distutils_enable_tests pytest
+
+python_test() {
+       # Since 6.2.1, without this the test suite still gets confused by the 
presence of ansible-lint modules
+       # in both ${ED} and ${S}.
+       cd "${S}" || die
+
+       epytest test
+}

diff --git 
a/app-admin/ansible-lint/files/ansible-lint-6.8.1_test-module-check.patch 
b/app-admin/ansible-lint/files/ansible-lint-6.8.1_test-module-check.patch
new file mode 100644
index 000000000000..8c2ca1a96503
--- /dev/null
+++ b/app-admin/ansible-lint/files/ansible-lint-6.8.1_test-module-check.patch
@@ -0,0 +1,43 @@
+--- a/conftest.py
++++ b/conftest.py
+@@ -8,40 +8,6 @@
+ import pytest
+ from ansible.module_utils.common.yaml import HAS_LIBYAML
+ 
+-# checking if user is running pytest without installing test dependencies:
+-missing = []
+-for module in ["ansible", "black", "flake8", "flaky", "mypy", "pylint"]:
+-    if not importlib.util.find_spec(module):
+-        missing.append(module)
+-if missing:
+-    print(
+-        f"FATAL: Missing modules: {', '.join(missing)} -- probably you missed 
installing test requirements with: pip install -e '.[test]'",
+-        file=sys.stderr,
+-    )
+-    sys.exit(1)
+-# we need to be sure that we have the requirements installed as some tests
+-# might depend on these.
+-try:
+-    subprocess.check_output(
+-        ["ansible-galaxy", "collection", "install", "-r", "requirements.yml"],
+-        stderr=subprocess.PIPE,
+-        text=True,
+-    )
+-except subprocess.CalledProcessError as exc:
+-    print(f"{exc}\n{exc.stderr}\n{exc.stdout}", file=sys.stderr)
+-    sys.exit(1)
+-
+-if not HAS_LIBYAML and sys.version_info >= (3, 9, 0):
+-    # While presence of libyaml is not required for runtime, we keep this 
error
+-    # fatal here in order to be sure that we spot libyaml errors during 
testing.
+-    #
+-    # For 3.8.x we do not do this check, as libyaml does not have an arm64 
build for py38.
+-    print(
+-        "FATAL: For testing, we require pyyaml to be installed with its 
native extension, missing it would make testing 3x slower and risk missing 
essential bugs.",
+-        file=sys.stderr,
+-    )
+-    sys.exit(1)
+-
+ 
+ os.environ["NO_COLOR"] = "1"
+ 

Reply via email to