Skip to content

Remove unnecessary future annotations #52

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

Merged
merged 1 commit into from
Jan 24, 2025
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
2 changes: 0 additions & 2 deletions src/codegen/git/models/codemod_context.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import logging
from typing import Any

Expand Down
4 changes: 1 addition & 3 deletions src/codegen/git/schemas/repo_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import base64
import logging

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

@staticmethod
def from_encoded_json(encoded_json: str) -> RepoConfig:
def from_encoded_json(encoded_json: str) -> "RepoConfig":
decoded = base64.b64decode(encoded_json).decode("utf-8")
return RepoConfig.model_validate_json(decoded)
7 changes: 1 addition & 6 deletions src/codegen/sdk/enums.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from __future__ import annotations

from enum import IntEnum, StrEnum, auto
from typing import TYPE_CHECKING, NamedTuple
from typing import NamedTuple

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

if TYPE_CHECKING:
pass


class NodeType(IntEnum):
"""NodeType is an enumeration class that defines different types of nodes within the graph."""
Expand Down
8 changes: 0 additions & 8 deletions src/codegen/sdk/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from __future__ import annotations

import os
import re
import shutil
from collections import Counter
from collections.abc import Iterable
from contextlib import contextmanager
from pathlib import Path
from typing import TYPE_CHECKING, TypeVar
from xml.dom.minidom import parseString

import dicttoxml
Expand All @@ -18,8 +15,6 @@
from codegen.sdk.extensions.utils import find_all_descendants, find_first_descendant, get_all_identifiers
from codegen.sdk.typescript.enums import TSFunctionTypeNames

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


E = TypeVar("E", bound="Editable")


def calculate_base_path(full_path, relative_path):
"""Calculate the base path represented by './' in a relative path.

Expand Down
2 changes: 0 additions & 2 deletions src/codegen/utils/compilation/function_compilation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import linecache
import logging
import sys
Expand Down
2 changes: 0 additions & 2 deletions src/codegen/utils/compilation/function_construction.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import logging
import re

Expand Down
2 changes: 0 additions & 2 deletions src/codegen/utils/compilation/string_to_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import linecache
import logging
import sys
Expand Down
Loading