blarApp / code-base-agent

Code agents for LLMs
https://blar.io
MIT License
44 stars 12 forks source link

:bug: fix(imports): fixes nested directory imports #80

Closed josem7 closed 5 months ago

josem7 commented 5 months ago

fixes: #79

The bug was produced when there where nested imports.

For example: pvlib/init.py imports pvlib/iotools which is a directory instead of a file (defined with its own init.py).

This caused the import_alias to be a list of imports instead of a single import.

To fix this a recursive function was created that decomposes the lists into single objects and processes them individually. This way we can make sure that the amount of nested directories doesn't matter we always get to the root.