Pylons 2.0 / pyramid default configuration format

95 views
Skip to first unread message

Ghostwriter

unread,
Nov 5, 2010, 5:51:35 PM11/5/10
to pylons-devel
Hello!
I have a question to core developers of pyramid.
Did you planning to use (truly pythonic!) YAML-based configuration
files instead of Paste's INI-configs? Since the Pylons2/pyramid isn't
backward compatible with Pylons-1.x it would be nice to see YAML as a
framework's default configuration format.

*** And I feel very sorry for my English grammar.

Chris McDonough

unread,
Nov 6, 2010, 12:18:38 AM11/6/10
to pylons...@googlegroups.com

No plans, for YAML right now that I know of, no.

- C


Mike Orr

unread,
Nov 6, 2010, 1:55:40 AM11/6/10
to pylons...@googlegroups.com

I think YAML was brought up earlier as a configuration format, but it
hasn't been pursued.

YAML might be a superior format for PasteDeploy, in which case it
could replace the INI file, but Paste is a separate package from
Pyramid so the changes would have to be made there. And of course,
we'd have to define a YAML format and test it. Also, in the current
system, the same INI file can contain both Paste settings and Python
logging settings (and repoze.who settings, etc). Python logging can't
parse a YAML file directly.


--
Mike Orr <slugg...@gmail.com>

Ghostwriter

unread,
Nov 6, 2010, 7:11:42 AM11/6/10
to pylons-devel
> No plans, for YAML right now that I know of, no.

Thanks for reply!

> but Paste is a separate package from Pyramid so the changes would have to be made there.
Is it possible to implement this functionality leaving behind Paste*
packages? Maybe as an extension to pyramid?

> Python logging can't parse a YAML file directly.

There is a dictConfig (http://docs.python.org/library/
logging.html#logging.dictConfig) configuration function in Python 2.7.
Though it's not a file-parser but it can be used for direct mapping of
logging configuration. For ex.:

# Logging configuration
logging:
version: 1

# Root logger
root:
level: INFO
handlers: [console]

loggers:
routes:
#level = DEBUG logs the route matched and routing variables.
level: INFO
qualname: routes.middleware

frontserver:
level: INFO
qualname: frontserver

sqlalchemy:
# INFO logs SQL queries.
# DEBUG logs SQL queries and results.
# WARN logs neither. (Recommended for production systems.)
level: INFO
qualname: sqlalchemy.engine

handlers:
console:
class: logging.StreamHandler
stream: ext://sys.stderr
level: NOTSET
formatter: generic

formatters:
generic:
format: "%(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %
(message)s"
datefmt: "%H:%M:%S"
> Mike Orr <sluggos...@gmail.com>

Chris McDonough

unread,
Nov 6, 2010, 4:35:46 PM11/6/10
to pylons...@googlegroups.com
I actually did come up with such a system for replacing Paste not long
ago:

https://bitbucket.org/chrism/marco/src/tip/examples/sample.yaml

It does work, but to be honest, I'm not sure I want to maintain such a
thing. ;-) Maybe someone else could make something of it though...

- C

Ghostwriter

unread,
Nov 7, 2010, 6:52:02 AM11/7/10
to pylons-devel
It looks interesting.
I already have a yaml-based configuartion hook for Pylons-1.x, that
can configure a single app and pass it to the CherryPyWSGIServer. But
it doesn't know about PasteScript and its pipelines and filters at
all...
Your implementation seems almost complete and i'll try to play around
it.
Is it possible that "marco" would become maintained by the Pylons
Project community as a replacement for PasteScript (or other Paste*
packages)?

Thanks!

Chris McDonough

unread,
Nov 7, 2010, 8:30:15 AM11/7/10
to pylons...@googlegroups.com
On Sun, 2010-11-07 at 03:52 -0800, Ghostwriter wrote:
> It looks interesting.
> I already have a yaml-based configuartion hook for Pylons-1.x, that
> can configure a single app and pass it to the CherryPyWSGIServer. But
> it doesn't know about PasteScript and its pipelines and filters at
> all...
> Your implementation seems almost complete and i'll try to play around
> it.
> Is it possible that "marco" would become maintained by the Pylons
> Project community as a replacement for PasteScript (or other Paste*
> packages)?

Not by me, I don't really have the bandwidth. But someone else is free
to pick it up and run.

- C

> --
> You received this message because you are subscribed to the Google Groups "pylons-devel" group.
> To post to this group, send email to pylons...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-devel...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-devel?hl=en.
>


Mike Orr

unread,
Nov 7, 2010, 3:46:21 PM11/7/10
to pylons...@googlegroups.com
On Sun, Nov 7, 2010 at 5:30 AM, Chris McDonough <chr...@plope.com> wrote:
> On Sun, 2010-11-07 at 03:52 -0800, Ghostwriter wrote:
>> It looks interesting.
>> I already have a yaml-based configuartion hook for Pylons-1.x, that
>> can configure a single app and pass it to the CherryPyWSGIServer.  But
>> it doesn't know about PasteScript and its pipelines and filters at
>> all...
>> Your implementation seems almost complete and i'll try to play around
>> it.
>> Is it possible that "marco" would become maintained by the Pylons
>> Project community as a replacement for PasteScript (or other Paste*
>> packages)?
>
> Not by me, I don't really have the bandwidth.  But someone else is free
> to pick it up and run.

I'd like to see some ideas for modern alternatives to Paste. But it's
not high priority for me. Paste does what it needs to do.

Also, "Marco" to many of us means Pyramid. so if this
launcher-with-a-YAML format is to be called Marco, that'll need to be
distinguished. But I think the reason we left the name Marco (Polo)
was that an existing project was already using the name. (Ditto for
Pypes.)

--
Mike Orr <slugg...@gmail.com>

Chris McDonough

unread,
Nov 7, 2010, 3:50:37 PM11/7/10
to pylons...@googlegroups.com
On Sun, 2010-11-07 at 12:46 -0800, Mike Orr wrote:

> > Not by me, I don't really have the bandwidth. But someone else is free
> > to pick it up and run.
>
> I'd like to see some ideas for modern alternatives to Paste. But it's
> not high priority for me. Paste does what it needs to do.
>
> Also, "Marco" to many of us means Pyramid. so if this
> launcher-with-a-YAML format is to be called Marco, that'll need to be
> distinguished. But I think the reason we left the name Marco (Polo)
> was that an existing project was already using the name. (Ditto for
> Pypes.)

Yes, if someone takes Marco and publishes a Paste replacement using its
code, please rename the result.

- C


Reply all
Reply to author
Forward
0 new messages