File tree Expand file tree Collapse file tree 9 files changed +30
-4
lines changed Expand file tree Collapse file tree 9 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,7 @@ parametrize-values-type = "tuple"
349
349
known-first-party = [" ansible_creator" ]
350
350
lines-after-imports = 2 # Ensures consistency for cases when there's variable vs function/class definitions after imports
351
351
lines-between-types = 1 # Separate import/from with 1 line
352
+ required-imports = [" from __future__ import annotations" ]
352
353
353
354
[tool .ruff .lint .per-file-ignores ]
354
355
"_version.py" = [" SIM108" ]
Original file line number Diff line number Diff line change 4
4
via :command:`python3 -m ansible_creator`.
5
5
"""
6
6
7
+ from __future__ import annotations
8
+
7
9
from .cli import main
8
10
9
11
Original file line number Diff line number Diff line change 5
5
here.
6
6
"""
7
7
8
+ from __future__ import annotations
9
+
8
10
import sys
9
11
10
12
Original file line number Diff line number Diff line change 1
1
"""Definition of constants for this package."""
2
2
3
+ from __future__ import annotations
4
+
5
+
3
6
GLOBAL_TEMPLATE_VARS = {
4
7
"DEV_CONTAINER_IMAGE" : "ghcr.io/ansible/community-ansible-dev-tools:latest" ,
5
8
"DEV_FILE_IMAGE" : "ghcr.io/ansible/ansible-workspace-env-reference:latest" ,
Original file line number Diff line number Diff line change 1
1
"""A home for shared types."""
2
2
3
- from collections .abc import Sequence
3
+ from __future__ import annotations
4
+
4
5
from dataclasses import dataclass , field
6
+ from typing import TYPE_CHECKING
5
7
6
8
from ansible_creator .constants import GLOBAL_TEMPLATE_VARS
7
9
8
10
11
+ if TYPE_CHECKING :
12
+ from collections .abc import Sequence
13
+
14
+
9
15
@dataclass
10
16
class TemplateData :
11
17
"""Dataclass representing the template data.
Original file line number Diff line number Diff line change 1
1
"""Constants with default values used throughout the tests."""
2
2
3
+ from __future__ import annotations
4
+
3
5
from pathlib import Path
4
6
5
7
Original file line number Diff line number Diff line change 1
1
"""Tests for compat module."""
2
2
3
+ from __future__ import annotations
4
+
3
5
from ansible_creator .compat import Traversable
4
6
5
7
Original file line number Diff line number Diff line change 1
1
"""Tests for templar."""
2
2
3
+ from __future__ import annotations
4
+
3
5
from ansible_creator .templar import Templar
4
6
from ansible_creator .types import TemplateData
5
7
Original file line number Diff line number Diff line change 1
1
"""Test the utils module."""
2
2
3
- from pathlib import Path
3
+ from __future__ import annotations
4
4
5
- import pytest
5
+ from pathlib import Path
6
+ from typing import TYPE_CHECKING
6
7
7
- from ansible_creator .output import Output
8
8
from ansible_creator .types import TemplateData
9
9
from ansible_creator .utils import Copier , expand_path
10
10
11
11
12
+ if TYPE_CHECKING :
13
+ import pytest
14
+
15
+ from ansible_creator .output import Output
16
+
17
+
12
18
def test_expand_path () -> None :
13
19
"""Test expand_path utils."""
14
20
home = Path .home ().resolve ()
You can’t perform that action at this time.
0 commit comments