@pgjones@fosstodon.org
@pgjones@fosstodon.org avatar

pgjones

@pgjones@fosstodon.org

Python Software Foundation fellow and open source developer. I'm the author of Quart and Hypercorn, and I help maintain the Pallets (Flask, Werkzeug) and Hyper (h11, h2, wsproto) projects.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

pgjones, to random
@pgjones@fosstodon.org avatar

Hypercorn now supports ASGI states and trailing headers. It has also had a number of bugs fixed. 0.17 released!
https://github.com/pgjones/hypercorn/blob/main/CHANGELOG.rst

pgjones,
@pgjones@fosstodon.org avatar

@hynek svcs should now work with Hypercorn

davidism, to python
@davidism@mas.to avatar

@tonybaloney showing off a Flask app running in Hypercorn by @pgjones with workers in subinterpreters that themselves each have the GIL disabled. Running parallel requests that themselves can have parallel processing. This talk has so much insight into web app and parallel performance. #PyConUS #Flask #Python

pgjones,
@pgjones@fosstodon.org avatar
pgjones, to random
@pgjones@fosstodon.org avatar

Quart-Rate-Limiter 0.10.0 released. This release adds the ability to skip limits based on the results of a custom skip_function e.g. to have limits that only apply to unauthenticated requests. See docs https://quart-rate-limiter.readthedocs.io/en/latest/how_to_guides/skip.html and the changelog https://github.com/pgjones/quart-rate-limiter/blob/main/CHANGELOG.rst and

pamelafox, to random
@pamelafox@fosstodon.org avatar

Trying to figure out what package to use for showing an async HTTP request in a Python example. Ideally we'd use something in stdlib, but urllib says to use requests, and requests doesn't support async, so... httpx?

pgjones,
@pgjones@fosstodon.org avatar

@pamelafox @davidism Yep, happy user. It also supports HTTP/2 which I think makes it unique.

pgjones,
@pgjones@fosstodon.org avatar

@pamelafox @davidism Yep - it is quite tricky to run multiple event loops.

pgjones, to random
@pgjones@fosstodon.org avatar

A couple of bugfixes, Werkzeug 3.0.2 and Quart 0.19.5 are now available.
https://github.com/pallets/werkzeug/blob/main/CHANGES.rst
https://github.com/pallets/quart/blob/main/CHANGES.rst

pgjones, to random
@pgjones@fosstodon.org avatar

Quart-DB, 0.8.0, now supports background migrations - migrations that run whilst the app is serving requests. These are most useful for data migrations that take too long to be run as part of the app startup.
https://github.com/pgjones/quart-db/blob/main/CHANGELOG.rst

pgjones, to random
@pgjones@fosstodon.org avatar

I've recorded a new tutorial explaining how to run scheduled (cron) tasks with one extra line of Python using Quart-Tasks, https://youtu.be/_yqSYS6WVoM

pgjones, to random
@pgjones@fosstodon.org avatar

Quart-Schema now supports msgspec and attrs classes for validation (please install with pydantic to continue previous usage). See https://github.com/pgjones/quart-schema/blob/main/CHANGELOG.rst

sethmlarson, to python
@sethmlarson@fosstodon.org avatar

urllib3, 's most-used HTTP client library, is fundraising to add HTTP/2 support and ensure long-term sustainability of the project.

Retoots and shares are appreciated 🙏

https://sethmlarson.dev/urllib3-is-fundraising-for-http2-support

pgjones,
@pgjones@fosstodon.org avatar

@sethmlarson via hyper-h2?

pgjones, to random
@pgjones@fosstodon.org avatar

New year, new Hypercorn release. 0.16.0 adds ProxyFixMiddleware (a popular request), a max_requests config to help with memory leaks, a max keep alive requests config to mitigate the HTTP/2 rapid reset attack, and fixes many bugs. https://github.com/pgjones/hypercorn/blob/main/CHANGELOG.rst

tonybaloney, to python
@tonybaloney@fosstodon.org avatar

New Blog Post! Running Python Parallel Applications with Sub Interpreters. What is a sub interpreter? What does this have to do with No-GIL? What use is this? Can I use it for web apps? This and more questions answered. https://tonybaloney.github.io/posts/sub-interpreter-web-workers.html #python #django #flask #fastapi

