title: importing a python module from another repo
body: <p>I have written a python module. It resides in a repo. Now to get the unit tests for the module to run, they can't be subfolder of that module. The suggested structure to fix this is:</p>
  
  <pre><code>ModuleRepo/
    MyModule/
      __init__.py
      some_utils.py
        import .some_helpers
      some_helpers.py
    Tests/
      some_utils_test.py
        import MyModule.some_utils
      some_helpers_test.py
        import MyModule.some_helpers
  </code></pre>
  
  <p>Now that works just fine. If I run the tests, they are able to import the module. The module is able to import its own files (eg: some_helpers) by pre-pending '.' to indicate the local folder.</p>
  
  <p>The issue is that a different repo now wants to share this module and I don't know how to make it find the module.</p>
  
  <p>eg:</p>
  
  <pre><code>ModuleRepo/
    MyModule/
      __init__.py
      ...
    Tests/
      ...
  AnotherRepo/
    using_my_module.py
      import ??? &lt;-- how to find MyModule?
  </code></pre>
  
  <p><strong>NOT WORKING ATTEMPT #1:</strong> 
  I tried initially to include the ModuleRepo under AnotherRepo using git's submodule functionality. However I dont actually want the <em>root</em> folder for ModuleRepo, I want the subfolder 'MyModule' only. It turns out git's submodule doesn't do that - one cant choose only a part of a repo to include.</p>
  
  <p><strong>UNDESIRABLE SYMLINK:</strong> While a symlink might work, its not something one can 'commit' to a repository and so is somewhat undesirable. Additionally I am developing both on Windows and Linux, so I need a solution which works on both.</p>
  
  <p>POSSIBLE SOLUTION: Turn ModuleRepo root into a module too (adding an <strong>init</strong>.py). Then I could use git to make it a submodule of AnotherRepo. My import would be ugly but it would be: import my.module.some_utils instead of import mymodule.some_utils</p>
  
  <p>Does anyone have any better solutions?</p>