[Distutils] namespace_packages: include itself ot not include

P.J. Eby pje at telecommunity.com
Fri Feb 4 16:20:28 CET 2011


At 02:12 PM 2/4/2011 +0300, Roman Kurakin wrote:
>Hi,
>
>    Let suppose that we have package aaa and subpackage bbb and we are going
>to write setup.py for bbb using setuptools:
>
>extra = dict(
>    namespace_packages=["aaa", "aaa.bbb"],
>    zip_safe = False,
>    install_requires = ['setuptools'],
>    )
>
>if __name__=="__main__":
>    setup(name="aaa.bbb",
>          version="0.0.1",
>          description="Dummy example subpackage",
>          author="Mr. Nemo",
>          url="http://www.the.way.org/to/hell",
>          author_email="MrNemo at the.way.org",
>          packages=['aaa.bbb'],
>          license='BSD',
>          **extra)
>
>    This is the way of namespace_packages usage I against of.  So, 
> the questions is
>am I right standing that package bbb, subpackage of aaa must list in 
>namespace_packages
>only namespaces it participate in eq 'aaa', and must not list any 
>namespaces it is provides,
>in this case 'aaa.bbb'? So correct value namespace_packages=['aaa'] 
>in the case above.

If 'aaa.bbb' is not itself a namespace package, then 
namespace_packages should only contain 'aaa'.  And unless you will 
have yet another project which is installing something under aaa.bbb, 
then aaa.bbb does not need to be a namespace package.

namespace_packages should only list namespaces in which the current 
project *participates*.  That is, it should list packages that are 
*containers* for the thing(s) this project is providing, that are 
*shared* by other projects.



More information about the Distutils-SIG mailing list