Chris McDonough
2011-09-02 f1c6e093706f54c301655d9894c163afbb48ae1e
commit | author | age
f1c6e0 1 1.2a4 (2011-09-02)
CM 2 ==================
1aeae3 3
CM 4 Features
5 --------
6
7 - Support an ``onerror`` keyword argument to
8   ``pyramid.config.Configurator.scan()``.  This onerror keyword argument is
9   passed to ``venusian.Scanner.scan()`` to influence error behavior when
10   an exception is raised during scanning.
11
49f082 12 - The ``request_method`` predicate argument to
CM 13   ``pyramid.config.Configurator.add_view`` and
14   ``pyramid.config.Configurator.add_route`` is now permitted to be a tuple of
15   HTTP method names.  Previously it was restricted to being a string
16   representing a single HTTP method name.
17
33516a 18 - Undeprecated ``pyramid.traversal.find_model``,
CM 19   ``pyramid.traversal.model_path``, ``pyramid.traversal.model_path_tuple``,
20   and ``pyramid.url.model_url``, which were all deprecated in Pyramid 1.0.
21   There's just not much cost to keeping them around forever as aliases to
22   their renamed ``resource_*`` prefixed functions.
23
24 - Undeprecated ``pyramid.view.bfg_view``, which was deprecated in Pyramid
25   1.0.  This is a low-cost alias to ``pyramid.view.view_config`` which we'll
26   just keep around forever.
27
1aeae3 28 Dependencies
CM 29 ------------
30
31 - Pyramid now requires Venusian 1.0a1 or better to support the ``onerror``
32   keyword argument to ``pyramid.config.Configurator.scan``.
33
21a4c9 34 1.2a3 (2011-08-29)
CM 35 ==================
b2c4e0 36
b5c0cb 37 Bug Fixes
CM 38 ---------
39
40 - Pyramid did not properly generate static URLs using
41   ``pyramid.url.static_url`` when passed a caller-package relative path due
0ff9d4 42   to a refactoring done in 1.2a1.
CM 43
44 - The ``settings`` object emitted a deprecation warning any time
45   ``__getattr__`` was called upon it.  However, there are legitimate
46   situations in which ``__getattr__`` is called on arbitrary objects
47   (e.g. ``hasattr``).  Now, the ``settings`` object only emits the warning
48   upon successful lookup.
b5c0cb 49
b2c4e0 50 Internal
CM 51 --------
52
53 - Use ``config.with_package`` in view_config decorator rather than
54   manufacturing a new renderer helper (cleanup).
55
5bee60 56 1.2a2 (2011-08-27)
CM 57 ==================
58
59 Bug Fixes
60 ---------
b93af9 61
CM 62 - When a ``renderers=`` argument is not specified to the Configurator
63   constructor, eagerly register and commit the default renderer set.  This
64   permits the overriding of the default renderers, which was broken in 1.2a1
65   without a commit directly after Configurator construction.
66
8b62d7 67 - Mako rendering exceptions had the wrong value for an error message.
CM 68
2a818a 69 - An include could not set a root factory successfully because the
CM 70   Configurator constructor unconditionally registered one that would be
71   treated as if it were "the word of the user".
72
5bee60 73 Features
CM 74 --------
75
637bda 76 - A session factory can now be passed in using the dotted name syntax.
CM 77
c1a179 78 1.2a1 (2011-08-24)
CM 79 ==================
9a66aa 80
CM 81 Features
82 --------
83
5ec330 84 - The ``[pshell]`` section in an ini configuration file now treats a
CM 85   ``setup`` key as a dotted name that points to a callable that is passed the
86   bootstrap environment.  It can mutate the environment as necessary for
87   great justice.
88
473697 89 - A new configuration setting named ``pyramid.includes`` is now available.
CM 90   It is described in the "Environment Variables and ``.ini`` Files Settings"
91   narrative documentation chapter.
92
83bf91 93 - Added a ``route_prefix`` argument to the
CM 94   ``pyramid.config.Configurator.include`` method.  This argument allows you
95   to compose URL dispatch applications together.  See the section entitled
96   "Using a Route Prefix to Compose Applications" in the "URL Dispatch"
97   narrative documentation chapter.
98
1e88db 99 - Added a ``pyramid.security.NO_PERMISSION_REQUIRED`` constant for use in
CM 100   ``permission=`` statements to view configuration.  This constant has a
101   value of the string ``__no_permission_required__``.  This string value was
102   previously referred to in documentation; now the documentation uses the
103   constant.
104
1f901a 105 - Added a decorator-based way to configure a response adapter:
CM 106   ``pyramid.response.response_adapter``.  This decorator has the same use as
107   ``pyramid.config.Configurator.add_response_adapter`` but it's declarative.
108
9a66aa 109 - The ``pyramid.events.BeforeRender`` event now has an attribute named
CM 110   ``rendering_val``.  This can be used to introspect the value returned by a
111   view in a BeforeRender subscriber.
112
6b2a62 113 - New configurator directive: ``pyramid.config.Configurator.add_tween``.
CM 114   This directive adds a "tween".  A "tween" is used to wrap the Pyramid
115   router's primary request handling function.  This is a feature may be used
116   by Pyramid framework extensions, to provide, for example, view timing
117   support and as a convenient place to hang bookkeeping code.
af2323 118
6b2a62 119   Tweens are further described in the narrative docs section in the Hooks
CM 120   chapter, named "Registering Tweens".
af2323 121
6b2a62 122 - New paster command ``paster ptweens``, which prints the current "tween"
CM 123   configuration for an application.  See the section entitled "Displaying
124   Tweens" in the Command-Line Pyramid chapter of the narrative documentation
125   for more info.
b72379 126
3a8054 127 - The Pyramid debug logger now uses the standard logging configuration
CM 128   (usually set up by Paste as part of startup).  This means that output from
129   e.g. ``debug_notfound``, ``debug_authorization``, etc. will go to the
130   normal logging channels.  The logger name of the debug logger will be the
131   package name of the *caller* of the Configurator's constructor.
132
95a379 133 - A new attribute is available on request objects: ``exc_info``.  Its value
CM 134   will be ``None`` until an exception is caught by the Pyramid router, after
135   which it will be the result of ``sys.exc_info()``.
6b2a62 136
274435 137 - ``pyramid.testing.DummyRequest`` now implements the
CM 138   ``add_finished_callback`` and ``add_response_callback`` methods.
139
1a42bd 140 - New methods of the ``pyramid.config.Configurator`` class:
CM 141   ``set_authentication_policy`` and ``set_authorization_policy``.  These are
142   meant to be consumed mostly by add-on authors.
143
ea824f 144 - New Configurator method: ``set_root_factory``.
CM 145
146 - Pyramid no longer eagerly commits some default configuration statements at
147   Configurator construction time, which permits values passed in as
148   constructor arguments (e.g. ``authentication_policy`` and
149   ``authorization_policy``) to override the same settings obtained via an
150   "include".
151
9f7f4f 152 - Better Mako rendering exceptions via
CM 153   ``pyramid.mako_templating.MakoRenderingException``
154
5c6963 155 - New request methods: ``current_route_url``, ``current_route_path``, and
CM 156   ``static_path``.
12cef0 157
5c6963 158 - New functions in ``pyramid.url``: ``current_route_path`` and
CM 159   ``static_path``.
12cef0 160
b8c797 161 - The ``pyramid.request.Request.static_url`` API (and its brethren
CM 162   ``pyramid.request.Request.static_path``, ``pyramid.url.static_url``, and
163   ``pyramid.url.static_path``) now accept an asbolute filename as a "path"
164   argument.  This will generate a URL to an asset as long as the filename is
165   in a directory which was previously registered as a static view.
166   Previously, trying to generate a URL to an asset using an absolute file
167   path would raise a ValueError.
168
449287 169 - The ``RemoteUserAuthenticationPolicy ``, ``AuthTktAuthenticationPolicy``,
CM 170   and ``SessionAuthenticationPolicy`` constructors now accept an additional
171   keyword argument named ``debug``.  By default, this keyword argument is
172   ``False``.  When it is ``True``, debug information will be sent to the
173   Pyramid debug logger (usually on stderr) when the ``authenticated_userid``
174   or ``effective_principals`` method is called on any of these policies.  The
175   output produced can be useful when trying to diagnose
176   authentication-related problems.
177
141f90 178 - New view predicate: ``match_param``.  Example: a view added via
CM 179   ``config.add_view(aview, match_param='action=edit')`` will be called only
180   when the ``request.matchdict`` has a value inside it named ``action`` with
181   a value of ``edit``.
182
6b2a62 183 Internal
CM 184 --------
185
186 - The Pyramid "exception view" machinery is now implemented as a "tween"
187   (``pyramid.tweens.excview_tween_factory``).
95a379 188
85093d 189 - WSGIHTTPException (HTTPFound, HTTPNotFound, etc) now has a new API named
CM 190   "prepare" which renders the body and content type when it is provided with
191   a WSGI environ.  Required for debug toolbar.
192
193 - Once ``__call__`` or ``prepare`` is called on a WSGIHTTPException, the body
194   will be set, and subsequent calls to ``__call__`` will always return the
195   same body.  Delete the body attribute to rerender the exception body.
196
5c52da 197 - Previously the ``pyramid.events.BeforeRender`` event *wrapped* a dictionary
CM 198   (it addressed it as its ``_system`` attribute).  Now it *is* a dictionary
199   (it inherits from ``dict``), and it's the value that is passed to templates
200   as a top-level dictionary.
201
fb90f0 202 - The ``route_url``, ``route_path``, ``resource_url``, ``static_url``, and
CM 203   ``current_route_url`` functions in the ``pyramid.url`` package now delegate
204   to a method on the request they've been passed, instead of the other way
205   around.  The pyramid.request.Request object now inherits from a mixin named
206   pyramid.url.URLMethodsMixin to make this possible, and all url/path
207   generation logic is embedded in this mixin.
208
5bf23f 209 - Refactor ``pyramid.config`` into a package.
CM 210
66da9b 211 - Removed the ``_set_security_policies`` method of the Configurator.
CM 212
53d9d4 213 - Moved the ``StaticURLInfo`` class from ``pyramid.static`` to
CM 214   ``pyramid.config.views``.
215
5f5a7e 216 - Move the ``Settings`` class from ``pyramid.settings`` to
CM 217   ``pyramid.config.settings``.
218
6da017 219 - Move the ``OverrideProvider``, ``PackageOverrides``, ``DirectoryOverride``,
CM 220   and ``FileOverride`` classes from ``pyramid.asset`` to
221   ``pyramid.config.assets``.
222
ef6f6b 223 Deprecations
CM 224 ------------
225
226 - All Pyramid-related deployment settings (e.g. ``debug_all``,
227   ``debug_notfound``) are now meant to be prefixed with the prefix
228   ``pyramid.``.  For example: ``debug_all`` -> ``pyramid.debug_all``.  The
229   old non-prefixed settings will continue to work indefinitely but supplying
53d9d4 230   them may eventually print a deprecation warning.  All scaffolds and
CM 231   tutorials have been changed to use prefixed settings.
ef6f6b 232
b5ffe3 233 - The ``settings`` dictionary now raises a deprecation warning when you
CM 234   attempt to access its values via ``__getattr__`` instead of
235   via ``__getitem__``.
236
3a8054 237 Backwards Incompatibilities
CM 238 ---------------------------
239
240 - If a string is passed as the ``debug_logger`` parameter to a Configurator,
241   that string is considered to be the name of a global Python logger rather
242   than a dotted name to an instance of a logger.
243
83bf91 244 - The ``pyramid.config.Configurator.include`` method now accepts only a
CM 245   single ``callable`` argument (a sequence of callables used to be
246   permitted).  If you are passing more than one ``callable`` to
247   ``pyramid.config.Configurator.include``, it will break.  You now must now
53d9d4 248   instead make a separate call to the method for each callable.  This change
CM 249   was introduced to support the ``route_prefix`` feature of include.
83bf91 250
04b7ea 251 - It may be necessary to more strictly order configuration route and view
CM 252   statements when using an "autocommitting" Configurator.  In the past, it
253   was possible to add a view which named a route name before adding a route
254   with that name when you used an autocommitting configurator.  For example::
255
256     config = Configurator(autocommit=True)
257     config.add_view('my.pkg.someview', route_name='foo')
258     config.add_route('foo', '/foo')
259
260   The above will raise an exception when the view attempts to add itself.
261   Now you must add the route before adding the view::
262
263     config = Configurator(autocommit=True)
264     config.add_route('foo', '/foo')
265     config.add_view('my.pkg.someview', route_name='foo')
266
267   This won't effect "normal" users, only people who have legacy BFG codebases
268   that used an autommitting configurator and possibly tests that use the
269   configurator API (the configurator returned by ``pyramid.testing.setUp`` is
270   an autocommitting configurator).  The right way to get around this is to
271   use a non-autocommitting configurator (the default), which does not have
272   these directive ordering requirements.
273
274 - The ``pyramid.config.Configurator.add_route`` directive no longer returns a
275   route object.  This change was required to make route vs. view
276   configuration processing work properly.
277
6b2a62 278 Documentation
CM 279 -------------
280
fb90f0 281 - Narrative and API documentation which used the ``route_url``,
CM 282   ``route_path``, ``resource_url``, ``static_url``, and ``current_route_url``
283   functions in the ``pyramid.url`` package have now been changed to use
284   eponymous methods of the request instead.
285
83bf91 286 - Added a section entitled "Using a Route Prefix to Compose Applications" to
CM 287   the "URL Dispatch" narrative documentation chapter.
288
6b2a62 289 - Added a new module to the API docs: ``pyramid.tweens``.
CM 290
291 - Added a "Registering Tweens" section to the "Hooks" narrative chapter.
292
293 - Added a "Displaying Tweens" section to the "Command-Line Pyramid" narrative
294   chapter.
295
473697 296 - Added documentation for the ``pyramid.tweens`` and ``pyramid.includes``
CM 297   configuration settings to the "Environment Variables and ``.ini`` Files
298   Settings" chapter.
299
1ae7af 300 - Added a Logging chapter to the narrative docs (based on the Pylons logging
CM 301   docs, thanks Phil).
302
53d9d4 303 - Added a Paste chapter to the narrative docs (moved content from the Project
CM 304   chapter).
305
5c52da 306 - Added the ``pyramid.interfaces.IDict`` interface representing the methods
CM 307   of a dictionary, for documentation purposes only (IMultiDict and
308   IBeforeRender inherit from it).
309
42d31c 310 - All tutorials now use - The ``route_url``, ``route_path``,
CM 311   ``resource_url``, ``static_url``, and ``current_route_url`` methods of the
312   request rather than the function variants imported from ``pyramid.url``.
313
b25335 314 - The ZODB wiki tutorial now uses the ``pyramid_zodbconn`` package rather
CM 315   than the ``repoze.zodbconn`` package to provide ZODB integration.
316
eef972 317 Dependency Changes
CM 318 ------------------
319
320 - Pyramid now relies on PasteScript >= 1.7.4.  This version contains a
321   feature important for allowing flexible logging configuration.
322
391402 323 Scaffolds
CM 324 ----------
325
326 - All scaffolds now use the ``pyramid_tm`` package rather than the
327   ``repoze.tm2`` middleware to manage transaction management.
328
b25335 329 - The ZODB scaffold now uses the ``pyramid_zodbconn`` package rather than the
CM 330   ``repoze.zodbconn`` package to provide ZODB integration.
331
391402 332 - All scaffolds now use the ``pyramid_debugtoolbar`` package rather than the
CM 333   ``WebError`` package to provide interactive debugging features.
334
335 - Projects created via a scaffold no longer depend on the ``WebError``
336   package at all; configuration in the ``production.ini`` file which used to
337   require its ``error_catcher`` middleware has been removed.  Configuring
338   error catching / email sending is now the domain of the ``pyramid_exclog``
339   package (see https://docs.pylonsproject.org/projects/pyramid_exclog/dev/).
340
1939d0 341 Bug Fixes
CM 342 ---------
343
344 - Fixed an issue with the default renderer not working at certain times.  See
345   https://github.com/Pylons/pyramid/issues/249
346