List Info

Thread: Shouldn't default find_controllers use pkg_resources?




Shouldn't default find_controllers use pkg_resources?
country flaguser name
Poland
2007-10-13 15:47:07

Well, I am just making my first experiments with pylons
deployment,
and while trying to 'run egg' I immediately got an error
like:

Sat Oct 13 22:25:56 2007] [error] [client 127.0.0.1]
OSError: [Errno 20] Not a directory:
'/home/marcink/DEV_hg/myapp/dist/mk-0.0.0dev-py2.5.egg/mkweb
/controllers'

raised by default find_controllers (routes/util.py). 

Shouldn't this procedure be rewritten to use pkg_resources?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Shouldn't default find_controllers use pkg_resources?
country flaguser name
United States
2007-10-14 23:32:18

On Oct 13, 2007, at 1:47 PM, Marcin Kasperski wrote:

>
> Well, I am just making my first experiments with pylons
deployment,
> and while trying to 'run egg' I immediately got an
error like:
>
> Sat Oct 13 22:25:56 2007] [error] [client 127.0.0.1]
OSError:  
> [Errno 20] Not a directory:
'/home/marcink/DEV_hg/myapp/dist/ 
> mk-0.0.0dev-py2.5.egg/mkweb/controllers'
>
> raised by default find_controllers (routes/util.py).
>
> Shouldn't this procedure be rewritten to use
pkg_resources?

There are a number of other things that have to be changed
to make  
Pylons apps run as zipped eggs. I recall some of the others
being:

o paste's StaticURLParser/FileApp has to use pkg_resources
(for  
public files)
o templating systems must use pkg_resources
o l10n gettext catalogs
o remove all uses of '__file__'
o any library your app uses
o probably others I'm missing

Ideally this would be supported.

I think the biggest concerns with doing so are the potential
lack of  
support with third party libraries. Especially templating
systems,  
which everyone relies on one of.

Also for cases where performance is a concern, you wouldn't
want  
something like paste's FileApp retrieving file data from a
zip for  
every request. It could avoid rereading from the zip when
responding  
with 304 not modified, but even with that, that's still a
lot of  
unzipping.

A lot of Java app servers do automatically extract .war when
they're  
deployed (though I don't know if that's on by default
nowadays).

--
Philip Jenvey



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Shouldn't default find_controllers use pkg_resources?
country flaguser name
Ireland
2007-10-15 05:15:35
>> Shouldn't this procedure be rewritten to use
pkg_resources?
>
> There are a number of other things that have to be
changed to make  
> Pylons apps run as zipped eggs.

Indeed, in the meantime I discovered it :-(

I improved find_controllers to face this issue, but then
took
a look at load_environment and surrendered.

> I think the biggest concerns with doing so are the
potential lack of
> support with third party libraries. Especially
templating systems,
> which everyone relies on one of.

In the good old times when I used perl with
Template::Toolkit, I got
used to the idea of template provider plugins (plugged in
object which
provides template code for given paths). Doesn't seem
impossible to
implement and could be useful (apart from pkg_resources,
this is also
some way to serve templates from database or from remote
site), but of
course this is some work...

> Also for cases where performance is a concern, you
wouldn't want
> something like paste's FileApp retrieving file data
from a zip for
> every request. It could avoid rereading from the zip
when responding
> with 304 not modified, but even with that, that's still
a lot of
> unzipping.

Depends. Depending on the filesystem, reading from zip need
not be
worse than reading from fs, especially if there are plenty
of small
files in one directory... And of course nobody is forced to
use
compressed zips.

Serving app out of egg would make it a bit less tedious to
install
and maintain it...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Shouldn't default find_controllers use pkg_resources?
country flaguser name
United States
2007-10-15 11:25:39


On Oct 15, 6:15 am, Marcin Kasperski
<Marcin.Kasper...softax.com.pl>
wrote:
> >> Shouldn't this procedure be rewritten to use
pkg_resources?
>
> > There are a number of other things that have to be
changed to make
> > Pylons apps run as zipped eggs.
>
> Indeed, in the meantime I discovered it :-(
>
> I improved find_controllers to face this issue, but
then took
> a look at load_environment and surrendered.
>
> > I think the biggest concerns with doing so are the
potential lack of
> > support with third party libraries. Especially
templating systems,
> > which everyone relies on one of.
>
> In the good old times when I used perl with
Template::Toolkit, I got
> used to the idea of template provider plugins (plugged
in object which
> provides template code for given paths). Doesn't seem
impossible to
> implement and could be useful (apart from
pkg_resources, this is also
> some way to serve templates from database or from
remote site), but of
> course this is some work...
>
> > Also for cases where performance is a concern, you
wouldn't want
> > something like paste's FileApp retrieving file
data from a zip for
> > every request. It could avoid rereading from the
zip when responding
> > with 304 not modified, but even with that, that's
still a lot of
> > unzipping.
>
> Depends. Depending on the filesystem, reading from zip
need not be
> worse than reading from fs, especially if there are
plenty of small
> files in one directory... And of course nobody is
forced to use
> compressed zips.
>
> Serving app out of egg would make it a bit less tedious
to install
> and maintain it...

I believe, zipped egg (as opposed to directory tree) gets
unpacked at
runtime. This belief is based on problems with running
pylons
application under user account than has no write permission
in its
home directory. I always install and update python packages
using -Z
option of easy_install to enforce them to be unzipped
system-wide.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "pylons-discuss" group.
To post to this group, send email to pylons-discussgooglegroups.com
To unsubscribe from this group, send email to
pylons-discuss-unsubscribegooglegroups.com
For more options, visit this group at h
ttp://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )