l.s.u.importpedant : module documentation

Part of lp.scripts.utilities

No module docstring
Function text_lines_to_set Undocumented
Function database_import_allowed_into Return True if model code can be imported into the module path.
Function is_test_module Returns True if the module is for unit or functional tests.
Class attrsgetter Like operator.attrgetter, but works on multiple attribute names.
Class PedantDisagreesError Import Pedant says you can't make this import.
Class DatabaseImportPolicyViolation Database code is imported directly into other code.
Class FromStarPolicyViolation import * from a module that has no __all__.
Class NotInModuleAllPolicyViolation import of a name that does not appear in a module's __all__.
Class NotFoundPolicyViolation import of zope.exceptions.NotFoundError into lp models modules.
Function import_pedant Undocumented
Function report_naughty_imports Undocumented
Function install_import_pedant Undocumented
def text_lines_to_set(text):
Undocumented
def database_import_allowed_into(module_path):

Return True if model code can be imported into the module path.

It is allowed if:
  • The import was made with the __import__ hook.
  • The importer is a 'test' module.
  • The importer is in a nodule that does not face users.
  • The import is recognised to be dubious, but not a priority to fix.
def is_test_module(module_path):
Returns True if the module is for unit or functional tests.

Otherwise returns False.

def import_pedant(name, globals={}, locals={}, fromlist=, level=-1):
Undocumented
def report_naughty_imports():
Undocumented
def install_import_pedant():
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.