Skip to content
This repository
tag: 1.3a4
Fetching contributors…

Cannot retrieve contributors at this time

file 311 lines (228 sloc) 12.593 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
1.3a4 (2012-01-05)
==================

Features
--------

- New API: ``pyramid.request.Request.set_property``. Add lazy property
  descriptors to a request without changing the request factory. New
  properties may be reified, effectively caching the value for the lifetime
  of the instance. Common use-cases for this would be to get a database
  connection for the request or identify the current user.

- Use the ``waitress`` WSGI server instead of ``wsgiref`` in scaffolding.

Bug Fixes
---------

- The documentation of ``pyramid.events.subscriber`` indicated that using it
  as a decorator with no arguments like this::

    @subscriber()
    def somefunc(event):
        pass

  Would register ``somefunc`` to receive all events sent via the registry,
  but this was untrue. Instead, it would receive no events at all. This has
  now been fixed and the code matches the documentation. See also
  https://github.com/Pylons/pyramid/issues/386

- Literal portions of route patterns were not URL-quoted when ``route_url``
  or ``route_path`` was used to generate a URL or path.

- The result of ``route_path`` or ``route_url`` might have been ``unicode``
  or ``str`` depending on the input. It is now guaranteed to always be
  ``str``.

- URL matching when the pattern contained non-ASCII characters in literal
  parts was indeterminate. Now the pattern supplied to ``add_route`` is
  assumed to be either: a ``unicode`` value, or a ``str`` value that contains
  only ASCII characters. If you now want to match the path info from a URL
  that contains high order characters, you can pass the Unicode
  representation of the decoded path portion in the pattern.

- When using a ``traverse=`` route predicate, traversal would fail with a
  URLDecodeError if there were any high-order characters in the traversal
  pattern or in the matched dynamic segments.

- Using a dynamic segment named ``traverse`` in a route pattern like this::

    config.add_route('trav_route', 'traversal/{traverse:.*}')

  Would cause a ``UnicodeDecodeError`` when the route was matched and the
  matched portion of the URL contained any high-order characters. See
  https://github.com/Pylons/pyramid/issues/385 .

- When using a ``*traverse`` stararg in a route pattern, a URL that matched
  that possessed a ``@@`` in its name (signifying a view name) would be
  inappropriately quoted by the traversal machinery during traversal,
  resulting in the view not being found properly. See
  https://github.com/Pylons/pyramid/issues/382 and
  https://github.com/Pylons/pyramid/issues/375 .

Backwards Incompatibilities
---------------------------

- String values passed to ``route_url`` or ``route_path`` that are meant to
  replace "remainder" matches will now be URL-quoted except for embedded
  slashes. For example::

     config.add_route('remain', '/foo*remainder')
     request.route_path('remain', remainder='abc / def')
     # -> '/foo/abc%20/%20def'

  Previously string values passed as remainder replacements were tacked on
  untouched, without any URL-quoting. But this doesn't really work logically
  if the value passed is Unicode (raw unicode cannot be placed in a URL or in
  a path) and it is inconsistent with the rest of the URL generation
  machinery if the value is a string (it won't be quoted unless by the
  caller).

  Some folks will have been relying on the older behavior to tack on query
  string elements and anchor portions of the URL; sorry, you'll need to
  change your code to use the ``_query`` and/or ``_anchor`` arguments to
  ``route_path`` or ``route_url`` to do this now.

- If you pass a bytestring that contains non-ASCII characters to
  ``add_route`` as a pattern, it will now fail at startup time. Use Unicode
  instead.

1.3a3 (2011-12-21)
==================

Features
--------

- Added a ``prequest`` script (along the lines of ``paster request``). It is
  documented in the "Command-Line Pyramid" chapter in the section entitled
  "Invoking a Request".

- Add undocumented ``__discriminator__`` API to derived view callables.
  e.g. ``adapters.lookup(...).__discriminator__(context, request)``. It will
  be used by superdynamic systems that require the discriminator to be used
  for introspection after manual view lookup.

