Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update pyproject.toml #243

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ parametrize-values-type = "tuple"
known-first-party = ["ansible_dev_environment"]
lines-after-imports = 2 # Ensures consistency for cases when there's variable vs function/class definitions after imports
lines-between-types = 1 # Separate import/from with 1 line
required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.per-file-ignores]
"_version.py" = ["SIM108"]
Expand Down
2 changes: 2 additions & 0 deletions src/ansible_dev_environment/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
via :command:`python -m ansible_dev_environment`.
"""

from __future__ import annotations

from ansible_dev_environment.cli import main


Expand Down
1 change: 1 addition & 0 deletions src/ansible_dev_environment/subcommands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""The subcommands module contains all the subcommands for ansible-dev-environment."""

# ruff: noqa: F401
from __future__ import annotations

from .checker import Checker as Check
from .inspector import Inspector as Inspect
Expand Down
11 changes: 9 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
Tracing '/**/src/<package>/__init__.py'
"""

from __future__ import annotations

import json
import os
import shutil
import tarfile
import tempfile
import warnings

from collections.abc import Generator
from pathlib import Path
from typing import TYPE_CHECKING
from urllib.request import HTTPError, urlopen

import pytest
Expand All @@ -33,7 +35,12 @@
import ansible_dev_environment # noqa: F401

from ansible_dev_environment.cli import Cli
from ansible_dev_environment.config import Config


if TYPE_CHECKING:
from collections.abc import Generator

from ansible_dev_environment.config import Config


GALAXY_CACHE = Path(__file__).parent.parent / ".cache" / ".galaxy_cache"
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Basic smoke tests."""

from __future__ import annotations

import json

from pathlib import Path
Expand Down
2 changes: 2 additions & 0 deletions tests/test_argparser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Tests for the arg_parser module."""

from __future__ import annotations

import pytest

from ansible_dev_environment.arg_parser import (
Expand Down
8 changes: 7 additions & 1 deletion tests/unit/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
"""Test cli functionality."""

from collections.abc import Generator
from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING

import pytest

from ansible_dev_environment.cli import Cli


if TYPE_CHECKING:
from collections.abc import Generator


def main(cli: Cli) -> None:
"""Stub main function for testing.

Expand Down
11 changes: 9 additions & 2 deletions tests/unit/test_inspector.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
"""Tests for the inspector module."""

from __future__ import annotations

import copy
import importlib
import json
import re
import sys

import pytest
from typing import TYPE_CHECKING

from ansible_dev_environment.config import Config
from ansible_dev_environment.subcommands import inspector


if TYPE_CHECKING:
import pytest

from ansible_dev_environment.config import Config


def test_output_no_color(session_venv: Config, capsys: pytest.CaptureFixture[str]) -> None:
"""Test the inspector output.

Expand Down
10 changes: 7 additions & 3 deletions tests/unit/test_installer.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
# pylint: disable=C0302
"""Tests for the installer."""
from __future__ import annotations

import os
import shutil
import subprocess

from argparse import Namespace
from pathlib import Path
from typing import Any
from typing import TYPE_CHECKING, Any

import pytest
import yaml

from ansible_dev_environment.arg_parser import parse
from ansible_dev_environment.cli import Cli
from ansible_dev_environment.collection import Collection
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output
from ansible_dev_environment.subcommands.installer import Installer
from ansible_dev_environment.utils import subprocess_run


if TYPE_CHECKING:
from ansible_dev_environment.collection import Collection
from ansible_dev_environment.output import Output


NAMESPACE = Namespace()
NAMESPACE.verbose = 0

Expand Down
14 changes: 11 additions & 3 deletions tests/unit/test_lister.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
"""Test the lister module."""

from __future__ import annotations

import copy
import tarfile

from pathlib import Path
from typing import TYPE_CHECKING

import pytest
import yaml

from ansible_dev_environment.arg_parser import parse
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output
from ansible_dev_environment.subcommands.installer import Installer
from ansible_dev_environment.subcommands.lister import Lister
from ansible_dev_environment.utils import JSONVal, collect_manifests


if TYPE_CHECKING:
from pathlib import Path

import pytest

from ansible_dev_environment.output import Output


def test_success(session_venv: Config, capsys: pytest.CaptureFixture[str]) -> None:
"""Test the lister.

Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Test the main file."""

from __future__ import annotations

import runpy

import pytest
Expand Down
13 changes: 10 additions & 3 deletions tests/unit/test_treemaker.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
"""Test the treemaker module."""

from __future__ import annotations

from argparse import Namespace
from pathlib import Path
from typing import TYPE_CHECKING
from venv import EnvBuilder

import pytest

from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output
from ansible_dev_environment.subcommands.treemaker import TreeMaker, TreeWithReqs, add_python_reqs
from ansible_dev_environment.utils import JSONVal


if TYPE_CHECKING:
from pathlib import Path

from ansible_dev_environment.output import Output
from ansible_dev_environment.utils import JSONVal


def test_tree_empty(
Expand Down
11 changes: 9 additions & 2 deletions tests/unit/test_uninstaller.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
"""Test the uninstaller module."""

from __future__ import annotations

import copy

from pathlib import Path
from typing import TYPE_CHECKING

import pytest

from ansible_dev_environment.arg_parser import parse
from ansible_dev_environment.config import Config
from ansible_dev_environment.output import Output
from ansible_dev_environment.subcommands.installer import Installer
from ansible_dev_environment.subcommands.uninstaller import UnInstaller


if TYPE_CHECKING:
from pathlib import Path

from ansible_dev_environment.output import Output


def test_many(session_venv: Config, capsys: pytest.CaptureFixture[str]) -> None:
"""Test the uninstaller with many collections.

Expand Down
Loading