Skip to content

Commit fc6578e

Browse files
author
codegen-bot
committed
adding PyDirectroty and TSDirectoryt
1 parent 38d411b commit fc6578e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/codegen/sdk/core/codebase.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from codegen.sdk.python.file import PyFile
6161
from codegen.sdk.python.function import PyFunction
6262
from codegen.sdk.python.import_resolution import PyImport
63+
from codegen.sdk.python.statements.import_statement import PyImportStatement
6364
from codegen.sdk.python.symbol import PySymbol
6465
from codegen.sdk.typescript.assignment import TSAssignment
6566
from codegen.sdk.typescript.class_definition import TSClass
@@ -95,6 +96,14 @@
9596
TParameter = TypeVar("TParameter", bound="Parameter")
9697
TCodeBlock = TypeVar("TCodeBlock", bound="CodeBlock")
9798
TExport = TypeVar("TExport", bound="Export")
99+
TSGlobalVar = TypeVar("TSGlobalVar", bound="Assignment")
100+
PyGlobalVar = TypeVar("PyGlobalVar", bound="Assignment")
101+
TSDirectory = Directory[TSFile, TSSymbol, TSImportStatement, TSGlobalVar, TSClass, TSFunction, TSImport]
102+
PyDirectory = Directory[PyFile, PySymbol, PyImportStatement, PyGlobalVar, PyClass, PyFunction, PyImport]
103+
104+
105+
106+
98107

99108

100109
@apidoc
@@ -1168,13 +1177,8 @@ def from_repo(cls, repo_name: str, *, tmp_dir: str | None = None, commit: str |
11681177
logger.error(f"Failed to initialize codebase: {e}")
11691178
raise
11701179

1171-
11721180
# The last 2 lines of code are added to the runner. See codegen-backend/cli/generate/utils.py
11731181
# Type Aliases
1174-
TSGlobalVar = TypeVar("TSGlobalVar", bound="Assignment")
1175-
TSDirectory = Directory[TSFile, TSSymbol, TSImportStatement, TSGlobalVar, TSClass, TSFunction, TSImport]
1176-
1177-
11781182
CodebaseType = Codebase[SourceFile, Directory, Symbol, Class, Function, Import, Assignment, Interface, TypeAlias, Parameter, CodeBlock]
1179-
PyCodebaseType = Codebase[PyFile, Directory, PySymbol, PyClass, PyFunction, PyImport, PyAssignment, Interface, TypeAlias, PyParameter, PyCodeBlock]
1180-
TSCodebaseType = Codebase[TSFile, Directory, TSSymbol, TSClass, TSFunction, TSImport, TSAssignment, TSInterface, TSTypeAlias, TSParameter, TSCodeBlock]
1183+
PyCodebaseType = Codebase[PyFile, PyDirectory, PySymbol, PyClass, PyFunction, PyImport, PyAssignment, Interface, TypeAlias, PyParameter, PyCodeBlock]
1184+
TSCodebaseType = Codebase[TSFile, TSDirectory, TSSymbol, TSClass, TSFunction, TSImport, TSAssignment, TSInterface, TSTypeAlias, TSParameter, TSCodeBlock]

0 commit comments

Comments
 (0)