title: python library directory structure to separate code
body: <p>I want to have the following directory structure:</p>
  <pre class="lang-py prettyprint-override"><code>project_name (unfortunate, I did not think to name the git repo something different)
  |  ... 
  |
  |--project_name
  |  |-- __init__.py
  |  |-- module1
  |  |   |-- __init__.py
  |  |   |-- pyfile1.py
  |  |        #contains class1 which pulls from class2 and class1
  |  |-- module2
  |  |   |-- __init__.py
  |  |   |-- pyfile2.py
  |  |        #contains class2
  |  |-- module3
  |      |-- __init__.py
  |      |-- pyfile3.py
  |           #contains class3
  |--tests
  |  |--test1   
     ...
  </code></pre>
  <p>The above, when I throw it to github and pip install it from github, I noticed that the sub modules are getting installed separately and not together under project_name.</p>
  <p>I want to access class 1 succinctly while class 1 pulls from class 2 and 3. Currently, I have them calling upon eachother fine I believe as they are passing tests through pytest contained in my tests directory. Namely...</p>
  <pre class="lang-py prettyprint-override"><code># in class1
  from project_name.module2.pyfile2 import class2
  from project_name.module3.pyfile3 import class3
  
  # in test1
  from project_name.module1.pyfile1 import class1
  </code></pre>
  <p>I would like to be able to call say class1 like <code>from project_name.module1 import class1</code> or would I have to use <code>from project_name.module1.pyfile1 import class1</code> under this structure? Which might be kind of ridiculous, I know, but I have tried a few organization iterations, namely deleting the submodule structure and simply having them all under project_name with one <code>__init__.py</code>. But I would to have some sort of separation of concerns now so I would like to know how to do this properly.</p>
  <p>I figure it is the multiple <code>__init__.py</code>s causing the separate modules to be installed along with my <code>setup.py</code> which is looking inside the <code>project_name</code> directory instead of just installing the <code>project_name</code> directory which then I can access the submodules like I do with the tests:</p>
  <pre class="lang-py prettyprint-override"><code>
  import setuptools
  import re
  import os.path
  import sys
  
  with open(&quot;README.md&quot;, &quot;r&quot;) as fh:
      long_description = fh.read()
  
  def read(filename):
      return open(os.path.join(os.path.dirname(__file__), filename)).read()
  
  version = re.search(r'^__version__\s*=\s*[\'&quot;]([^\'&quot;]*)[\'&quot;]', read('project_one/__init__.py'), re.MULTILINE).group(1)
  
  install_requires=['pandas&gt;=1.0.0']
  include_packages=['project_one']
  tests_require=['pytest&gt;4.0', 'pytest-pylint']
  setup_requires=['pytest-runner', 'pytest-pylint']
  
  setuptools.setup(
      name=&quot;project_one&quot;
      , version=version
      , license='LICENSE.txt'
      , author=author
      , author_email=email
      , description=description
      , long_description=long_description
      , long_description_content_type=&quot;text/markdown&quot;
      , url=url
      , packages=setuptools.find_packages('project_name', exclude=['tests'])
      , classifiers=[
          'Development Status :: 3 - Alpha',
          'Intended Audience :: Developers',
          'Topic :: Software Development :: Build Tools',
          'License :: OSI Approved :: MIT License',
          'Programming Language :: Python :: 3.6',
          'Programming Language :: Python :: 3.7',
          'Programming Language :: Python :: 3.8',
      ]
      , python_requires='&gt;3.0, !=3.1.*, !=3.2.*, !=3.3.*'
      , install_requires=install_requires
      , tests_require=tests_require
      , setup_requires=setup_requires
      #, extras_require={'pandas': ['pandas&gt;=0.14.0']}
  )
  
  </code></pre>
  <p>So how do I stop the installs of the subdirectories, have it install the project_name directory, and structure the directory and code properly to do so.</p>
  <p>Also, my subdirectory <code>__init__.py</code> are empty. The <code>project_name</code>'s <code>__init__.py</code> has the following but if the <code>project_name</code> directory is not installed it is useless:</p>
  <pre class="lang-py prettyprint-override"><code># -*- coding: utf-8 -*-
  # PEP 8 Style Guide for Python Code.
  # https://www.python.org/dev/peps/pep-0008/
  
  import logging
  
  # Major.Minor.Patch 
  __version__ = '0.7.0'
  __author__ = 'name'
  
  from .module1.pyfile1 import class1
  from .module2.pyfile2 import class2
  from .module1.pyfile3 import class3
  
  # Set default logging handler to avoid &quot;No handler found&quot; warnings.
  try:  # Python 2.7+
      from logging import NullHandler
  except ImportError:
      class NullHandler(logging.Handler):
          &quot;&quot;&quot;For future error handling purposes&quot;&quot;&quot;
          def emit(self, record):
              pass
  
  logging.getLogger(__name__).addHandler(NullHandler())
  </code></pre>