1919This module defines the data models used to represent Python code structures
2020for static analysis purposes.
2121"""
22+
2223from __future__ import annotations
24+
25+ import gzip
2326import inspect
2427from pathlib import Path
2528from typing import Any , Dict , List , Optional
26- import gzip
2729
30+ import msgpack
2831from pydantic import BaseModel
2932from typing_extensions import Literal
30- import msgpack
3133
3234
3335def msgpk (cls ):
@@ -280,12 +282,12 @@ class PyCallable(BaseModel):
280282 inner_classes : Dict [str , "PyClass" ] = {}
281283 local_variables : List [PyVariableDeclaration ] = []
282284 cyclomatic_complexity : int = 0
285+ is_entrypoint : bool = False
286+ entrypoint_framework : Optional [str ] = None
283287
284288 def __hash__ (self ) -> int :
285289 """Generate a hash based on the callable's signature."""
286290 return hash (self .signature )
287-
288-
289291
290292
291293@builder
@@ -309,6 +311,8 @@ class PyClass(BaseModel):
309311 signature : str # e.g., module.class_name
310312 comments : List [PyComment ] = []
311313 code : str = None
314+ is_entrypoint : bool = False
315+ entrypoint_framework : Optional [str ] = None
312316 base_classes : List [str ] = []
313317 methods : Dict [str , PyCallable ] = {}
314318 attributes : Dict [str , PyClassAttribute ] = {}
0 commit comments