Can someone help me set up dogpile and dogpile.cache correctly? Here's a paste of what *seems* to work:
http://paste.pocoo.org/show/581532/
the questions I have are:
1. Is it OK if I have "__version__" and a few other things in dogpile/__init__.py of the root project ? this seems to work, as "dogpile" is always imported first, but the docs at http://packages.python.org/distribute/setuptools.html#namespace-packages might suggest otherwise:
"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."
2. since "dogpile" is always imported first it seems like I don't need anything in the dogpile/__init__.py of that of dogpile.cache ?
3. or is "dogpile" not always imported first in this scenario ? how would I see that ?
I'm tempted to just merge these two things together. But I think I'll just move "dogpile" into "dogpile.core" and just get in line with everyone else.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>
--
Mike Orr <slugg...@gmail.com>
also --no-site-packages is the default now and not using it is a little crazy...
Py2exe is not Setuptools aware yet, so it may not be compatible
with namespace packages. (So far I haven't had a problem with Pylons
and Py2exe -- including SQLAlchemy -- as long as all imports are
listed explicitly rather than using Routes "autoload", but it may be
when I switch an application to Pyramid.)
IIRC, the issue is that it is implementation dependent (read: totally
random) *which* dogplie/__init__.py will be used, that of egg "dogpile"
or that of egg "dogpile.cache".
Thus, unless all your dogpile/__init__.py's are exactly the same (which
is easiest when they're empty ;), you can't be sure which one will be
used.
So, yes, while namespace packages have the huge benefit of actually
working (most of the time), they are a huge hack. But until the PEP
people get the issue designed properly[1] that's what we're stuck with.
Wolfgang
[1] http://mail.python.org/pipermail/import-sig/2012-March/000421.html
It's the standard for Pyramid because chrism has been promoting it,
and I sometimes have to use it because my Pyramid imports won't work
otherwise. But it's sad that it's undermining the ability to use OS
packages for libraries that are stable enough that you're happy with
whichever version the OS package is. (Like Mako, BeautifulSoup, Nose,
etc. I have a list of Python DEB packages that's the baseline for all
my servers and workstations. It includes those libraries but not
Pyramid, Pylons or SQLAlchemy because those have been changing too
rapidly for the OS packages to keep up.
The biggest problem with not having access to OS packages is that you
have to locally compile C extensions, which sometimes fails. If you're
making a checklist for other developers or sysadmins, you have to list
all the header dependencies they'll have to install, and what to do if
one error or another happens. This can turn a half-page simple
checklist into a two-page complex article, and even then you still get
called in because "it won't install" and the person doesn't understand
why or what to do.
The other issue is you have to install the same packages into every
virtualenv. If you don't take the time to set up a download cache or
PyPI mirror, it's downloading the same packages repeatedly.
So I don't see the point in recommending --no-site-packages or
practically forcing people to use it.
--
Mike Orr <slugg...@gmail.com>
Also, in terms of recommending people use it, --no-site-packages is
the default in virtualenv now.