[//]: # (dependabot-start) ⚠️ **Dependabot is rebasing this PR** ⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Updates the requirements on [markupsafe](https://github.com/pallets/markupsafe) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/pallets/markupsafe/releases">markupsafe's releases</a>.</em></p> <blockquote> <h2>3.0.2</h2> <p>This is the MarkupSafe 3.0.2 fix release, which fixes bugs but does not otherwise change behavior and should not result in breaking changes.</p> <p>PyPI: <a href="https://pypi.org/project/MarkupSafe/3.0.2/">https://pypi.org/project/MarkupSafe/3.0.2/</a> Changes: <a href="https://markupsafe.palletsprojects.com/en/stable/changes/#version-3-0-2">https://markupsafe.palletsprojects.com/en/stable/changes/#version-3-0-2</a> Milestone: <a href="https://github.com/pallets/markupsafe/milestone/14?closed=1">https://github.com/pallets/markupsafe/milestone/14?closed=1</a></p> <ul> <li>Fix compatibility when <code>__str__</code> returns a <code>str</code> subclass. <a href="https://redirect.github.com/pallets/markupsafe/issues/472">#472</a></li> <li>Build requires setuptools >= 70.1. <a href="https://redirect.github.com/pallets/markupsafe/issues/475">#475</a></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pallets/markupsafe/blob/main/CHANGES.rst">markupsafe's changelog</a>.</em></p> <blockquote> <h2>Version 3.0.2</h2> <p>Released 2024-10-18</p> <ul> <li>Fix compatibility when <code>__str__</code> returns a <code>str</code> subclass. :issue:<code>472</code></li> <li>Build requires setuptools >= 70.1. :issue:<code>475</code></li> </ul> <h2>Version 3.0.1</h2> <p>Released 2024-10-08</p> <ul> <li>Address compiler warnings that became errors in GCC 14. :issue:<code>466</code></li> <li>Fix compatibility with proxy objects. :issue:<code>467</code></li> </ul> <h2>Version 3.0.0</h2> <p>Released 2024-10-07</p> <ul> <li>Support Python 3.13 and its experimental free-threaded build. :pr:<code>461</code></li> <li>Drop support for Python 3.7 and 3.8.</li> <li>Use modern packaging metadata with <code>pyproject.toml</code> instead of <code>setup.cfg</code>. :pr:<code>348</code></li> <li>Change <code>distutils</code> imports to <code>setuptools</code>. :pr:<code>399</code></li> <li>Use deferred evaluation of annotations. :pr:<code>400</code></li> <li>Update signatures for <code>Markup</code> methods to match <code>str</code> signatures. Use positional-only arguments. :pr:<code>400</code></li> <li>Some <code>str</code> methods on <code>Markup</code> no longer escape their argument: <code>strip</code>, <code>lstrip</code>, <code>rstrip</code>, <code>removeprefix</code>, <code>removesuffix</code>, <code>partition</code>, and <code>rpartition</code>; <code>replace</code> only escapes its <code>new</code> argument. These methods are conceptually linked to search methods such as <code>in</code>, <code>find</code>, and <code>index</code>, which already do not escape their argument. :issue:<code>401</code></li> <li>The <code>__version__</code> attribute is deprecated. Use feature detection, or <code>importlib.metadata.version("markupsafe")</code>, instead. :pr:<code>402</code></li> <li>Speed up escaping plain strings by 40%. :pr:<code>434</code></li> <li>Simplify speedups implementation. :pr:<code>437</code></li> </ul> <h2>Version 2.1.5</h2> <p>Released 2024-02-02</p> <ul> <li>Fix <code>striptags</code> not collapsing spaces. :issue:<code>417</code></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pallets/markupsafe/commit/28ace20b140d15c083e1cbc163ee6b7778ba098c"><code>28ace20</code></a> release version 3.0.2</li> <li><a href="https://github.com/pallets/markupsafe/commit/6b51fd8f7386983b7038ad973557367cbd48579a"><code>6b51fd8</code></a> build requires at least setuptools 70.1 (<a href="https://redirect.github.com/pallets/markupsafe/issues/478">#478</a>)</li> <li><a href="https://github.com/pallets/markupsafe/commit/99dda9fd708432bd07d02327b2668661aa3cdaa0"><code>99dda9f</code></a> build requires at least setuptools 70.1</li> <li><a href="https://github.com/pallets/markupsafe/commit/3d8fd8cc006124a49ce2f4268b4d1739e301583e"><code>3d8fd8c</code></a> fix version</li> <li><a href="https://github.com/pallets/markupsafe/commit/1933c4be9c2c88613f7660840cde27a1bb7567e0"><code>1933c4b</code></a> fix version</li> <li><a href="https://github.com/pallets/markupsafe/commit/e85aff4d878aa458d5c1e879bf475d8483647f71"><code>e85aff4</code></a> relax speedups str check (<a href="https://redirect.github.com/pallets/markupsafe/issues/477">#477</a>)</li> <li><a href="https://github.com/pallets/markupsafe/commit/8cb1691ca038ca39942e088b956f5b94d8f636bf"><code>8cb1691</code></a> relax speedups str check</li> <li><a href="https://github.com/pallets/markupsafe/commit/4dafb7c36f1f654f1edd85228d346252b0065d45"><code>4dafb7c</code></a> start version 3.1.0</li> <li><a href="https://github.com/pallets/markupsafe/commit/9c44ecf45141f691d373a66ce664c43b5a6cc761"><code>9c44ecf</code></a> update docs build</li> <li><a href="https://github.com/pallets/markupsafe/commit/275c76905617c3f0e34de14e8794fcf4dfb0f937"><code>275c769</code></a> Merge branch '2.1.x' into 3.0.x</li> <li>Additional commits viewable in <a href="https://github.com/pallets/markupsafe/compare/0.9...3.0.2">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Responder: a familiar HTTP Service Framework for Python
Powered by Starlette. That async declaration is optional.
View documentation.
This gets you a ASGI app, with a production static files server pre-installed, jinja2 templating (without additional imports), and a production webserver based on uvloop, serving up requests with gzip compression automatically.
Testimonials
"Pleasantly very taken with python-responder. @kennethreitz at his absolute best." —Rudraksh M.K.
"ASGI is going to enable all sorts of new high-performance web services. It's awesome to see Responder starting to take advantage of that." — Tom Christie author of Django REST Framework
"I love that you are exploring new patterns. Go go go!" — Danny Greenfield, author of Two Scoops of Django
More Examples
See the documentation's feature tour for more details on features available in Responder.
Installing Responder
Install the most recent stable release:
pip install --upgrade responder
Or, install directly from the repository:
pip install 'responder @ git+https://github.com/kennethreitz/responder.git'
Only Python 3.6+ is supported.
The Basic Idea
The primary concept here is to bring the niceties that are brought forth from both Flask and Falcon and unify them into a single framework, along with some new ideas I have. I also wanted to take some of the API primitives that are instilled in the Requests library and put them into a web framework. So, you'll find a lot of parallels here with Requests.
- Setting
resp.contentsends back bytes. - Setting
resp.textsends back unicode, while settingresp.htmlsends back HTML. - Setting
resp.mediasends back JSON/YAML (.text/.html/.contentoverride this). - Case-insensitive
req.headersdict (from Requests directly). resp.status_code,req.method,req.url, and other familiar friends.
Ideas
- Flask-style route expression, with new capabilities -- all while using Python 3.6+'s new f-string syntax.
- I love Falcon's "every request and response is passed into to each view and mutated"
methodology, especially
response.media, and have used it here. In addition to supporting JSON, I have decided to support YAML as well, as Kubernetes is slowly taking over the world, and it uses YAML for all the things. Content-negotiation and all that. - A built in testing client that uses the actual Requests you know and love.
- The ability to mount other WSGI apps easily.
- Automatic gzipped-responses.
- In addition to Falcon's
on_get,on_post, etc methods, Responder features anon_requestmethod, which gets called on every type of request, much like Requests. - A production static file server is built-in.
- Uvicorn built-in as a production web server. I would have chosen Gunicorn, but it doesn't run on Windows. Plus, Uvicorn serves well to protect against slowloris attacks, making nginx unnecessary in production.
- GraphQL support, via Graphene. The goal here is to have any GraphQL query exposable at any route, magically.
- Provide an official way to run webpack.
