Skip to content

Commit

Permalink
ansible-lint: Update to 25.1.1 and update python default to 3.13
Browse files Browse the repository at this point in the history
  - Update to 25.1.1
  - Change default python to 3.13
  - Additionally correct the logic for a wanring message where an empty
    PYENV_VIRTUAL_ENV system variable trips incorrectly

update ansible-lint
  • Loading branch information
jhoyt4 committed Feb 2, 2025
1 parent f6b3786 commit 5ef2ce1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
19 changes: 10 additions & 9 deletions sysutils/ansible-lint/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PortSystem 1.0
PortGroup python 1.0
PortGroup github 1.0

github.setup ansible-community ansible-lint 24.2.3 v
github.setup ansible-community ansible-lint 25.1.1 v
github.tarball_from archive
revision 0

Expand All @@ -20,12 +20,12 @@ description Best practices checker for Ansible playbooks
long_description \
ansible-lint checks playbooks for practices and behaviour that could potentially be improved

checksums rmd160 2310f060e3d82bab5909cfb30a5349524850efdf \
sha256 b934f8de0431c78f73c206ba17b1f47771be4f95fa2fc41204256eece5bf4e6c \
size 460489
checksums rmd160 0f3046fa0f73aaa9ff25caa7a613e9352f300556 \
sha256 472b8bba3063320c0a68ea616f5f7c675530427e0173d19e12da3b44fda349fd \
size 491974

# Keep Python version compatible with yamllint
python.default_version 311
python.default_version 313
python.link_binaries_suffix

depends_build-append \
Expand All @@ -37,6 +37,7 @@ depends_build-append \
depends_run-append port:py${python.version}-ansible \
port:py${python.version}-ansible-compat \
port:py${python.version}-black \
port:py${python.version}-importlib-metadata\
port:yamllint

depends_lib-append port:py${python.version}-enrich \
Expand All @@ -49,10 +50,10 @@ depends_lib-append port:py${python.version}-enrich \
port:py${python.version}-wcmatch \
port:py${python.version}-yaml

# Stop setuptools from using the scm version which doesn't exist in this context
patchfiles patch-disable_use_scm_version.diff

python.pep517 yes
# patch-disable_use_scm_version.diff: Stop setuptools from using the scm version which doesn't exist in this context
# patch-disable_path_warning.diff: Correct wanring logic where an empty PYENV_VIRTUAL_ENV triggers a warning
patchfiles patch-disable_use_scm_version.diff \
patch-disable_path_warning.diff

github.livecheck.regex {([0-9.]+)}

Expand Down
11 changes: 11 additions & 0 deletions sysutils/ansible-lint/files/patch-disable_path_warning.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ./src/ansiblelint/__main__.py.orig 2025-01-30 06:43:48
+++ ./src/ansiblelint/__main__.py 2025-01-30 19:02:17
@@ -456,7 +456,7 @@
if (parent / "ansible").exists() and str(parent) not in paths:
inject_paths.append(str(parent))

- if not os.environ.get("PYENV_VIRTUAL_ENV", None):
+ if not os.environ.get("PYENV_VIRTUAL_ENV","NONE"):
if inject_paths and not all("pipx" in p for p in inject_paths):
print( # noqa: T201
f"WARNING: PATH altered to include {', '.join(inject_paths)} :: This is usually a sign of broken local setup, which can cause unexpected behaviors.",

0 comments on commit 5ef2ce1

Please sign in to comment.