title: Right way to organize python project structure and distributing
body: <p>I have a Python client-service project. Logical dependencies look like this:
  <img src="https://i.stack.imgur.com/377nJ.png" alt="logical dependencies"></p>
  
  <p>Say in words, I have some services (<code>srv1</code>, <code>srv2</code>, ..., <code>srvX</code>) with common code in <code>service.py</code>, some clients for these services (<code>srv1_cl.py</code>, <code>srv2_cl.py</code>, ..., <code>srvX_cl.py</code>) with common code in <code>client.py</code> and common code for both service and clients in <code>common.py</code>.</p>
  
  <p>Now I have problem with structuring my git repository for development and deploying my project to users.</p>
  
  <p>Firstly I tried to store my clients and service in separate folders. Moreover, for each service I created a folder, because each service can contain a lot of files.</p>
  
  <pre><code>/myrepo.git
      common.py
      /clients
          client.py
          srv1_cl.py
          srv2_cl.py
      /services
          service.py
          /srv1
              conf.py
              srv1.py
              start.bat
          /srv2
              conf.py
              srv2.py
  </code></pre>
  
  <p>When I store my files like that I ran into a problem - how can a Python script export files from upper directories? Because I need test my client scripts, make some changes and execute.</p>
  
  <p>I found some solutions based on adding <code>PATH</code> with upper folders (<code>sys.path.insert(0, parentdir)</code>, but I'm sure it's not a good way) and <a href="https://docs.python.org/2/whatsnew/2.5.html#pep-328-absolute-and-relative-imports" rel="nofollow noreferrer">relative imports</a>. But for relative imports I must wrap my scripts into one package.</p>
  
  <p>OK, let's say I will do this, but here's another problem. I want to deploy "clients" separately from "services" because I don't want share the services' code with my users. How can I handle this problem?</p>
  
  <p>What is the best structure for my project? How can I develop and debug my project when I wrap my code to a package? Because for testing I want to start clients from my subfolders.</p>