I'm looking into pkg_resources.require as a possible solution to the
old/new problem of Routes and WebHelpers, to avoid having to release
Routes1 and WebhelpersOriginal packages.  Pylons doesn't have a
top-level script unless people start making derivatives of 'paster',
but I thought maybe putting a requirement at the top of routing.py and
helpers.py would be enough.

When I've used 'require' in the past, it gave a warning if another
version of the package was already on sys.path.  But now it gives an
error:

>>> pkg_resources.require("Mako==0.1.8")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 626, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 528, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (Mako 0.1.10
(/home/mso/venv/rlink/lib/python2.5/site-packages/Mako-0.1.10-py2.5.egg),
Requirement.parse('Mako==0.1.8'))

This makes 'require' useless in various hard-to-explain environments,
like if you're in a virtualenv and it's picking up another version
from site-packages, or if the other version is a Pylons dependency (as
in the case of Routes).

Another thing.  I tried deleting the other Mako directory from
sys.path but i still go the error anyway.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-devel" 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/pylons-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to