Skip to content

Commit bd712a0

Browse files
authored
Remove unnecessary future annotations (#52)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [x] I have added tests for my changes - [x] I have updated the documentation or added new documentation as needed - [x] I have read and agree to the [Contributor License Agreement](../CLA.md)
1 parent c38536e commit bd712a0

File tree

7 files changed

+2
-25
lines changed

7 files changed

+2
-25
lines changed

src/codegen/git/models/codemod_context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import logging
42
from typing import Any
53

src/codegen/git/schemas/repo_config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import base64
42
import logging
53

@@ -37,6 +35,6 @@ def encoded_json(self):
3735
return base64.b64encode(self.model_dump_json().encode("utf-8")).decode("utf-8")
3836

3937
@staticmethod
40-
def from_encoded_json(encoded_json: str) -> RepoConfig:
38+
def from_encoded_json(encoded_json: str) -> "RepoConfig":
4139
decoded = base64.b64decode(encoded_json).decode("utf-8")
4240
return RepoConfig.model_validate_json(decoded)

src/codegen/sdk/enums.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
from __future__ import annotations
2-
31
from enum import IntEnum, StrEnum, auto
4-
from typing import TYPE_CHECKING, NamedTuple
2+
from typing import NamedTuple
53

64
from codegen.sdk.core.dataclasses.usage import Usage
75

8-
if TYPE_CHECKING:
9-
pass
10-
116

127
class NodeType(IntEnum):
138
"""NodeType is an enumeration class that defines different types of nodes within the graph."""

src/codegen/sdk/utils.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
from __future__ import annotations
2-
31
import os
42
import re
53
import shutil
64
from collections import Counter
75
from collections.abc import Iterable
86
from contextlib import contextmanager
97
from pathlib import Path
10-
from typing import TYPE_CHECKING, TypeVar
118
from xml.dom.minidom import parseString
129

1310
import dicttoxml
@@ -18,8 +15,6 @@
1815
from codegen.sdk.extensions.utils import find_all_descendants, find_first_descendant, get_all_identifiers
1916
from codegen.sdk.typescript.enums import TSFunctionTypeNames
2017

21-
if TYPE_CHECKING:
22-
from codegen.sdk.core.interfaces.editable import Editable
2318
"""
2419
Utility functions for traversing the tree sitter structure.
2520
Do not include language specific traversals, or string manipulations here.
@@ -197,9 +192,6 @@ def shadow_files(files: str | list[str]):
197192
os.remove(shadow_file_name)
198193

199194

200-
E = TypeVar("E", bound="Editable")
201-
202-
203195
def calculate_base_path(full_path, relative_path):
204196
"""Calculate the base path represented by './' in a relative path.
205197

src/codegen/utils/compilation/function_compilation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import linecache
42
import logging
53
import sys

src/codegen/utils/compilation/function_construction.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import logging
42
import re
53

src/codegen/utils/compilation/string_to_code.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import linecache
42
import logging
53
import sys

0 commit comments

Comments
 (0)