title: setup.py sdist flattings package file structure, removes intermediate folders
body: <p>File structure:</p>
  
  <pre><code>.
  |-- rdir
  |   |-- __init__.py
  |   |-- core
  |   |   |-- __init__.py
  |   |   |-- rdir_core.py
  |   |   |-- rdir_node.py
  |   |-- generateHTML
  |   |   |-- __init__.py
  |   |-- rdir.py
  |-- setup.py
  </code></pre>
  
  <p>Setup.py:</p>
  
  <pre><code>from setuptools import setup, find_packages
  
  setup(
    name="rdir",
    version="0.40",
    description="....",
    author="lhfcws",
    author_email="lhfcws@gmail.com",
    url="...",
    license="MIT",
    packages=["rdir"],
    scripts=["rdir/rdir.py"],
    install_requires=['colorama', 'pyquery'],
    )
  </code></pre>
  
  <p>Commands:</p>
  
  <pre><code>sudo python setup.py install         #local install
  sudo python setup.py sdist upload    #pypi upload
  </code></pre>
  
  <p>Try <code>from rdir import rdir</code> in other path like home directory, only meets with:</p>
  
  <pre><code>ImportError: No module named core.rdir_core
  </code></pre>
  
  <p>Of course it works well if I import rdir in the project directory.
  And I looked into <code>site-packages/rdir.egg-info/</code>, I found that all the .py files were moved into a flat structure:</p>
  
  <pre><code>EGG-INFO
  ├── PKG-INFO
  ├── SOURCES.txt
  ├── dependency_links.txt
  ├── not-zip-safe
  ├── requires.txt
  ├── scripts
  │   ├── __init__.py
  │   ├── generate_page.py
  │   ├── rdir.py
  │   ├── rdir_core.py
  │   └── rdir_node.py
  └── top_level.txt
  </code></pre>
  
  <p>I also tried if I just <code>import rdir_core</code> in rdir.py, it compiles correctly. So I guessed there's sth wrong with my setup.py, and I read some demos, some setup.py of famous python projects on github and some official manuals. I changed my setup.py according to those reference, but all failed. I have no idea so I have to ask for help.</p>
  
  <p>Is it something wrong with my setup.py? Or is there anything I've missed?</p>
  
  <p>Or please show me a good example of a setup.py of multi file structure projects. Thank you!</p>
  
  <p>BTW, if these above cannot offer you enough information, please look at <a href="https://github.com/Lhfcws/rdir" rel="nofollow">rdir on Github</a></p>