We currently use the inspect module to extract Django code and structure.
This has several drawbacks:
- The version of Django that we're parsing needs to be installed in the project (at least locally).
- The inspect module executes code (on import) when parsing modules. This means:
We recently refactored the populate_cbv script to abstract the importer into a protocol that will (hopefully) make it easier for new importers to be written. LibCSV may be an appropriate alternative to inspect.
|
class CodeImporter(Protocol): |
|
def generate_code_data(self) -> Iterator[CodeElement]: |
|
... |
We currently use the
inspectmodule to extract Django code and structure.This has several drawbacks:
View.view_is_asyncshould not be abool#184 )We recently refactored the
populate_cbvscript to abstract the importer into a protocol that will (hopefully) make it easier for new importers to be written. LibCSV may be an appropriate alternative toinspect.ccbv/cbv/importer/importers.py
Lines 29 to 31 in a89118b