I'm building a python application and my codebase has the following structure:
/utils
/foo
/package_1
/foo
/package_2
/foo
/whatever
I would like to enforce the following rules:
- In utils package is possible to import only from utils package itself
- In package_1 is possible to import from utils and package_1 itself
- In package_2 is possible to import from utils and package_2 itself
- In whatever you can import from all the other packages
Which automatic strategy can I use to enforce this coding rule?
from How to block intra package imports
No comments:
Post a Comment