On Tue, Jul 09, 2013 at 04:01:02PM -0400, Ted Ross wrote: > I would think that downstream repos would package one or the other > but not both. It would be nice if downstream, it was called > qpid.messagingregardless of the implementation used.
Agreed. I think it ought to be a goal to have the Swigged bindings be a drop-in replacement for the pure Python bindings. The users shouldn't care which implementation they use. > Is there a way > to parameterize it such that the namespace could be overridden when > built and packaged? Well, the name space is defined by the directory structure when the modules are installed. So wherever the .py files are installed defines what the package name will be. So I did a small experiment (see below) just to verify that we can use different package names without having to munge the code. > For example, call the wrapped client cqpid.messaging but make it > easy for a distro to build and package it as qpid.messaging. We can accomplish this by just having a qpid/messaging directory tree under the site packages location and in __init__.py there do: from cqpid import * This would put the entire cqpid.* set into the qpid/messaging namespace. Regarding the module name coming out of Swig, I don't think we can use a segmented name. Looking at the documentation [1] it appears that's solely used to name the shared library and how that name is interpreted is dynamic language dependant. Unless you were suggesting using cqpid.messaging similar to what I described above. WRT the name space, I'm still wanting to keep it as qpid.messaging since, in the long run, that would require developers to not change their imports and usage. If, down the road, a group decided to maintain the pure Python bindings separately they could use a different namespace, like we saw with the evolution of qpid::client to qpid::messaging in the C++ code itself? [1] http://www.swig.org/Doc2.0/Modules.html -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/
pgpxTqiP0Y2Ix.pgp
Description: PGP signature
