|
60 | 60 | from codegen.sdk.python.file import PyFile |
61 | 61 | from codegen.sdk.python.function import PyFunction |
62 | 62 | from codegen.sdk.python.import_resolution import PyImport |
| 63 | +from codegen.sdk.python.statements.import_statement import PyImportStatement |
63 | 64 | from codegen.sdk.python.symbol import PySymbol |
64 | 65 | from codegen.sdk.typescript.assignment import TSAssignment |
65 | 66 | from codegen.sdk.typescript.class_definition import TSClass |
|
95 | 96 | TParameter = TypeVar("TParameter", bound="Parameter") |
96 | 97 | TCodeBlock = TypeVar("TCodeBlock", bound="CodeBlock") |
97 | 98 | 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 | + |
98 | 107 |
|
99 | 108 |
|
100 | 109 | @apidoc |
@@ -1168,13 +1177,8 @@ def from_repo(cls, repo_name: str, *, tmp_dir: str | None = None, commit: str | |
1168 | 1177 | logger.error(f"Failed to initialize codebase: {e}") |
1169 | 1178 | raise |
1170 | 1179 |
|
1171 | | - |
1172 | 1180 | # The last 2 lines of code are added to the runner. See codegen-backend/cli/generate/utils.py |
1173 | 1181 | # Type Aliases |
1174 | | -TSGlobalVar = TypeVar("TSGlobalVar", bound="Assignment") |
1175 | | -TSDirectory = Directory[TSFile, TSSymbol, TSImportStatement, TSGlobalVar, TSClass, TSFunction, TSImport] |
1176 | | - |
1177 | | - |
1178 | 1182 | 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