I've been investigating what is required to get setuptools' "develop"
command to work on the pyshapelib stuff in basemap.
The "develop" command essentially creates a link from site-packages to
the source directory (e.g. pyshapelib/lib) so that Python statements
like "import shapelib" will load the file directly from your source
tree. In other words, this takes the "python setup.py install" out of
the module/package development cycle.
Unfortunately, the implementation in setuptools seems unable to locate
the package root when there are multiple packages at multiple roots
specified using the "packages" and "package_dirs" arguments to a single
distutils.core.setup() call. I think there are two alternative
approaches if we want to get this to work, which I do.
My recommendation is to move pyshapelib/lib/shapelib to lib/shapelib and
pyshapelib/lib/dbflib to lib/dbflib and keep a single setup.py file.
The other option is to make two separate setup.py files, one for
"basemap" (which installs the matplotlib.toolkits.basemap python
packages) and one for "pyshapelib" (which installs the shapelib and
dbflib Python packages).
I've tested both of these options, and they both work. Let me know if
you want me to make the changes in svn.
Then there's the issue of the "try: import shapelib except:" in the
setup.py... I'm not in love with that style of testing, but I'm not sure
why it's in there. Do other packages install shapelib and you don't want
the possibility of overwriting them? Or is it just to save some build
time? If its the former, wouldn't it be better to rename basemap's
version so basemap doesn't get hit with an API change in an external
package? If it's the latter, I think that's a false economy. Finally, we
should at least qualify the except statement to only gobble and ImportError.