Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/ansible-lint/files/, app-admin/ansible-lint/
Date: Fri, 01 Apr 2022 08:18:35
Message-Id: 1648801096.278b221bcab2832838c0fd619ea31204109dba76.marecki@gentoo
1 commit: 278b221bcab2832838c0fd619ea31204109dba76
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 30 09:25:22 2022 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 1 08:18:16 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=278b221b
7
8 app-admin/ansible-lint: add 6.0.2
9
10 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
11
12 app-admin/ansible-lint/Manifest | 1 +
13 app-admin/ansible-lint/ansible-lint-6.0.2.ebuild | 64 ++++++++++++++++++++++
14 .../ansible-lint-6.0.2_test-module-check.patch | 23 ++++++++
15 3 files changed, 88 insertions(+)
16
17 diff --git a/app-admin/ansible-lint/Manifest b/app-admin/ansible-lint/Manifest
18 index 349a47f494d5..5f77818c06af 100644
19 --- a/app-admin/ansible-lint/Manifest
20 +++ b/app-admin/ansible-lint/Manifest
21 @@ -1 +1,2 @@
22 DIST ansible-lint-5.4.0.tar.gz 349353 BLAKE2B 9f41abdf1e9485afa4c8ed9498627b0dcbdcf57916f3b57c9886de8bd806e4e5b34e7e9c2e66b44ac8009a0afcea4d8566900ee8d391eaca61081fa23323c41c SHA512 f1bbbb49eb77991d60b6087646c695a938d328d719bba67707af4ed858de857d383b78490bcf0930cffebd13a0b0abde20269a47e47e4713a37da715a28c5da0
23 +DIST ansible-lint-6.0.2.tar.gz 195044 BLAKE2B 3334049dd1dc05444c6c362601da8d7e808c6b3473e87613b8892651cecb76058cb0aa370aa5d00cf6bc76ee3b096480fdce52facee4f043c01d6c76084860ba SHA512 a47e79c59dfcf3e36654247bd206581798f2559261142e3943b60e0688d75b5a6332832a9f9127f99b2faa6afff959a33c55fbc80aa5881f064725998420f679
24
25 diff --git a/app-admin/ansible-lint/ansible-lint-6.0.2.ebuild b/app-admin/ansible-lint/ansible-lint-6.0.2.ebuild
26 new file mode 100644
27 index 000000000000..4acb496bb6ba
28 --- /dev/null
29 +++ b/app-admin/ansible-lint/ansible-lint-6.0.2.ebuild
30 @@ -0,0 +1,64 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +PYTHON_COMPAT=( python3_{8..10} )
37 +DISTUTILS_USE_PEP517=setuptools
38 +
39 +inherit distutils-r1
40 +
41 +DESCRIPTION="Checks ansible playbooks for practices and behaviour that can be improved"
42 +HOMEPAGE="https://github.com/ansible/ansible-lint"
43 +# PyPI tarballs do not contain all the data files needed by the tests
44 +SRC_URI="https://github.com/ansible/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
45 +
46 +LICENSE="MIT"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~riscv"
49 +
50 +RDEPEND="
51 + >=app-admin/ansible-base-2.12.0[${PYTHON_USEDEP}]
52 + >=dev-python/ansible-compat-2.0.2[${PYTHON_USEDEP}]
53 + >=dev-python/enrich-1.2.6[${PYTHON_USEDEP}]
54 + dev-python/packaging[${PYTHON_USEDEP}]
55 + dev-python/pyyaml[${PYTHON_USEDEP}]
56 + >=dev-python/rich-9.5.1[${PYTHON_USEDEP}]
57 + >=dev-python/ruamel-yaml-0.15.37[${PYTHON_USEDEP}]
58 + >=dev-python/wcmatch-7.0[${PYTHON_USEDEP}]
59 + >=dev-util/yamllint-1.25.0[${PYTHON_USEDEP}]"
60 +BDEPEND="
61 + >=dev-python/setuptools_scm-3.5.0[${PYTHON_USEDEP}]
62 + >=dev-python/setuptools_scm_git_archive-1.0[${PYTHON_USEDEP}]
63 + test? (
64 + >=dev-python/flaky-3.7.0[${PYTHON_USEDEP}]
65 + >=dev-python/pytest-xdist-2.5.0[${PYTHON_USEDEP}]
66 + )"
67 +
68 +PATCHES=(
69 + "${FILESDIR}"/${PN}-6.0.2_test-module-check.patch
70 +)
71 +
72 +# Skip problematic tests:
73 +# - test_call_from_outside_venv doesn't play nicely with the sandbox
74 +# - all test_eco and some test_prerun tests require Internet access
75 +# - as of 5.4.0, test_cli_auto_detect fails even when run manually with tox
76 +EPYTEST_DESELECT=(
77 + test/test_eco.py
78 + test/test_main.py::test_call_from_outside_venv
79 + test/test_prerun.py::test_install_collection
80 + test/test_prerun.py::test_prerun_reqs_v1
81 + test/test_prerun.py::test_prerun_reqs_v2
82 + test/test_prerun.py::test_require_collection_wrong_version
83 + test/test_utils.py::test_cli_auto_detect
84 +)
85 +
86 +distutils_enable_tests pytest
87 +
88 +python_test() {
89 + # As of 6.0.2, without this the test suite gets confused by the presence of ansible-lint modules
90 + # in both ${ED} and ${S}.
91 + cd "${S}" || die
92 +
93 + epytest test
94 +}
95
96 diff --git a/app-admin/ansible-lint/files/ansible-lint-6.0.2_test-module-check.patch b/app-admin/ansible-lint/files/ansible-lint-6.0.2_test-module-check.patch
97 new file mode 100644
98 index 000000000000..4288bb897c1e
99 --- /dev/null
100 +++ b/app-admin/ansible-lint/files/ansible-lint-6.0.2_test-module-check.patch
101 @@ -0,0 +1,23 @@
102 +Let the package managers handle dependencies, m'kay?
103 +
104 +--- a/conftest.py
105 ++++ b/conftest.py
106 +@@ -3,18 +3,6 @@
107 + import os
108 + import sys
109 +
110 +-# checking if user is running pytest without installing test dependencies:
111 +-missing = []
112 +-for module in ["ansible", "black", "flake8", "flaky", "mypy", "pylint", "pytest_cov"]:
113 +- if not importlib.util.find_spec(module):
114 +- missing.append(module)
115 +-if missing:
116 +- print(
117 +- f"FATAL: Missing modules: {', '.join(missing)} -- probably you missed installing test requirements with: pip install -e '.[test]'",
118 +- file=sys.stderr,
119 +- )
120 +- sys.exit(1)
121 +-
122 +
123 + os.environ["NO_COLOR"] = "1"
124 + pytest_plugins = ["ansiblelint.testing.fixtures"]