From d8bae18e601c0212d0e61631f354f9c6bc109a8397a80ac14cfab695b06344c5 Mon Sep 17 00:00:00 2001 From: Thomas Renninger Date: Tue, 15 Feb 2022 17:15:02 +0000 Subject: [PATCH] Accepting request 954674 from home:sebix:branches:systemsmanagement - disable the tests test_co and test_call_from_outside_venv, they expect the ansible-lint executable in /usr/bin/ see https://github.com/ansible-community/ansible-lint/issues/1885 - remove obsolete fix-discover_lintables.patchs - Update to version 5.4.0: - Minor Changes - Neuter min space requirement for inline comments (#1821) @ssbarnea - Allow rules to request original raw task data (#1834) @cognifloyd - Add utils.nested_items_path and Deprecate utils.nested_items (#1824) @cognifloyd - MatchError's should include the filename (#1806) @cognifloyd - Bugfixes - Allow use without activation of virtualenv (#1860) @ssbarnea - Avoid running code on ansiblelint.config import (#1870) @ssbarnea - Avoid false positive with git lfs command (#1859) @ssbarnea - Strip ./ from discover_lintables results (#1837) @sebix - Correcting formatting of sample .ansible-lint config (#1841) @IronTooch - Move ansiblelint.testing.RunFromText import into test code (#1827) @cognifloyd - Allow noqa to be used in more lintable kinds (#1819) @SirUli - Recursively extract tasks from blocks (#1809) @cognifloyd OBS-URL: https://build.opensuse.org/request/show/954674 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ansible-lint?expand=0&rev=9 --- ansible-lint-5.3.2.tar.gz | 3 -- ansible-lint-5.4.0.tar.gz | 3 ++ ansible-lint.changes | 26 +++++++++++++ ansible-lint.spec | 75 ++++++++++++++++++------------------ fix-discover_lintables.patch | 48 ----------------------- 5 files changed, 66 insertions(+), 89 deletions(-) delete mode 100644 ansible-lint-5.3.2.tar.gz create mode 100644 ansible-lint-5.4.0.tar.gz delete mode 100644 fix-discover_lintables.patch diff --git a/ansible-lint-5.3.2.tar.gz b/ansible-lint-5.3.2.tar.gz deleted file mode 100644 index 025b651..0000000 --- a/ansible-lint-5.3.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3a04e4aebec09223b06afe6a484756a24f33ed449679b454be0bc3bf069345f -size 342936 diff --git a/ansible-lint-5.4.0.tar.gz b/ansible-lint-5.4.0.tar.gz new file mode 100644 index 0000000..d18c1ef --- /dev/null +++ b/ansible-lint-5.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:735c22e074b9be1c3a7e133de7db2af781c0ddae6c91cba035c0d89de964e462 +size 349353 diff --git a/ansible-lint.changes b/ansible-lint.changes index c24aa8f..b5081b2 100644 --- a/ansible-lint.changes +++ b/ansible-lint.changes @@ -1,3 +1,29 @@ +------------------------------------------------------------------- +Tue Feb 15 09:21:58 UTC 2022 - Sebastian Wagner + +- disable the tests test_co and test_call_from_outside_venv, they expect the ansible-lint executable in /usr/bin/ + see https://github.com/ansible-community/ansible-lint/issues/1885 + +------------------------------------------------------------------- +Sun Feb 13 08:42:03 UTC 2022 - Sebastian Wagner + +- remove obsolete fix-discover_lintables.patchs +- Update to version 5.4.0: + - Minor Changes + - Neuter min space requirement for inline comments (#1821) @ssbarnea + - Allow rules to request original raw task data (#1834) @cognifloyd + - Add utils.nested_items_path and Deprecate utils.nested_items (#1824) @cognifloyd + - MatchError's should include the filename (#1806) @cognifloyd + - Bugfixes + - Allow use without activation of virtualenv (#1860) @ssbarnea + - Avoid running code on ansiblelint.config import (#1870) @ssbarnea + - Avoid false positive with git lfs command (#1859) @ssbarnea + - Strip ./ from discover_lintables results (#1837) @sebix + - Correcting formatting of sample .ansible-lint config (#1841) @IronTooch + - Move ansiblelint.testing.RunFromText import into test code (#1827) @cognifloyd + - Allow noqa to be used in more lintable kinds (#1819) @SirUli + - Recursively extract tasks from blocks (#1809) @cognifloyd + ------------------------------------------------------------------- Sat Jan 29 08:57:07 UTC 2022 - Sebastian Wagner diff --git a/ansible-lint.spec b/ansible-lint.spec index 62266d1..2f4a568 100644 --- a/ansible-lint.spec +++ b/ansible-lint.spec @@ -1,7 +1,7 @@ # # spec file for package ansible-lint # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # Copyright 2018 by Lars Vogdt # # All modifications and additions to the file contributed by third parties @@ -13,56 +13,54 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global lib_name ansiblelint %{?python_enable_dependency_generator} -Name: ansible-lint -Version: 5.3.2 -Release: 1%{?dist} -Summary: Best practices checker for Ansible -License: MIT -Url: https://github.com/willthames/ansible-lint -Source0: https://github.com/willthames/ansible-lint/archive/v%{version}/ansible-lint-%{version}.tar.gz -Patch0: https://github.com/ansible-community/ansible-lint/pull/1837.patch#/fix-discover_lintables.patch -BuildArch: noarch -BuildRequires: python-rpm-macros -BuildRequires: python3-pip -BuildRequires: python3-wheel -BuildRequires: python3-PyYAML -BuildRequires: python3-six +Name: ansible-lint +Version: 5.4.0 +Release: 1%{?dist} +Summary: Best practices checker for Ansible +License: MIT +URL: https://github.com/ansible-community/ansible-lint +Source0: https://github.com/ansible-community/ansible-lint/archive/v%{version}/ansible-lint-%{version}.tar.gz +BuildArch: noarch +BuildRequires: python-rpm-macros +BuildRequires: python3-PyYAML +BuildRequires: python3-pip +BuildRequires: python3-six +BuildRequires: python3-wheel # SECTION tests -BuildRequires: python3-pytest-xdist -BuildRequires: python3-flaky -BuildRequires: python3-tenacity -BuildRequires: python3-packaging -BuildRequires: python3-yamllint +BuildRequires: python3-pytest-xdist +BuildRequires: python3-flaky +BuildRequires: python3-packaging +BuildRequires: python3-tenacity +BuildRequires: python3-yamllint #BuildRequires: git -BuildRequires: python3-enrich >= 1.2.6 -BuildRequires: python3-rich >= 9.5.1 -BuildRequires: python3-wcmatch >= 7.0 -BuildRequires: python3-ruamel.yaml >= 0.15.37 +BuildRequires: python3-enrich >= 1.2.6 +BuildRequires: python3-rich >= 9.5.1 +BuildRequires: python3-ruamel.yaml >= 0.15.37 +BuildRequires: python3-wcmatch >= 7.0 # /SECTION -BuildRequires: ansible -BuildRequires: fdupes -Requires: ansible -Requires: python3-PyYAML -Requires: python3-six -Requires: python3-tenacity -Requires: python3-packaging -Requires: python3-enrich >= 1.2.6 -Requires: python3-rich >= 9.5.1 -Requires: python3-wcmatch >= 7.0 -Requires: python3-ruamel.yaml >= 0.15.37 +BuildRequires: ansible +BuildRequires: fdupes +Requires: ansible +Requires: python3-PyYAML +Requires: python3-enrich >= 1.2.6 +Requires: python3-packaging +Requires: python3-rich >= 9.5.1 +Requires: python3-ruamel.yaml >= 0.15.37 +Requires: python3-six +Requires: python3-tenacity +Requires: python3-wcmatch >= 7.0 %description Checks playbooks for practices and behavior that could potentially be improved. %prep %setup -n ansible-lint-%{version} -%patch0 -p1 sed -ri 's/(\[metadata\])/\1\nversion = %{version}/' setup.cfg sed -i '1{/\/usr\/bin\/env python/d;}' src/ansiblelint/__main__.py @@ -80,7 +78,8 @@ python3 -O -m compileall %{buildroot}/%{python3_sitelib} %check # exclude some tests depending on internet access (galaxy modules) # exclude test_cli_auto_detect which depends on a local git repository -PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}%{buildroot}/%{python3_sitelib} PATH=${PATH:+$PATH:}%{buildroot}/%{_bindir} PYTHONDONTWRITEBYTECODE=1 pytest -v -k 'not (test_prerun_reqs_v1 or test_prerun_reqs_v2 or test_install_collection or test_require_collection_wrong_version or test_cli_auto_detect)' +# exclude test_co and test_call_from_outside_venv because of https://github.com/ansible-community/ansible-lint/issues/1885 +PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}%{buildroot}/%{python3_sitelib} PATH=${PATH:+$PATH:}%{buildroot}/%{_bindir} PYTHONDONTWRITEBYTECODE=1 pytest -v -k 'not (test_prerun_reqs_v1 or test_prerun_reqs_v2 or test_install_collection or test_require_collection_wrong_version or test_cli_auto_detect or test_eco or test_call_from_outside_venv)' %files %doc README.rst diff --git a/fix-discover_lintables.patch b/fix-discover_lintables.patch deleted file mode 100644 index 22ba550..0000000 --- a/fix-discover_lintables.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f881ebfdb0ada1b00b06f9e6ff6b95f35996eff6 Mon Sep 17 00:00:00 2001 -From: Sebastian Wagner -Date: Fri, 28 Jan 2022 19:23:44 +0100 -Subject: [PATCH] fix discover_lintables: strip ./ from WcMatch return value - -calling WcMatch('.', ...) causes the resulting file names to be prefixed -with `./`. -If the tests are run in a git-repository, this is not an issue, as git -is preferred of WcMatch in the code. - -Therefore remove the `./` prefix from the WcMatch return value to get -the identical expected output. - -fixes ansible-community/ansible-lint#1836 ---- - src/ansiblelint/file_utils.py | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/src/ansiblelint/file_utils.py b/src/ansiblelint/file_utils.py -index dad094b8d..f0c3d1857 100644 ---- a/src/ansiblelint/file_utils.py -+++ b/src/ansiblelint/file_utils.py -@@ -261,15 +261,22 @@ def discover_lintables(options: Namespace) -> Dict[str, Any]: - if out is None: - exclude_pattern = "|".join(str(x) for x in options.exclude_paths) - _logger.info("Looking up for files, excluding %s ...", exclude_pattern) -- out = set( -- WcMatch( -+ # remove './' prefix from output of WcMatch -+ out = { -+ strip_dotslash_prefix(fname) -+ for fname in WcMatch( - '.', exclude_pattern=exclude_pattern, flags=RECURSIVE, limit=256 - ).match() -- ) -+ } - - return OrderedDict.fromkeys(sorted(out)) - - -+def strip_dotslash_prefix(fname: str) -> str: -+ """Remove ./ leading from filenames.""" -+ return fname[2:] if fname.startswith('./') else fname -+ -+ - def guess_project_dir(config_file: Optional[str]) -> str: - """Return detected project dir or current working directory.""" - path = None