Directory Structure for Importing Python Package using __init__.py
Question: I've got a python project (projectA), which I've included as a git submodule
in a separate project (projectB) as a subfolder. The structure is laid out as

    
    
    projectB/
      projectB_file.py
      projectA/        (repository)
        projectA/      (source code)
          module1/
            file1.py   (contains Class1)
          file2.py     (contains Class2)
        tests/
          test_file1.py
    

I'm trying to figure out how to layout `__init__.py` files so in
`projectB_file.py` I can import `Class1` and `Class2` as

    
    
    from projectA.module1 import Class1
    from projectA import Class2
    


Answer: I think having the top level `projectA` part of the import will be a mistake.
That will require you to write your imports with `projectA` duplicated (e.g.
`import projectA.projectA.module1.file1`).

Instead, you should add the top `projectA` folder to the module search path in
some way (either as part of an install script for `projectB`, or with a
setting in your IDE). That way, `projectA` as a top-level name will refer to
the inner folder, which you actually intend to be the `projectA` package.

