>
> I propose we make tg a namespace for 2.0:
+1 but...
> ).....)
>
> Here is the required change:
>
> begin patch:
> ````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
>
> Index: setup.py
> ===================================================================
> --- setup.py (revision 4567)
> +++ setup.py (working copy)
> @@ -23,6 +23,7 @@
> url=url,
> license=license,
> packages=find_packages(exclude=['ez_setup', 'examples',
> 'tests']),
> + namespace_packages = ['tg'],
> include_package_data=True,
> zip_safe=False,
> install_requires=[
> Index: tg/__init__.py
> ===================================================================
> --- tg/__init__.py (revision 4567)
> +++ tg/__init__.py (working copy)
> @@ -50,6 +50,9 @@
> they make it possible for a group of TurboGears components to share
> assumptions
> about how things will work.
> """
> +#make the tg namespace work
> +__import__('pkg_resources').declare_namespace(__name__)
> +
> from tg.controllers import TGController, redirect, url
> from tg.decorators import validate, expose
> from tg.flash import flash, get_flash, get_status
setuptools doesn't allow the __init__.py of the namespace-package to have
any code but the __import__ statement [1] :(
Quoting setuptools docs:
"You must NOT include any other code and data in a namespace package's
__init__.py. Even though it may appear to work during development, or when
projects are installed as .egg files, it will not work when the projects
are installed using "system" packaging tools -- in such cases the
__init__.py files will not be installed, let alone executed."
So this would require some magic to populate the "tg" namespace after it
has been imported. Based on my experience with TW (with the tw.framework
symbol) I *don't* recommend this since it has some subtle side effects
that have caused me some headaches (eg, TW can't be nosetested at the
moment because nose's import mechanism interaction with this).
Alternatively, these symbols could be moved to a tg.api module but this
would be a minor API breakage.
Overall, I'm in favor of the change even if it causes a little breakage
(better now than later).
Alberto
[1] http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---