Add check for `packages` and `package_dir` at `setup()`
I took a look over pyroma's code, and something I missed was a check on
package_dir. It is not an easy check, by the way.
setuptools has "editable" installations, and they area just symlinks. The problem is that if you call
setup() with a different package name, let's say you use
packages=['src'], you can't import your package through its name if you install as editable.
pip install -e use editable installations.
(env)/tmp/mypackage $ tree . ├── setup.py └── src └── __init__.py 1 directory, 2 files (env)/tmp/mypackage $ cat src/__init__.py A = "FOO" (env)/tmp/mypackage $ cat setup.py from setuptools import setup setup(name='mypackage', packages=['src']) (env)/tmp/mypackage$ pip install -e . Obtaining file:///private/tmp/mypackage Running setup.py egg_info for package from file:///private/tmp/mypackage Installing collected packages: mypackage Running setup.py develop for mypackage Creating /private/tmp/env/lib/python2.7/site-packages/mypackage.egg-link (link to .) Adding mypackage 0.0.0 to easy-install.pth file Installed /private/tmp/mypackage Successfully installed mypackage Cleaning up... (env)/tmp/mypackage $ cd /tmp (env)/tmp $ python Python 2.7.2 (default, Jun 20 2012, 16:23:33) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import mypackage Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mypackage >>> import src >>> src.A 'FOO'