Namespacing

73 views
Skip to first unread message

Joshua Ginsberg

unread,
Mar 23, 2012, 4:31:35 PM3/23/12
to django...@googlegroups.com
Howdy, folks -

Piston employs a particular feature of setuptools that declares a package namespace. Ordinarily, you can't install two packages that utilize the same python namespace. With this feature of setuptools and as it's configured for Piston, you could theoretically make your own installable python package that installed itself in the piston.my_cool_extension namespace and setuptools would be happy to read piston.* from the piston package and piston.my_cool_extension.* from your package.

The downside of this is that some developers may rely upon piston.__file__ being defined. *Technically* under this scheme, that may be undefined. If you've ever installed Piston with pip, you'll notice that it creates an .nspkg.pth file in your site-packages and ignores piston/__init__.py from the installation. As a result, any other modules that rely upon piston.__file__ being defined (oh, say, like Django's i18n framework) will break in a spectacular fashion.


So... who uses the package namespace feature of Piston? Anybody? Bueller?

-jag


Reply all
Reply to author
Forward
0 new messages