← Back to team overview

holland-coredev team mailing list archive

Deprecating holland namespace_packages

 

I received a report today about a python user complaining that holland
shows up in sys.modules by default.   This is due to the use of
namespace_packages and affects several other 3rd party modules that
use the same feature in setuptools (paste, peak, etc.).   This isn't a
major issue and wasn't really causing problems in this case.
However, it really isn't necessary for how we deploy holland and I
would like to deprecate the feature in our official packages.

In the .deb package for python-paste for instance they go through and
clip the nspkg.pth files:

# pth file is not needed since all paste* packages are installed in
same directory
rm -f $(PKGDIR)/$(call
py_libdir,$*)/Paste-${DEB_UPSTREAM_VERSION}-py$*-nspkg.pth

The plugin system is certainly not dependent on the holland/backup/
path location.  3rd parties should not be using the holland/backup/
namespace (although they might use the holland.backup plugin group),
so I don't see any serious loss of functionality by deprecating this
feature.

Since we're still composing holland/ out of multiple separate packages
we probably want to take the paster approach leaving
'namespace_packages=...' in setup.py and just clip the nspkg.pth
files.  Additionally we will need to drop an __init__.py in the root
holland packages for each "namespace" (holland/__init__.py,
holland/{backup,lib,commands}/__init__.py) since these won't be
installed by default.

This isn't something we have to for 1.0, but I would at least like to
do it for the next major release.  If anyone has opinions one way or
the other speak up.

~Andy