diff options
Diffstat (limited to '')
-rw-r--r-- | debian/ansible-lint.lintian-overrides | 2 | ||||
-rw-r--r-- | debian/changelog | 12 | ||||
-rw-r--r-- | debian/control | 32 | ||||
-rw-r--r-- | debian/patches/deb-testing.patch | 51 | ||||
-rw-r--r-- | debian/patches/remove_version_check.patch | 8 | ||||
-rw-r--r-- | debian/patches/ruamel-yaml-0.18.5.patch | 48 | ||||
-rw-r--r-- | debian/patches/series | 2 | ||||
-rwxr-xr-x | debian/rules | 24 | ||||
-rw-r--r-- | debian/upstream/metadata | 1 |
9 files changed, 160 insertions, 20 deletions
diff --git a/debian/ansible-lint.lintian-overrides b/debian/ansible-lint.lintian-overrides new file mode 100644 index 0000000..6a22138 --- /dev/null +++ b/debian/ansible-lint.lintian-overrides @@ -0,0 +1,2 @@ +# Not docs, but data files +ansible-lint: package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/ansiblelint/*.md] diff --git a/debian/changelog b/debian/changelog index 8479da7..985c8b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +ansible-lint (6.17.2-2) unstable; urgency=medium + + * Team upload. + * Add patch for newer ruamel.yaml 0.18.5+ + * Enable testing using pybuild & pytest, also as autopkgtests. + * Ignore lintian complaints about ansiblelint/rules/*.md "package- + contains-documentation-outside-usr-share-doc" + * d/control: reformatted + * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update) + + -- Michael R. Crusoe <crusoe@debian.org> Mon, 29 Apr 2024 12:48:02 +0200 + ansible-lint (6.17.2-1~progress7.99u1) graograman-backports; urgency=medium * Initial reupload to graograman-backports. diff --git a/debian/control b/debian/control index 15dddef..6f2c517 100644 --- a/debian/control +++ b/debian/control @@ -1,28 +1,41 @@ Source: ansible-lint -Section: misc -Priority: optional Maintainer: Progress Linux Maintainers <maintainers@lists.progress-linux.org> XSBC-Uploaders: Daniel Baumann <daniel.baumann@progress-linux.org> XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org> -XSBC-Original-Uploaders: Samuel Henrique <samueloph@debian.org>, Gregory Colpart <reg@debian.org> +XSBC-Original-Uploaders: Samuel Henrique <samueloph@debian.org>, + Gregory Colpart <reg@debian.org> Bugs: mailto:maintainers@lists.progress-linux.org +Section: misc +Priority: optional Build-Depends: debhelper-compat (= 13), - dh-python, + dh-sequence-python3, pybuild-plugin-pyproject, python3-all, python3-setuptools, python3-setuptools-scm, + python3-pytest <!nocheck>, + python3-pytest-mock <!nocheck>, + python3-pytest-xdist <!nocheck>, + python3-ansible-compat (>= 4.0.5) <!nocheck>, + python3-filelock (>= 3.3.0) <!nocheck>, + python3-rich (>= 12.0.0) <!nocheck>, + python3-ruamel.yaml (>= 0.18.5) <!nocheck>, + python3-wcmatch <!nocheck>, + black (>= 22.8.0) <!nocheck>, + git <!nocheck>, + yamllint (>= 1.30.0) <!nocheck> Standards-Version: 4.6.2 -Rules-Requires-Root: no -Homepage: https://github.com/ansible-community/ansible-lint Vcs-Browser: https://git.progress-linux.org/packages/graograman-backports/ansible-lint Vcs-Git: https://git.progress-linux.org/packages/graograman-backports/ansible-lint XSBC-Original-Vcs-Browser: https://salsa.debian.org/python-team/packages/ansible-lint XSBC-Original-Vcs-Git: https://salsa.debian.org/python-team/packages/ansible-lint.git +Homepage: https://github.com/ansible-community/ansible-lint +Rules-Requires-Root: no +Testsuite: autopkgtest-pkg-pybuild Package: ansible-lint Architecture: all -Depends: ansible-core (>= 2.12.0), +Depends: ansible-core, black (>= 22.8.0), git, python3-ansible-compat (>= 4.0.5), @@ -32,9 +45,8 @@ Depends: ansible-core (>= 2.12.0), python3-packaging (>= 21.3), python3-pathspec (>= 0.10.3), python3-rich (>= 12.0.0), - python3-ruamel.yaml (>= 0.17.0), - python3-ruamel.yaml (<< 0.18), - python3-wcmatch (>= 8.1.2), + python3-ruamel.yaml (>= 0.18.5), + python3-wcmatch, python3-yaml (>= 5.4.1), yamllint (>= 1.30.0), ${misc:Depends}, diff --git a/debian/patches/deb-testing.patch b/debian/patches/deb-testing.patch new file mode 100644 index 0000000..7556c4f --- /dev/null +++ b/debian/patches/deb-testing.patch @@ -0,0 +1,51 @@ +Author: Michael R. Crusoe <crusoe@debian.org> +Description: Debian-specific changes for running the tests offline during the build +Forwarded: not-needed +--- ansible-lint.orig/conftest.py ++++ ansible-lint/conftest.py +@@ -15,7 +15,7 @@ + + # checking if user is running pytest without installing test dependencies: + missing = [] +-for module in ["ansible", "black", "mypy", "pylint"]: ++for module in ["ansible", "black"]: + if not importlib.util.find_spec(module): + missing.append(module) + if missing: +@@ -30,18 +30,6 @@ + """Ensure we run preparation only on master thread when running in parallel.""" + if is_help_option_present(config): + return +- if is_master(config): +- # we need to be sure that we have the requirements installed as some tests +- # might depend on these. This approach is compatible with GHA caching. +- try: +- subprocess.check_output( +- ["./tools/install-reqs.sh"], # noqa: S603 +- stderr=subprocess.PIPE, +- text=True, +- ) +- except subprocess.CalledProcessError as exc: +- print(f"{exc}\n{exc.stderr}\n{exc.stdout}", file=sys.stderr) # noqa: T201 +- sys.exit(1) + + + def is_help_option_present(config: pytest.Config) -> bool: +--- ansible-lint.orig/test/test_schemas.py ++++ ansible-lint/test/test_schemas.py +@@ -10,7 +10,6 @@ + from unittest.mock import DEFAULT, MagicMock, patch + + import pytest +-import spdx.config + + from ansiblelint.file_utils import Lintable + from ansiblelint.schemas import __file__ as schema_module +@@ -18,7 +17,6 @@ + from ansiblelint.schemas.main import validate_file_schema + + schema_path = Path(schema_module).parent +-spdx_config_path = Path(spdx.config.__file__).parent + + + def test_refresh_schemas() -> None: diff --git a/debian/patches/remove_version_check.patch b/debian/patches/remove_version_check.patch index 8e57d96..c68c8aa 100644 --- a/debian/patches/remove_version_check.patch +++ b/debian/patches/remove_version_check.patch @@ -1,11 +1,9 @@ Description: Remove version check at runtime Author: Samuel Henrique <samueloph@debian.org> Forwarded: not-needed -Index: ansible-lint/src/ansiblelint/config.py -=================================================================== --- ansible-lint.orig/src/ansiblelint/config.py +++ ansible-lint/src/ansiblelint/config.py -@@ -270,53 +270,5 @@ def get_deps_versions() -> dict[str, Ver +@@ -265,53 +265,5 @@ def get_version_warning() -> str: @@ -61,11 +59,9 @@ Index: ansible-lint/src/ansiblelint/config.py - return msg + """Patched on Debian to not download release information from third parties""" + return "" -Index: ansible-lint/test/test_main.py -=================================================================== --- ansible-lint.orig/test/test_main.py +++ ansible-lint/test/test_main.py -@@ -48,7 +48,7 @@ def test_call_from_outside_venv(expected +@@ -48,7 +48,7 @@ warning_found = "PATH altered to include" in proc.stderr assert warning_found is expected_warning diff --git a/debian/patches/ruamel-yaml-0.18.5.patch b/debian/patches/ruamel-yaml-0.18.5.patch new file mode 100644 index 0000000..aaf29c6 --- /dev/null +++ b/debian/patches/ruamel-yaml-0.18.5.patch @@ -0,0 +1,48 @@ +From: Sorin Sbarnea <ssbarnea@redhat.com> +Date: Fri, 3 Nov 2023 12:59:04 +0000 +Subject: Require ruamel.yaml >= 0.18.5 +Origin: upstream,https://github.com/ansible/ansible-lint/pull/3880 +Forwarded: not-needed + +Backported from upstream for version 6.17.2 + +--- ansible-lint.orig/.config/requirements.in ++++ ansible-lint/.config/requirements.in +@@ -10,7 +10,7 @@ + pathspec>=0.10.3 # Mozilla Public License 2.0 (MPL 2.0) + pyyaml>=5.4.1 # MIT (centos 9 has 5.3.1) + rich>=12.0.0 # MIT +-ruamel.yaml>=0.17.0,<0.18,!=0.17.29,!=0.17.30 # MIT, next version is planned to have breaking changes ++ruamel.yaml>=0.18.5 # MIT + requests>=2.31.0 # Apache-2.0 (indirect, but we want newer version for security reasons) + subprocess-tee>=0.4.1 # MIT, used by ansible-compat + yamllint >= 1.30.0 # GPLv3 +--- ansible-lint.orig/src/ansiblelint/yaml_utils.py ++++ ansible-lint/src/ansiblelint/yaml_utils.py +@@ -795,7 +795,7 @@ + """ + # Default to reading/dumping YAML 1.1 (ruamel.yaml defaults to 1.2) + self._yaml_version_default: tuple[int, int] = (1, 1) +- self._yaml_version: str | tuple[int, int] = self._yaml_version_default ++ self._yaml_version: tuple[int, int] = self._yaml_version_default + + super().__init__(typ=typ, pure=pure, output=output, plug_ins=plug_ins) + +@@ -898,7 +898,7 @@ + return cast(dict[str, Union[bool, int, str]], config) + + @property # type: ignore[override] +- def version(self) -> str | tuple[int, int]: ++ def version(self) -> tuple[int, int]: + """Return the YAML version used to parse or dump. + + Ansible uses PyYAML which only supports YAML 1.1. ruamel.yaml defaults to 1.2. +@@ -909,7 +909,7 @@ + return self._yaml_version + + @version.setter +- def version(self, value: str | tuple[int, int] | None) -> None: ++ def version(self, value: tuple[int, int] | None) -> None: + """Ensure that yaml version uses our default value. + + The yaml Reader updates this value based on the ``%YAML`` directive in files. diff --git a/debian/patches/series b/debian/patches/series index 836a30d..6aa9c8a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,3 @@ +ruamel-yaml-0.18.5.patch remove_version_check.patch +deb-testing.patch diff --git a/debian/rules b/debian/rules index 24db829..b0f80a6 100755 --- a/debian/rules +++ b/debian/rules @@ -1,8 +1,24 @@ #!/usr/bin/make -f -include /usr/share/dpkg/pkg-info.mk +export LC_ALL=C.UTF-8 +export PYBUILD_BEFORE_TEST=cp --recursive {dir}/examples {dir}/conftest.py {dir}/.pre-commit-config.yaml {dir}/.ansible-lint {build_dir}/ +export PYBUILD_AFTER_TEST=rm -Rf {build_dir}/examples {build_dir}/conftest.py {build_dir}/.pre-commit-config.yaml {build_dir}/.ansible-lint -%: - dh $@ --with python3 --buildsystem=pybuild +export PYBUILD_TEST_ARGS=-n auto -k "not (test_spdx or test_args_module_pass or test_risky_file_permissions or test_fqcn_builtin_fail or test_fqcn_builtin_pass or test_transformer or test_call_from_outside_venv or test_schema_moves or test_rules_id_format or test_yamllint or test_example or test_example_custom_module or test_verbosity or test_task_hook_import_playbook)" +# test_spdx: requires the yet-to-be-packaged https://pypi.org/project/spdx/ +# test_args_module_pass: require internet access +# test_risky_file_permissions: requires internet access +# test_fqcn_builtin_fail: requires internet access +# test_fqcn_builtin_pass: requires internet access +# test_transformer: required internet access +# test_call_from_outside_venv: assumes we are running the test from a virtualenv +# test_schema_moves: unknown +# test_rules_id_format: unknown +# test_yamllint: unknown (due to different version of yamllint?) +# test_example: unknown +# test_example_custom_module: unknown +# test_verbosity: unknown +# test_task_hook_import_playbook: unknown -override_dh_auto_test: +%: + dh $@ --buildsystem=pybuild diff --git a/debian/upstream/metadata b/debian/upstream/metadata index d0fc2e1..2607d00 100644 --- a/debian/upstream/metadata +++ b/debian/upstream/metadata @@ -2,3 +2,4 @@ Bug-Database: https://github.com/ansible/ansible-lint/issues Bug-Submit: https://github.com/ansible/ansible-lint/issues/new Repository: https://github.com/ansible/ansible-lint.git Repository-Browse: https://github.com/ansible/ansible-lint +Security-Contact: https://github.com/ansible/ansible-lint/tree/HEAD/.github/SECURITY.md |