Skip to content

Commit

Permalink
Respect ANSIBLE_COLLECTIONS_PATH (#4192)
Browse files Browse the repository at this point in the history
Inform ansible compat that the ANSIBLE_COLLECTIONS_PATH does not need to
be set.

The change in compat behaviour changed here:
ansible/ansible-compat@32ce03c#diff-52de7db791930eca228ba958a8fe0d53d2695de26a1d6e1aa1906da28f607892R395

and was released in 24.6.0


Other changes as needed based on pre-commit version updates that came
with the deps update
  • Loading branch information
cidrblock authored Jun 5, 2024
1 parent 0db2098 commit ef304a8
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .config/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras --unsafe-package=resolvelib --unsafe-package=ruamel-yaml-clib --unsafe-package=wcmatch pyproject.toml
#
ansi2html==1.9.1
ansible-compat==24.5.1
ansible-compat==24.6.1
ansible-core==2.17.0
ansible-lint==24.5.0
attrs==23.2.0
Expand Down
2 changes: 1 addition & 1 deletion .config/requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-compat >= 4.1.8
ansible-compat >= 24.6.1
ansible-core >= 2.12.10
click >= 8.0, < 9
click-help-colors >= 0.9
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- prettier
- prettier-plugin-toml
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
- repo: https://github.com/psf/black
Expand Down Expand Up @@ -49,7 +49,7 @@ repos:
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.4"
rev: "v0.4.7"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -62,7 +62,7 @@ repos:
entry: mypy src/ test/
pass_filenames: false
additional_dependencies:
- ansible-compat>=4.1.8
- ansible-compat>=24.6.1
- click>=8.0.1,<8.1.4 # https://github.com/pallets/click/issues/2558
- enrich>=1.2.7
- importlib-metadata>=4.6.1
Expand All @@ -85,7 +85,7 @@ repos:
args:
- --output-format=colorized
additional_dependencies:
- ansible-compat>=4.1.8
- ansible-compat>=24.6.1
- click
- click-help-colors
- enrich>=1.2.7
Expand All @@ -96,7 +96,7 @@ repos:
- pytest-testinfra
- wcmatch
- repo: https://github.com/ansible/ansible-lint
rev: v24.5.0
rev: v24.6.0
hooks:
- id: ansible-lint
- repo: https://github.com/jazzband/pip-tools
Expand Down
1 change: 1 addition & 0 deletions src/molecule/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def run_command(
env=env,
cwd=cwd,
tee=True,
set_acp=False,
)
if result.returncode != 0 and check:
raise CalledProcessError(
Expand Down
12 changes: 6 additions & 6 deletions test/a_unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
from collections.abc import Generator
from pathlib import Path
from subprocess import CompletedProcess
from test.conftest import (
molecule_directory,
molecule_ephemeral_directory,
molecule_file,
molecule_scenario_directory,
)
from typing import Any
from unittest.mock import Mock
from uuid import uuid4
Expand All @@ -38,6 +32,12 @@
from pytest_mock import MockerFixture

from molecule import config, util
from test.conftest import ( # pylint:disable=C0411
molecule_directory,
molecule_ephemeral_directory,
molecule_file,
molecule_scenario_directory,
)


def write_molecule_file(filename: str, data: Any) -> None:
Expand Down
2 changes: 1 addition & 1 deletion test/a_unit/driver/test_delegated.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# DEALINGS IN THE SOFTWARE.

import os
from test.conftest import is_subset

import pytest
from pytest_mock import MockerFixture

from molecule import config
from molecule.driver import delegated
from test.conftest import is_subset # pylint:disable=C0411


@pytest.fixture()
Expand Down
2 changes: 1 addition & 1 deletion test/a_unit/provisioner/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
import collections
import os
import re
from test.a_unit.conftest import os_split

import pytest
from pytest_mock import MockerFixture

from molecule import config, util
from molecule.provisioner import ansible, ansible_playbooks
from test.a_unit.conftest import os_split # pylint:disable=C0411


@pytest.fixture()
Expand Down
2 changes: 1 addition & 1 deletion test/a_unit/provisioner/test_ansible_playbooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
# DEALINGS IN THE SOFTWARE.

import os
from test.a_unit.conftest import os_split

import pytest

from molecule import config, util
from molecule.provisioner import ansible_playbooks
from test.a_unit.conftest import os_split # pylint:disable=C0411


@pytest.fixture()
Expand Down
5 changes: 4 additions & 1 deletion test/a_unit/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import os
import warnings
from pathlib import Path
from test.conftest import get_molecule_file, molecule_directory
from typing import Any

import pytest
Expand All @@ -34,6 +33,10 @@
from molecule.console import console
from molecule.constants import MOLECULE_HEADER
from molecule.text import strip_ansi_escape
from test.conftest import ( # pylint:disable = C0411
get_molecule_file,
molecule_directory,
)


def test_print_debug():
Expand Down
2 changes: 1 addition & 1 deletion test/b_functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import shutil
import subprocess
from subprocess import PIPE
from test.conftest import change_dir_to, molecule_directory

import pexpect
import pytest
Expand All @@ -36,6 +35,7 @@
from molecule.app import app
from molecule.text import strip_ansi_color
from molecule.util import run_command
from test.conftest import change_dir_to, molecule_directory # pylint:disable=C0411

LOG = logger.get_logger(__name__)

Expand Down
14 changes: 7 additions & 7 deletions test/b_functional/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@

import os
import pathlib
from test.b_functional.conftest import (
idempotence,
init_scenario,
list_with_format_plain,
run_test,
verify,
)

import pytest
from pytest import FixtureRequest

from molecule.command import base
from molecule.util import run_command
from test.b_functional.conftest import ( # pylint:disable=C0411
idempotence,
init_scenario,
list_with_format_plain,
run_test,
verify,
)


@pytest.fixture()
Expand Down

0 comments on commit ef304a8

Please sign in to comment.