Bug Fixes
---------

- Normalized exit values and ``-h`` output for all ``p*`` scripts
  (``pviews``, ``proutes``, etc).

Documentation
-------------

- Added a section named "Making Your Script into a Console Script" in the
  "Command-Line Pyramid" chapter.

- Removed the "Running Pyramid on Google App Engine" tutorial from the main
  docs. It survives on in the Cookbook
  (http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/gae.html).
  Rationale: it provides the correct info for the Python 2.5 version of GAE
  only, and this version of Pyramid does not support Python 2.5.

1.3a2 (2011-12-14)
==================

Features
--------

- New API: ``pyramid.view.view_defaults``. If you use a class as a view, you
  can use the new ``view_defaults`` class decorator on the class to provide
  defaults to the view configuration information used by every
  ``@view_config`` decorator that decorates a method of that class. It also
  works against view configurations involving a class made imperatively.

- Added a backwards compatibility knob to ``pcreate`` to emulate ``paster
  create`` handling for the ``--list-templates`` option.

- Changed scaffolding machinery around a bit to make it easier for people who
  want to have extension scaffolds that can work across Pyramid 1.0.X, 1.1.X,
  1.2.X and 1.3.X. See the new "Creating Pyramid Scaffolds" chapter in the
  narrative documentation for more info.

Documentation
-------------

- Added documentation to "View Configuration" narrative documentation chapter
  about ``view_defaults`` class decorator.

- Added API docs for ``view_defaults`` class decorator.

- Added an API docs chapter for ``pyramid.scaffolds``.

- Added a narrative docs chapter named "Creating Pyramid Scaffolds".

Backwards Incompatibilities
---------------------------

- The ``template_renderer`` method of ``pyramid.scaffolds.PyramidScaffold``
  was renamed to ``render_template``. If you were overriding it, you're a
  bad person, because it wasn't an API before now. But we're nice so we're
  letting you know.

1.3a1 (2011-12-09)
==================

Features
--------

- Python 3.2 compatibility.

- New ``pyramid.compat`` module and API documentation which provides Python
  2/3 straddling support for Pyramid add-ons and development environments.

- A ``mako.directories`` setting is no longer required to use Mako templates
  Rationale: Mako template renderers can be specified using an absolute asset
  spec. An entire application can be written with such asset specs,
  requiring no ordered lookup path.

- ``bpython`` interpreter compatibility in ``pshell``. See the "Command-Line
  Pyramid" narrative docs chapter for more information.

- Added ``get_appsettings`` API function to the ``pyramid.paster`` module.
  This function returns the settings defined within an ``[app:...]`` section
  in a PasteDeploy ini file.

- Added ``setup_logging`` API function to the ``pyramid.paster`` module.
  This function sets up Python logging according to the logging configuration
  in a PasteDeploy ini file.

- Configuration conflict reporting is reported in a more understandable way
  ("Line 11 in file..." vs. a repr of a tuple of similar info).

- A configuration introspection system was added; see the narrative
  documentation chapter entitled "Pyramid Configuration Introspection" for
  more information. New APIs: ``pyramid.registry.Introspectable``,
  ``pyramid.config.Configurator.introspector``,
  ``pyramid.config.Configurator.introspectable``,
  ``pyramid.registry.Registry.introspector``.

- Allow extra keyword arguments to be passed to the
  ``pyramid.config.Configurator.action`` method.

- New APIs: ``pyramid.path.AssetResolver`` and
  ``pyramid.path.DottedNameResolver``. The former can be used to resolve
  asset specifications, the latter can be used to resolve dotted names to
  modules or packages.

Bug Fixes
---------

- Make test suite pass on 32-bit systems; closes #286. closes #306.
  See also https://github.com/Pylons/pyramid/issues/286

- The ``pryamid.view.view_config`` decorator did not accept a ``match_params``
  predicate argument. See https://github.com/Pylons/pyramid/pull/308

- The AuthTktCookieHelper could potentially generate Unicode headers
  inappropriately when the ``tokens`` argument to remember was used. See
  https://github.com/Pylons/pyramid/pull/314.

