P.J. Eby wrote:
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="[email protected]",
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.
Ok. If it is not namespace package by itself all is clear. But in case
it is?
What is the difference? Why 'aaa.bbb' should even know that there is, or
will be any other, for example 'aaa.bbb.ccc'? For example, in case
'aaa.bbb.ccc' is developed by some one else.
namespace_packages should only list namespaces in which the current
project *participates*.
'Participates' or also 'provides'? In simple case the package 'aaa.bbb'
only participates
in 'aaa' and provides only 'aaa.bbb'.
That is, it should list packages that are *containers* for the
thing(s) this project is providing, that are *shared* by other projects.
In a simple case 'shared' is a little bit confusing in case we are
'extending'
namespace via strict hierarchy aaa.bbb, aaa.ccc, aaa.bbb.ddd etc. Where
any of packages are initial providers of their own namespaces. 'aaa' and
'aaa.bbb' share 'aaa' namespace, but one is initial provider of 'aaa' share
and other consumer of 'aaa' share.
Best regards,
rik
_______________________________________________
Distutils-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig