1
+ from typing import List
2
+ from pydantic import BaseModel
3
+
4
+
5
+ class PyArg (BaseModel ):
6
+ arg_name : str
7
+ arg_type : str
8
+
9
+
1
10
class PyImport (BaseModel ):
2
11
from_statement : str
3
12
imports : List [str ]
@@ -13,19 +22,12 @@ class PyCallSite(BaseModel):
13
22
end_column : int
14
23
15
24
16
- class PyClass (BaseModel ):
17
- code_body : str
18
- full_signature : str
19
- super_classes : List [str ]
20
- is_test_class : bool
21
- class_name : str = None
22
- methods : List [PyMethod ]
23
-
24
-
25
25
class PyMethod (BaseModel ):
26
26
code_body : str
27
27
method_name : str
28
28
full_signature : str
29
+ num_params : int
30
+ modifier : str
29
31
is_constructor : bool
30
32
is_static : bool
31
33
formal_params : List [PyArg ]
@@ -36,39 +38,26 @@ class PyMethod(BaseModel):
36
38
end_line : int
37
39
38
40
41
+ class PyClass (BaseModel ):
42
+ code_body : str
43
+ full_signature : str
44
+ super_classes : List [str ]
45
+ is_test_class : bool
46
+ class_name : str = None
47
+ methods : List [PyMethod ]
48
+
49
+
39
50
class PyModule (BaseModel ):
40
51
qualified_name : str
41
52
functions : List [PyMethod ]
42
53
classes : List [PyClass ]
43
54
imports : List [PyImport ]
44
-
45
-
46
- class PyArg (BaseModel ):
47
- arg_name : str
48
- arg_type : str
55
+ # expressions: str
49
56
50
57
51
58
class PyBuildAttributes (BaseModel ):
52
59
"""Handles all the project build tool (requirements.txt/poetry/setup.py) attributes"""
53
60
54
- # Name of the build file (e.g., 'setup.py', 'requirements.txt', 'pyproject.toml')
55
- build_file_type : str
56
- code_body : str
57
- # Build tool used (e.g., 'setuptools', 'poetry', 'pip')
58
- build_tool : str
59
- package_name : str = None
60
- version : str = None
61
- dependencies : List [str ] = []
62
- dev_dependencies : List [str ] = []
63
- scripts : List [str ] = []
64
-
65
61
66
62
class PyConfig (BaseModel ):
67
63
"""Application configuration information"""
68
-
69
- config_file_names : Dict [str , str ] # Name of the configuration file
70
- code_body : str # The content of the configuration file
71
- config_type : str # Type of config file (e.g., 'json', 'yaml', 'ini', 'python')
72
- settings : Dict [str , Any ] = {} # Parsed settings from the config file
73
- start_line : int = None
74
- end_line : int = None
0 commit comments