Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonlhart authored Sep 6, 2024
2 parents f1d4964 + 17d9d50 commit 110c149
Show file tree
Hide file tree
Showing 38 changed files with 125 additions and 116 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.3
hooks:
- id: ruff
args:
- --exit-non-zero-on-fix

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.13.1
rev: v8.13.3
hooks:
- id: cspell
name: Spell check with cspell
Expand All @@ -80,7 +80,7 @@ repos:
pass_filenames: false

- repo: https://github.com/pycqa/pylint.git
rev: v3.2.6
rev: v3.2.7
hooks:
- id: pylint
args:
Expand All @@ -98,7 +98,7 @@ repos:
- wcmatch

- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.11.1
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies:
Expand Down
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![image](https://github.com/ansible-community/molecule/workflows/tox/badge.svg)](https://github.com/ansible-community/molecule/actions)
[![Python Black Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![Ansible Code of Conduct](https://img.shields.io/badge/Code%20of%20Conduct-silver.svg)](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
[![Discussions](https://img.shields.io/badge/Discussions-silver.svg)](https://github.com/ansible-community/molecule/discussions)
[![Discussions](https://img.shields.io/badge/Discussions-silver.svg)](https://forum.ansible.com/tag/molecule)
[![Repository License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)

Molecule project is designed to aid in the development and testing of
Expand All @@ -32,21 +32,14 @@ python3 -m molecule ... # python module calling method

# Documentation

Read the documentation and more at <https://molecule.readthedocs.io/>.
Read the documentation and more at <https://ansible.readthedocs.io/projects/molecule/>.

# Get Involved

- Join us in the `#ansible-devtools` irc channel on
[libera.chat](https://web.libera.chat/?channel=#ansible-devtools).
- Check github
[discussions](https://github.com/ansible-community/molecule/discussions).
- Join the community working group by checking the
[wiki](https://github.com/ansible/community/wiki/Molecule).
- Want to know about releases, subscribe to [ansible-announce
list](https://groups.google.com/group/ansible-announce).
- For the full list of Ansible email Lists, IRC channels see the
[communication
page](https://docs.ansible.com/ansible/latest/community/communication.html).
See the [Talk to us](https://ansible.readthedocs.io/projects/molecule/contributing/#talk-to-us) section of the documentation to ask questions, find help, and join the conversation.

For complete details, see the
[Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).

If you want to get moving fast and make a quick patch:

Expand Down
38 changes: 27 additions & 11 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# Contributing

- To see what's discussed see the [discussions
](https://github.com/ansible-community/molecule/discussions).
- Join the Molecule [community working
group](https://github.com/ansible/community/wiki/molecule) if you
would like to influence the direction of the project.
- Join us in `#ansible-devtools` on
[libera.chat](https://web.libera.chat/?channel=#ansible-molecule) matrix/irc,
or [molecule discussions](https://github.com/ansible-community/molecule/discussions).
- The full list of Ansible email lists and IRC channels can be found in
the [communication
page](https://docs.ansible.com/ansible/latest/community/communication.html).
Noticed a bug or have an idea to improve Ansible Molecule?
Want to write some documentation or share your expertise on the forum?
There are many ways to get involved and contribute, find out how.

## Guidelines

Expand All @@ -29,6 +21,30 @@
- Reformat the code by following the formatting section below.
- Submit a pull request.

## Talk to us

Connect with the Ansible community!

Join the Ansible forum to ask questions, get help, and interact with the
community.

- [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
Please add appropriate tags if you start new discussions, for example use the
`molecule`, `molecule6`, or `devtools` tags.
- [Social Spaces](https://forum.ansible.com/c/chat/4): meet and interact with
fellow enthusiasts.
- [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide
announcements including social events.

To get release announcements and important changes from the community, see the
[Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn).

You can find more information in the
[Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).

Possible security bugs should be reported via email to
<mailto:[email protected]>.

## Code Of Conduct

Please see our [Code of
Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ extra:
- icon: simple/matrix
link: https://matrix.to/#/#devtools:ansible.com
name: Matrix
- icon: fontawesome/solid/comments
link: https://github.com/ansible/molecule/discussions
name: Discussions
- icon: fontawesome/brands/discourse
link: https://forum.ansible.com/c/project/7
name: Ansible forum
- icon: fontawesome/brands/github-alt
link: https://github.com/ansible/molecule

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def pytest_collection_modifyitems(items, config): # type: ignore[no-untyped-def


@pytest.fixture(autouse=True)
def reset_pytest_vars(monkeypatch): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, PT004
def reset_pytest_vars(monkeypatch): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201
"""Make PYTEST_* env vars inaccessible to subprocesses."""
for var_name in tuple(os.environ):
if var_name.startswith("PYTEST_"):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture()
def _patched_ansible_check(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_check(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.provisioner.ansible.Ansible.check")


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/command/test_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@


@pytest.fixture()
def _command_provisioner_section_with_cleanup_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _command_provisioner_section_with_cleanup_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {"provisioner": {"name": "ansible", "playbooks": {"cleanup": "cleanup.yml"}}}


@pytest.fixture()
def _patched_ansible_cleanup(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_cleanup(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.provisioner.ansible.Ansible.cleanup")


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture()
def _patched_create_setup(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_create_setup(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.command.create.Create._setup")


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/command/test_destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@


@pytest.fixture()
def _patched_ansible_destroy(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_destroy(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.provisioner.ansible.Ansible.destroy")


@pytest.fixture()
def _patched_destroy_setup(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_destroy_setup(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.command.destroy.Destroy._setup")


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/command/test_idempotence.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@


@pytest.fixture()
def _patched_is_idempotent(mocker: MockerFixture) -> Mock: # noqa: PT005
def _patched_is_idempotent(mocker: MockerFixture) -> Mock:
return mocker.patch("molecule.command.idempotence.Idempotence._is_idempotent")


# NOTE(retr0h): The use of the `patched_config_validate` fixture, disables
# config.Config._validate from executing. Thus preventing odd side-effects
# throughout patched.assert_called unit tests.
@pytest.fixture()
def _instance(patched_config_validate, config_instance: config.Config): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005, ARG001
def _instance(patched_config_validate, config_instance: config.Config): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, ARG001
config_instance.state.change_state("converged", True) # noqa: FBT003

return idempotence.Idempotence(config_instance)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture()
def _instance(config_instance: config.Config): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _instance(config_instance: config.Config): # type: ignore[no-untyped-def] # noqa: ANN202
config_instance.state.change_state("created", True) # noqa: FBT003

return login.Login(config_instance)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


@pytest.fixture()
def _patched_ansible_prepare(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_prepare(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.provisioner.ansible.Ansible.prepare")


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/command/test_side_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


@pytest.fixture()
def _command_provisioner_section_with_side_effect_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _command_provisioner_section_with_side_effect_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {
"provisioner": {
"name": "ansible",
Expand All @@ -44,7 +44,7 @@ def _command_provisioner_section_with_side_effect_data(): # type: ignore[no-unt


@pytest.fixture()
def _patched_ansible_side_effect(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_side_effect(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.provisioner.ansible.Ansible.side_effect")


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@


@pytest.fixture()
def _patched_ansible_syntax(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_syntax(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
return mocker.patch("molecule.provisioner.ansible.Ansible.syntax")


Expand Down
6 changes: 3 additions & 3 deletions tests/unit/dependency/ansible_galaxy/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


@pytest.fixture()
def _patched_ansible_galaxy_has_requirements_file(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_galaxy_has_requirements_file(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
m = mocker.patch(
"molecule.dependency.ansible_galaxy.collections.Collections._has_requirements_file",
)
Expand All @@ -38,7 +38,7 @@ def _patched_ansible_galaxy_has_requirements_file(mocker): # type: ignore[no-un


@pytest.fixture()
def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {
"dependency": {
"name": "galaxy",
Expand All @@ -52,7 +52,7 @@ def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202,
# config.Config._validate from executing. Thus preventing odd side-effects
# throughout patched.assert_called unit tests.
@pytest.fixture()
def _instance( # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _instance( # type: ignore[no-untyped-def] # noqa: ANN202
_dependency_section_data, # noqa: ANN001
patched_config_validate, # noqa: ANN001, ARG001
config_instance: config.Config,
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/dependency/ansible_galaxy/test_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


@pytest.fixture()
def _patched_ansible_galaxy_has_requirements_file(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202, PT005
def _patched_ansible_galaxy_has_requirements_file(mocker): # type: ignore[no-untyped-def] # noqa: ANN001, ANN202
m = mocker.patch(
"molecule.dependency.ansible_galaxy.roles.Roles._has_requirements_file",
)
Expand All @@ -38,7 +38,7 @@ def _patched_ansible_galaxy_has_requirements_file(mocker): # type: ignore[no-un


@pytest.fixture()
def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {
"dependency": {
"name": "galaxy",
Expand All @@ -52,7 +52,7 @@ def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202,
# config.Config._validate from executing. Thus preventing odd side-effects
# throughout patched.assert_called unit tests.
@pytest.fixture()
def _instance( # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _instance( # type: ignore[no-untyped-def] # noqa: ANN202
_dependency_section_data, # noqa: ANN001
patched_config_validate, # noqa: ANN001, ARG001
config_instance: config.Config,
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/dependency/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


@pytest.fixture()
def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {
"dependency": {
"name": "shell",
Expand All @@ -41,7 +41,7 @@ def _dependency_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202,
# config.Config._validate from executing. Thus preventing odd side-effects
# throughout patched.assert_called unit tests.
@pytest.fixture()
def _instance( # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _instance( # type: ignore[no-untyped-def] # noqa: ANN202
_dependency_section_data, # noqa: ANN001
patched_config_validate, # noqa: ANN001, ARG001
config_instance: config.Config,
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/driver/test_delegated.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


@pytest.fixture()
def _driver_managed_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _driver_managed_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {
"driver": {
"name": "default",
Expand All @@ -47,7 +47,7 @@ def _driver_managed_section_data(): # type: ignore[no-untyped-def] # noqa: ANN


@pytest.fixture()
def _driver_unmanaged_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _driver_unmanaged_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {
"driver": {
"name": "default",
Expand All @@ -59,7 +59,7 @@ def _driver_unmanaged_section_data(): # type: ignore[no-untyped-def] # noqa: A


@pytest.fixture()
def _instance(config_instance: config.Config): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _instance(config_instance: config.Config): # type: ignore[no-untyped-def] # noqa: ANN202
return delegated.Delegated(config_instance)


Expand Down Expand Up @@ -342,7 +342,7 @@ def test_delegated_created(_instance): # type: ignore[no-untyped-def] # noqa:


@pytest.fixture()
def _driver_options_managed_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _driver_options_managed_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return {"driver": {"options": {"managed": False}}}


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/model/v2/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def config(molecule_file: Path, request: pytest.FixtureRequest) -> dict[str, Any


@pytest.fixture()
def _model_platforms_delegated_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202, PT005
def _model_platforms_delegated_section_data(): # type: ignore[no-untyped-def] # noqa: ANN202
return """
---
platforms:
Expand Down
Loading

0 comments on commit 110c149

Please sign in to comment.