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