Release notes & upgrading
The changes that matter when updating an app. Version numbers are identifiers, even when Python packaging gives your leading zero a stern talking-to.
0.11: tuple responses preserve content types
Wred 0.11 fixes (body, content_type, status[, headers]) responses with a dict or list body. Wred still JSON-encodes the body, but now keeps the content type supplied in the tuple. In 0.10, JSON serialization replaced that value with application/json.
return {'error': 'Invalid input'}, 'application/problem+json', 400
# Wred 0.10: Content-Type: application/json
# Wred 0.11: Content-Type: application/problem+jsonThe change applies to both three- and four-item tuples. Status codes and additional headers are unchanged. Bare dicts and lists still use application/json, bytes still default to application/octet-stream, and callable ASGI responses still control their own messages.
When upgrading, check tuples with dict or list bodies: their content type must describe the JSON you return. If you relied on Wred replacing that field, explicitly use application/json. See the response reference for supported forms.
Upgrade with python -m pip install --upgrade "wred[server]==0.11", or use wred==0.11 with your own ASGI server.
0.10: query is a cached property
Request.query now uses cached_property, matching Request.headers. It parses on first access and returns the same cached dict on later accesses. Blank values, repeated-key handling, strict UTF-8 decoding, and body-reading behavior are unchanged.
This is a breaking API change from published Wred 0.9: remove the call parentheses in handlers. No await is needed. The old call form tries to call a dict and raises TypeError, which is the dictionary's entirely reasonable objection to being treated as a function.
# Wred 0.9
query = request.query()
# Wred 0.10
query = request.query
name = request.query.get('name', 'world')Version 0.10 also adds this HTML tutorial, API reference, and browser-local documentation search.
0.9: the server is optional
Wred 0.9 moves weft-server out of the required dependencies and into the server extra. The only required runtime dependency is orjson. The Python API remains imported from wred.
| Your setup | What to install |
|---|---|
You run the weft command. | python -m pip install "wred[server]==0.9" |
| You already install another ASGI server. | python -m pip install "wred==0.9", plus that server in your application dependencies. |
| You run the notebook from a checkout. | Install the editable server extra plus PyMongo and ServeStatic, as shown in the notebook chapter. |
Record the extra in your dependency file if your app relies on Weft. Upgrading an existing environment may leave an already installed Weft package in place; a clean environment is the useful check for missing dependencies. Stale packages make excellent camouflage.
Why v0.09 corresponds to package version 0.9
The v0.09 Git tag identifies the release whose source version was 0.09. Flit normalizes that to package version 0.9 under Python’s version rules. The v0.10 tag and source version 0.10 correspond to package version 0.10. Use the package versions in dependency requirements.
from importlib.metadata import version
print(version('wred')) # Installed distribution metadataSee the Python packaging version specification. These are version components, not decimal fractions.
Check an upgrade
- Install your intended version and extras in a fresh virtualenv.
- Run your app’s checks with its actual server and middleware stack.
- Exercise startup, routing, body parsing, expected errors, and protected operations.
- Verify proxy scheme and cookie behavior if the deployment configuration changed.
The Wred PyPI page provides distribution metadata. The repository history contains the source changes; this page does not invent summaries for older releases.