- The AuthTktAuthenticationPolicy did not use a timing-attack-aware string
  comparator. See https://github.com/Pylons/pyramid/pull/320 for more info.

- The DummySession in ``pyramid.testing`` now generates a new CSRF token if
  one doesn't yet exist.

- ``request.static_url`` now generates URL-quoted URLs when fed a ``path``
  argument which contains characters that are unsuitable for URLs. See
  https://github.com/Pylons/pyramid/issues/349 for more info.

- Prevent a scaffold rendering from being named ``site`` (conflicts with
  Python internal site.py).

- Support for using instances as targets of the ``pyramid.wsgi.wsgiapp`` and
  ``pryramid.wsgi.wsgiapp2`` functions.
  See https://github.com/Pylons/pyramid/pull/370 for more info.

Backwards Incompatibilities
---------------------------

- Pyramid no longer runs on Python 2.5 (which includes the most recent
  release of Jython and the Python 2.5 version of GAE as of this writing).

- The ``paster`` command is no longer the documented way to create projects,
  start the server, or run debugging commands. To create projects from
  scaffolds, ``paster create`` is replaced by the ``pcreate`` console script.
  To serve up a project, ``paster serve`` is replaced by the ``pserve``
  console script. New console scripts named ``pshell``, ``pviews``,
  ``proutes``, and ``ptweens`` do what their ``paster <commandname>``
  equivalents used to do. Rationale: the Paste and PasteScript packages do
  not run under Python 3.

- The default WSGI server run as the result of ``pserve`` from newly rendered
  scaffolding is now the ``wsgiref`` WSGI server instead of the
  ``paste.httpserver`` server. Rationale: Rationale: the Paste and
  PasteScript packages do not run under Python 3.

- The ``pshell`` command (see "paster pshell") no longer accepts a
  ``--disable-ipython`` command-line argument. Instead, it accepts a ``-p``
  or ``--python-shell`` argument, which can be any of the values ``python``,
  ``ipython`` or ``bpython``.

- Removed the ``pyramid.renderers.renderer_from_name`` function. It has been
  deprecated since Pyramid 1.0, and was never an API.

- To use ZCML with versions of Pyramid >= 1.3, you will need ``pyramid_zcml``
  version >= 0.8 and ``zope.configuration`` version >= 3.8.0. The
  ``pyramid_zcml`` package version 0.8 is backwards compatible all the way to
  Pyramid 1.0, so you won't be warned if you have older versions installed
  and upgrade Pyramid "in-place"; it may simply break instead.

Dependencies
------------

- Pyramid no longer depends on the ``zope.component`` package, except as a
  testing dependency.

- Pyramid now depends on a zope.interface>=3.8.0, WebOb>=1.2dev,
  repoze.lru>=0.4, zope.deprecation>=3.5.0, translationstring>=0.4 (for
  Python 3 compatibility purposes). It also, as a testing dependency,
  depends on WebTest>=1.3.1 for the same reason.

- Pyramid no longer depends on the Paste or PasteScript packages.

Documentation
-------------

- The SQLAlchemy Wiki tutorial has been updated. It now uses
  ``@view_config`` decorators and an explicit database population script.

- Minor updates to the ZODB Wiki tutorial.

- A narrative documentation chapter named "Extending Pyramid Configuration"
  was added; it describes how to add a new directive, and how use the
  ``pyramid.config.Configurator.action`` method within custom directives. It
  also describes how to add introspectable objects.

- A narrative documentation chapter named "Pyramid Configuration
  Introspection" was added. It describes how to query the introspection
  system.

Scaffolds
---------

- Rendered scaffolds have now been changed to be more relocatable (fewer
  mentions of the package name within files in the package).

- The ``routesalchemy`` scaffold has been renamed ``alchemy``, replacing the
  older (traversal-based) ``alchemy`` scaffold (which has been retired).

- The ``starter`` scaffold now uses URL dispatch by default.
Something went wrong with that request. Please try again.