Thanks for the quick reply Mike,

> Did you upgrade anything recently? You're using WebHelpers 0.6.4 so is
> this a Pylons 0.9.7 application? My most likely guess is that the
> route singleton that url_for depends on is not being initialized. It
> was always set until Pylons 1.0 and a recent Routes version, but maybe
> it's defaulting to disabled now. Check the Routes line in
> middleware.py and try this:
>
> app = RoutesMiddleware(app, config['routes.map'], singleton=True)
>
> (Keep any other arguments if there are any.)

I tried adding the singleton argument, but I get:

File "/Users/user/app/app/config/middleware.py", line 44, in make_app
    app = RoutesMiddleware(app, config['routes.map'], singleton=True)
TypeError: __init__() got an unexpected keyword argument 'singleton'

I have been developing in a virtual environment with Python 2.5 and
Pylons 0.9.7 ('env-2.5-0.9.7').
But the GenerationError comes up whether I use the env-2.5-0.9.7 or
env-2.6-1.0 (i.e., Python 2.6
and Pylons 1.0).

I don't think I upgraded anything recently.  This bug was hard to
notice because I usually don't add enough
entities when developing to trigger pagination.  So I don't know when
it started occurring.  I do have several
production sites up and running on WebFaction servers and they are
doing fine with pagination over hundreds of entries...

I have been trying the approach of using a new version of WebHelpers.
So, I create a fresh 2.6/1.0 virtualenv:

python2.6 /Library/Python/2.6/site-packages/virtualenv-1.5.1-py2.6.egg/
virtualenv.py --no-site-packages env-2.6-1.0

And I setup my app:

source env-2.6-1.0/bin/activate
cd app
python setup.py develop

This installs Pylons-1.0 and Routes-1.12.3 in env-2.6-1.0/lib/
python2.6/site-packages, but for some reason
it also installs WebHelpers-0.6.4

Now I run:

paster setup-app development.ini
paster serve --reload development.ini

After that, I add 11 "Forms" to the database.  When I try to view them
all, pagination kicks in and the
GenerationError is raised.

Now, I don't understand what is causing WebHelpers-0.6.4 to be
installed, as opposed to a newer
version.  The relevant (I think) part of my app/setup.py file is:

install_requires=[
        "Pylons==1.0",
        "SQLAlchemy>=0.5,<=0.5.99",
        "Mako",
        "FormBuild>=2.0,<2.99",
        "docutils>=0.7,<=0.7.99",
        "mysql-python>=1.2"
]

but I don't see anything in there that would require
WebHelpers-0.6.4...

If I just delete WebHelpers-0.6.4-py2.6.egg from env-2.6-1.0/lib/
Python2.6/site-packages I get:

File "/Users/user/env-2.6-1.0/lib/python2.6/site-packages/
setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 565, in resolve
pkg_resources.DistributionNotFound: WebHelpers>=0.6.1,<0.6.99: Not
Found for: app (did you run python setup.py develop?)

If I then use easy_install to install WebHelpers-1.2 and then restart
the server:

easy_install "WebHelpers==1.2"
paster serve --reload development.ini

I get:

File "/Users/user/env-2.6-1.0/lib/python2.6/site-packages/
setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 569, in resolve
pkg_resources.VersionConflict: (WebHelpers 1.2 (/Users/joeldunham/
env-2.6-1.0/lib/python2.6/site-packages/WebHelpers-1.2-py2.6.egg),
Requirement.parse('WebHelpers>=0.6.1,<0.6.99'))

So, what is causing the requirement for WebHelpers>=0.6.1,<0.6.99?

So then I tried changing app/setup.py to the following:

 install_requires=[
        "Pylons==1.0",
        "WebHelpers==1.2",
        "SQLAlchemy>=0.5,<=0.5.99",
        "Mako",
        "FormBuild>=2.0,<2.99",
        "docutils>=0.7,<=0.7.99",
        "mysql-python>=1.2"
]

and then I re-created another fresh 2.6-1.0 virtual environment and
ran:

python setup.py develop

This installs Pylons-1.0 and WebHelpers-1.2 but gives me the following
error:

Installed /Users/user/env-2.6-1.0/lib/python2.6/site-packages/
Pylons-1.0-py2.6.egg
Reading http://www.pylonshq.com/download/1.0
error: Installed distribution WebHelpers 1.2 conflicts with
requirement WebHelpers>=0.6.1,<0.6.99

So, again I find that something is requiring WebHelpers>=0.6.1,<0.6.99
and I can't figure out what.

I also tried creating a fresh virtual environment with Python 2.5 and
Pylons 0.9.7 (this is the setup I had
been developing with, and which my production apps are running in on
WebFaction's servers):

python2.5 /Library/Python/2.5/site-packages/virtualenv-1.5.1-py2.5.egg/
virtualenv.py --no-site-packages env-2.5-0.9.7

and I converted the app/setup.py file accordingly:

install_requires=[
        "Pylons==0.9.7",
        "SQLAlchemy>=0.5,<=0.5.99",
        "Mako",
        "FormBuild>=2.0,<2.99",
        "docutils>=0.7,<=0.7.99",
        "mysql-python>=1.2"
]

But this results in the same GenerationException (even when I add the
singleton=True argument to
app = RoutesMiddleware(app, config['routes.map']) in app/app/config/
middleware.py.)

Thoughts?  Thanks,

Joel

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

Reply via email to