pgjones,
@pgjones@fosstodon.org avatar

@tonybaloney nice! Please do submit the pr.

quentinpradet, to random
@quentinpradet@fosstodon.org avatar

Since one blocker for HTTP/2 support in urllib3 is our test server not supporting it, I've experimented with Hypercorn and Quart-Trio! https://github.com/urllib3/urllib3/pull/3190

pgjones,
@pgjones@fosstodon.org avatar

@quentinpradet exciting, I'll have to look.

tonybaloney, to random
@tonybaloney@fosstodon.org avatar

Tested my Hypercorn sub interpreter wrapper with Flask and FastAPI. Can't get Django run yet, but working on it.
https://gist.github.com/tonybaloney/98d16f330e8e75ab028037201f91a670 able to get better performance than a normal 4-worker server using multiprocessing. Not sharing benchmarks yet.

pgjones,
@pgjones@fosstodon.org avatar

@tonybaloney why is it better performance? I'd have thought processes had only an extra startup cost.

tonybaloney, to random
@tonybaloney@fosstodon.org avatar

Baby steps, but just got a build of CPython 3.13a1 with "free-threading", aka the "No GIL" fork working with a multithreaded HTTP network server that runs each request inside a PEP554 sub interpreter via communication channel. Now I need to get the sub interpreters to load and start an ASGI app, then we'll have a parallel, no-GIL ASGI HTTP server to test!

pgjones,
@pgjones@fosstodon.org avatar

@tonybaloney @davidism you could try adapting hypercorn, I'd certainly be interested.

pgjones,
@pgjones@fosstodon.org avatar

@apollo13 @hynek @davidism @tonybaloney Hypercorn is maintained and a WSGI server

pgjones,
@pgjones@fosstodon.org avatar

@apollo13 @hynek @davidism @tonybaloney I thought WSGI servers had to read the full body before calling the app - Is there an alternative you know of?

pgjones,
@pgjones@fosstodon.org avatar

@hynek @apollo13 @davidism @tonybaloney I've just added those to 0.16.0.

pgjones,
@pgjones@fosstodon.org avatar
pgjones,
@pgjones@fosstodon.org avatar

@hynek @apollo13 @davidism @tonybaloney I think the request timeout is best done in the application layer as I think the main use is to timeout the request body arrival. Although I appreciate this is hard for WSGI so I'll think how, to add this.
There isn't a way to limit concurrent threads, but I've been thinking about limiting concurrent requests as this works for HTTP/2 and 3. I think it would be roughly equivalent for HTTP/1 and WSGI.

pgjones, to random
@pgjones@fosstodon.org avatar

If you want receivers to be called in the order they were registered Blinker 1.7.0 now makes this possible. Just released. https://blinker.readthedocs.io/en/stable/#call-receivers-in-order-of-registration

pgjones, to random
@pgjones@fosstodon.org avatar

Users of Werkzeug should upgrade to 3.0.1 to avoid a vulnerability in the multipart parser. https://github.com/pallets/werkzeug/security/advisories/GHSA-hrfv-mqp8-q5rw

davidism, to random
@davidism@mas.to avatar

I have a lot of things I want to write about, that I think others would find insightful. I still don't have a blog. I need to make a blog, but it's yet another project on my long todo list. I love open source, but sometimes the drama really makes it hard to balance with my job and life. I wish it were all easier.

pgjones,
@pgjones@fosstodon.org avatar

@davidism my site is open source https://github.com/pgjones/pgjones_dev, but needlessly complex (so I can test HTTP things).

pgjones, to random
@pgjones@fosstodon.org avatar

My thoughts on Flask development, https://pgjones.dev/blog/flask-ecosystem-compatibility-2023/

Edit: I need to fix the meta cards on my blog, the title is "Flask, its ecosystem, and backwards compatibility"

pgjones,
@pgjones@fosstodon.org avatar

@miguelgrinberg I agree on the need for balance. I don't think we've put cost much on the extension maintainers - I do believe it should be a non-zero cost though.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • mdbf
  • ngwrru68w68
  • modclub
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • ethstaker
  • normalnudes
  • tester
  • osvaldo12
  • everett
  • cubers
  • tacticalgear
  • anitta
  • provamag3
  • Leos
  • cisconetworking
  • lostlight
  • All magazines