Opened 8 months ago

Closed 8 months ago

#68117 closed defect (fixed)

ansible-lint doesn't work

Reported by: huyz (Huy Z) Owned by: judaew (Vadym-Valdis Yudaiev)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: zdw (Zack Williams), iay (Ian Young)
Port: ansible-lint

Description

When I invoke it, I get:

❯ ansible-lint
Traceback (most recent call last):
  File "/opt/local/bin/ansible-lint", line 5, in <module>
    from ansiblelint.__main__ import _run_cli_entrypoint
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/__main__.py", line 39, in <module>
    from ansiblelint import cli
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/cli.py", line 28, in <module>
    from ansiblelint.schemas.main import validate_file_schema
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/schemas/main.py", line 13, in <module>
    from ansiblelint.schemas.__main__ import JSON_SCHEMAS, _schema_cache
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/schemas/__main__.py", line 20, in <module>
    with store_file.open(encoding="utf-8") as json_file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 1044, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/schemas/__store__.json'

Change History (8)

comment:1 Changed 8 months ago by jmroot (Joshua Root)

Cc: zdw added
Owner: set to judaew
Status: newassigned

comment:2 Changed 8 months ago by judaew (Vadym-Valdis Yudaiev)

Resolution: fixed
Status: assignedclosed

In bb50ad1773c24d857968094da0f8596a174c2f0a/macports-ports (master):

ansible-lint: update to 6.19.0 and closed ticket

Closed: #68117

comment:3 Changed 8 months ago by huyz (Huy Z)

It's still happening to me with 6.19.0

comment:4 Changed 8 months ago by huyz (Huy Z)

Should we reopen this ticket?

❯ /opt/local/bin/ansible-lint --version
Traceback (most recent call last):
  File "/opt/local/bin/ansible-lint", line 5, in <module>
    from ansiblelint.__main__ import _run_cli_entrypoint
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/__main__.py", line 39, in <module>
    from ansiblelint import cli
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/cli.py", line 28, in <module>
    from ansiblelint.schemas.main import validate_file_schema
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/schemas/main.py", line 15, in <module>
    from ansiblelint.schemas.__main__ import JSON_SCHEMAS, _schema_cache
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/schemas/__main__.py", line 20, in <module>
    with store_file.open(encoding="utf-8") as json_file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pathlib.py", line 1044, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/schemas/__store__.json'
❯ ll /opt/local/bin/ansible-lint
lrwxr-xr-x 1 root admin 77 Sep  6 10:57 /opt/local/bin/ansible-lint -> /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/ansible-lint*
❯ ll -L /opt/local/bin/ansible-lint
-rwxr-xr-x 1 root wheel 308 Sep  6 10:57 /opt/local/bin/ansible-lint*
❯ port provides /opt/local/bin/ansible-lint
/opt/local/bin/ansible-lint is provided by: ansible-lint
❯ port installed ansible-lint
The following ports are currently installed:
  ansible-lint @6.18.0_0
  ansible-lint @6.19.0_0 (active)

comment:5 Changed 8 months ago by judaew (Vadym-Valdis Yudaiev)

Resolution: fixed
Status: closedreopened

comment:6 Changed 8 months ago by iay (Ian Young)

Cc: iay added

comment:7 Changed 8 months ago by iay (Ian Young)

I'm seeing a slightly different, but probably related, issue with 6.19.0. The difference may be that today is the first time I have installed this.

$ /opt/local/bin/ansible-lint --version
Traceback (most recent call last):
  File "/opt/local/bin/ansible-lint", line 5, in <module>
    from ansiblelint.__main__ import _run_cli_entrypoint
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/__main__.py", line 39, in <module>
    from ansiblelint import cli
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/cli.py", line 12, in <module>
    from ansiblelint.config import (
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/config.py", line 101, in <module>
    PROFILES = yaml_from_file(Path(__file__).parent / "data" / "profiles.yml")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/loaders.py", line 39, in yaml_from_file
    with open(str(filepath), encoding="utf-8") as content:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansiblelint/data/profiles.yml'

The data directory is entirely missing.

Last edited 8 months ago by iay (Ian Young) (previous) (diff)

comment:8 Changed 8 months ago by judaew (Vadym-Valdis Yudaiev)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.