Releases: sanic-org/sanic
Version 24.6.0
What's Changed
- Fix Docker publish by @prryplatypus in #2887
- Fix Websockets Deprecation Warning by @ChihweiLHBird in #2919
- Run ruff with some changes by @ahopkins in #2932
- fix markdown on html5tagger page by @DeJayDev in #2924
- Remove erroneous del line by @Huy-Ngo in #2899
- Fix typo in sanic-ext configuration readme.md file by @jakkaz in #2930
- 2882 Apply dynamic port fixture for tests of http, ext integration, create task, multiprocessing, pipelineing. by @iAndriy in #2896
- 2882 Apply dynamic port fixture for tests of cli, config and server … by @iAndriy in #2892
- Healthcheck docs added extra information to enable the endpoint by @Nano112 in #2934
- Logging improvements by @ahopkins in #2931
- Unix sockets to use pathlib by @Tronic in #2850
- Handle streaming from ASGI by @ahopkins in #2937
- Update manager.py by @razodactyl in #2936
- Resolve Python 3.12 deprecation notice by @ahopkins in #2959
- Fixed wrong formatting in
request.md
by @ilya-nikolaev in #2955 - Make the
.message
field on exceptions non-empty by @ekzhang in #2947 - Ensure proper intent for noisy exceptions by @ahopkins in #2960
- Merge Entity Header #2824 by @ahopkins in #2962
- Allow for custom name generation by @ahopkins in #2961
- Add missing test by @ahopkins in #2964
- Add logging of extras and a JSONFormatter by @ahopkins in #2958
- Simplify (request.cookies.)getlist function by @Tronic in #2838
- Better fix for scheduling logic for transport close() and abort() by @ashleysommer in #2973
- Catch request middleware exceptions by @ahopkins in #2971
- Fix missing setuptools. Fix ast deprecation warnings. (#2970) by @ahopkins in #2978
- Fix deleting a cookie that was created with secure=False by @ashleysommer in #2976
- Error on bad body length by @ahopkins in #2979
- Bad encoding by @ahopkins in #2980
- Begin Release PR 24.6 by @ahopkins in #2968
New Contributors
- @DeJayDev made their first contribution in #2924
- @Huy-Ngo made their first contribution in #2899
- @jakkaz made their first contribution in #2930
- @Nano112 made their first contribution in #2934
- @razodactyl made their first contribution in #2936
- @ilya-nikolaev made their first contribution in #2955
- @ekzhang made their first contribution in #2947
Full Changelog: v23.12.0...v24.6.0
Version 23.12.2
What's Changed
- Fix Docker publish by @prryplatypus in #2887
- Backport PR 2973 by @ahopkins in #2975
- Clear HTTPX check in REPL by @ahopkins in #2965
- Backport PRs 2979 2980 by @ahopkins in #2981
Full Changelog: v23.12.1...v23.12.2
Version 23.12.1
What's Changed
- Fix broken multiplexer manage by @ahopkins in #2895
- Do not strip entity-headers with HTTP status 304 or 412 by @Tronic in #2824
Full Changelog: v23.12.0...v23.12.1
Version 23.12.0
Version 23.12.0
Current version
Features
- #2775 Start and restart arbitrary processes
- #2811 Cleaner process management in shutdown
- #2812 Suppress task cancel traceback on open websocket
- #2822 Listener and signal prioritization
- #2831 Reduce memory consumption
- #2837 Accept bare cookies
- #2841 Add
websocket.handler.<before/after/exception>
signals - #2805 Add changed files to reload trigger listeners
- #2813 Allow for simple signals
- #2827 Improve functionality and consistency of
Sanic.event()
- #2851 Allow range requests for a single byte
- #2854 Better
Request.scheme
for websocket requests - #2858 Convert Sanic
Request
to a WebsocketsRequest
for handshake - #2859 Add a REPL to the
sanic
CLI - #2870 Add Python 3.12 support
- #2875 Better exception on multiprocessing context conflicts
Bugfixes
- #2803 Fix MOTD display for extra data
Deprecations and Removals
Developer infrastructure
- #2796 Refactor unit test cases
- #2801 Fix
test_fast
when there is only one CPU - #2807 Add constraint for autodocsum (lint issue in old package version)
- #2808 Refactor GitHub Actions
- #2814 Run CI pipeline on git push
- #2846 Drop old performance tests/benchmarks
- #2848 Makefile cleanup
- #2865
#2869
#2872
#2879
Add ruff to toolchain - #2866 Fix the alt svc test to run locally with explicit buffer nbytes
- #2877 Use Python's trusted publisher in deployments
- #2882 Introduce dynamic port fixture in targeted locations in the test suite
Improved Documentation
- #2781
#2821
#2861
#2863
Conversion of User Guide to the SHH (Sanic, html5tagger, HTMX) stack - #2810 Update README
- #2855 Edit Discord badge
- #2864 Adjust documentation for using state properties within http/https redirection document
What's Changed
- Add constraint for autodocsumm by @prryplatypus in #2807
- Update README by @prryplatypus in #2810
- Refactor GitHub Actions by @prryplatypus in #2808
- Suppress task cancel traceback by @ahopkins in #2812
- Run tests on push as well by @prryplatypus in #2814
- Conversion of User Guide to the SHH stack by @ahopkins in #2781
- Fix test_fast when there's only one CPU by @tjni in #2801
- Refactoring unit test cases by @freddiewanah in #2796
- Accept bare cookies by @Tronic in #2837
- Allow range requests for a single byte by @Tronic in #2851
- Edit Discord badge. by @MichaelHinrichs in #2855
- Makefile cleanup by @ChihweiLHBird in #2848
- Drop old performance tests/benchmarks by @sjsadowski in #2846
- Add websocket.handler.before/after/exception signals by @Tronic in #2841
- Reducing memory consumption by @gluhar2006 in #2831
- Improvements to documentation by @ahopkins in #2821
- Add missing requirement by @ahopkins in #2861
- Fix MOTD for extra data by @ahopkins in #2803
- Style changes for mobile by @ahopkins in #2863
- Add ruff to toolchain by @ahopkins in #2865
- Allow for simple signals by @ahopkins in #2813
- issue:2832 Adjust documentation for using state properties within http -> https redirects doc. by @iAndriy in #2864
- Fix the alt svc test to run locally with explicit buffer nbytes by @ahopkins in #2866
- Add changed files to reload trigger listener by @ahopkins in #2805
- Introduce ruff execution on the examples and scripts folder #2867 by @iAndriy in #2869
- Cleaner process management by @ahopkins in #2811
- Improve functionality and consistency of Sanic.event() by @talljosh in #2827
- Make request.scheme return ws/wss for WS even when http/https in SERVER_NAME or proxy headers by @Tronic in #2854
- Add support for listener and signal prioritization by @ahopkins in #2822
- Better exception on multiprocessing context conflicts by @ahopkins in #2875
- Convert Sanic
Request
to WebSocketRequest
inwebsocket_handshake
by @ChihweiLHBird in #2858 - Introduce ruff execution on the tests folder #2871 by @iAndriy in #2872
- Add a REPL to the CLI by @ahopkins in #2859
- Use trusted publisher by @prryplatypus in #2877
- Support for Python 3.12 #2836 by @iAndriy in #2870
- Introduce ruff execution on the guides folder #2876 by @iAndriy in #2879
- Introduce dynamic port fixture for test_app and helper function for tests which require port within a loop. by @iAndriy in #2882
- Start and restart arbitrary processes by @ahopkins in #2775
- Version 23.12 Release by @ahopkins in #2885
New Contributors
- @tjni made their first contribution in #2801
- @freddiewanah made their first contribution in #2796
- @MichaelHinrichs made their first contribution in #2855
- @iAndriy made their first contribution in #2864
- @talljosh made their first contribution in #2827
Full Changelog: v23.6.0...v23.12.0
Version 23.6.0
Version 23.6.0 🔶
Features
- #2670 Increase
KEEP_ALIVE_TIMEOUT
default to 120 seconds - #2716 Adding allow route overwrite option in blueprint
- #2724 and #2792 Add a new exception signal for ALL exceptions raised anywhere in application
- #2727 Add name prefixing to BP groups
- #2754 Update request type on middleware types
- #2770 Better exception message on startup time application induced import error
- #2776 Set multiprocessing start method early
- #2785 Add custom typing to config and ctx objects
- #2790 Add
request.client_ip
Bugfixes
- #2728 Fix traversals for intended results
- #2729 Handle case when headers argument of ResponseStream constructor is None
- #2737 Fix type annotation for
JSONREsponse
default content type - #2740 Use Sanic's serializer for JSON responses in the Inspector
- #2760 Support for
Request.get_current
in ASGI mode - #2773 Alow Blueprint routes to explicitly define error_format
- #2774 Resolve headers on different renderers
- #2782 Resolve pypy compatibility issues
Deprecations and Removals
- #2777 Remove Python 3.7 support
Developer infrastructure
Improved Documentation
- #2741 Better documentation examples about running Sanic
From that list, the items to highlight in the release notes:
What's Changed
- Fix JSONResponse default content type by @prryplatypus in #2737
- Fix issue in getting current request through classmethod when served through a different ASGI server by @Thirumalai in #2760
- Unpin setuptools version by @ChihweiLHBird in #2766
- Sanic on pypy by @deounix in #2682
- fix examples for freeze_support() issue on windows by @deounix in #2741
- fix #2757 - Improved error messaging on startup time application induced import error by @moshe742 in #2770
- Fix Inner bug: TypeError: init() got an unexpected keyword argument 'escape_forward_slashes' #2740 by @chidoben in #2772
- Add name prefixing to BP groups by @ahopkins in #2727
- Adding allow route overwrite option in blueprint by @ChihweiLHBird in #2716
- Fix traversals for intended results by @ahopkins in #2728
- Update request type on middleware types by @guacs in #2754
- Resolve headers on different renderers - Issue 2749 by @ahopkins in #2774
- Handle case when
headers
argument ofResponseStream
constructor isNone
by @liamcoatman in #2729 - Add a new exception signal for ALL exceptions raised anywhere in application by @ahopkins in #2724
- Alow Blueprint routes to explicitly define error_format by @moshe742 in #2773
- Remove Python3.7 support by @ahopkins in #2777
- Set multiprocessing start method early by @ahopkins in #2776
- Run keep alive tests in loop to get available port by @ahopkins in #2779
- Increase KEEP_ALIVE_TIMEOUT default to 120 seconds by @Tronic in #2670
- Update bug-report.yml by @ahopkins in #2787
- Update bug-report.yml by @ahopkins in #2788
- Add custom typing to config and ctx by @ahopkins in #2785
- Add request.client_ip by @Tronic in #2790
- Add convenience method for exception reporting by @ahopkins in #2792
- Prepare for v23.6 release by @ahopkins in #2797
New Contributors
- @Thirumalai made their first contribution in #2760
- @moshe742 made their first contribution in #2770
- @chidoben made their first contribution in #2772
- @guacs made their first contribution in #2754
- @liamcoatman made their first contribution in #2729
Full Changelog: v23.3.0...v23.6.0
Version 23.3.0
Features
-
#2545 Standardize init of exceptions for more consistent control of HTTP responses using exceptions
-
#2606 Decode headers as UTF-8 also in ASGI
-
#2646 Separate ASGI request and lifespan callables
-
#2659 Use
FALLBACK_ERROR_FORMAT
for handlers that returnempty()
-
#2662 Add basic file browser (HTML page) and auto-index serving
-
#2667 Nicer traceback formatting (HTML page)
-
#2668 Smarter error page rendering format selection; more reliant upon header and "common sense" defaults
-
#2680 Check the status of socket before shutting down with
SHUT_RDWR
-
#2687 Refresh
Request.accept
functionality to be more performant and spec-compliant -
#2696 Add header accessors as properties
Example-Field: Foo, Bar Example-Field: Baz
request.headers.example_field == "Foo, Bar,Baz"
-
#2700 Simpler CLI targets
$ sanic path.to.module:app # global app instance $ sanic path.to.module:create_app # factory pattern $ sanic ./path/to/directory/ # simple serve
-
#2701 API to define a number of workers in managed processes
-
#2704 Add convenience for dynamic changes to routing
-
#2706 Add convenience methods for cookie creation and deletion
response = text("...") response.add_cookie("test", "It worked!", domain=".yummy-yummy-cookie.com")
-
#2707 Simplified
parse_content_header
escaping to be RFC-compliant and remove outdated FF hack -
#2710 Stricter charset handling and escaping of request URLs
-
#2711 Consume body on
DELETE
by default -
#2719 Allow
password
to be passed to TLS context -
#2720 Skip middleware on
RequestCancelled
-
#2721 Change access logging format to
%s
-
#2722 Add
CertLoader
as application option for directly controllingSSLContext
objects -
#2725 Worker sync state tolerance on race condition
Bugfixes
- #2651 ASGI websocket to pass thru bytes as is
- #2697 Fix comparison between datetime aware and naive in
file
when usingIf-Modified-Since
Deprecations and Removals
- #2666 Remove deprecated
__blueprintname__
property
Improved Documentation
- #2712 Improved example using
'https'
to create the redirect
New Contributors
- @r0x0d made their first contribution in #2666
- @deounix made their first contribution in #2680
- @mbendiksen made their first contribution in #2712
- @stricaud made their first contribution in #2697
Full Changelog: v22.12.0...v23.3.0
Version 22.12.0
Features
- #2569 Add
JSONResponse
class with some convenient methods when updating a response object - #2598 Change
uvloop
requirement to>=0.15.0
- #2609 Add compatibility with
websockets
v11.0 - #2610 Kill server early on worker error
- Raise deadlock timeout to 30s
- #2617 Scale number of running server workers
- #2621 #2634 Send
SIGKILL
on subsequentctrl+c
to force worker exit - #2622 Add API to restart all workers from the multiplexer
- #2624 Default to
spawn
for all subprocesses unless specifically set:from sanic import Sanic Sanic.start_method = "fork"
- #2625 Filename normalisation of form-data/multipart file uploads
- #2626 Move to HTTP Inspector:
- Remote access to inspect running Sanic instances
- TLS support for encrypted calls to Inspector
- Authentication to Inspector with API key
- Ability to extend Inspector with custom commands
- #2632 Control order of restart operations
- #2633 Move reload interval to class variable
- #2636 Add
priority
toregister_middleware
method - #2639 Add
unquote
toadd_route
method - #2640 ASGI websockets to receive
text
orbytes
Bugfixes
- #2607 Force socket shutdown before close to allow rebinding
- #2590 Use actual
StrEnum
in Python 3.11+ - #2615 Ensure middleware executes only once per request timeout
- #2627 Crash ASGI application on lifespan failure
- #2635 Resolve error with low-level server creation on Windows
Deprecations and Removals
- #2608 #2630 Signal conditions and triggers saved on
signal.extra
- #2626 Move to HTTP Inspector
- 🚨 BREAKING CHANGE: Moves the Inspector to a Sanic app from a simple TCP socket with a custom protocol
- DEPRECATE: The
--inspect*
commands have been deprecated in favor ofinspect ...
commands
- #2628 Replace deprecated
distutils.strtobool
Developer infrastructure
- #2612 Add CI testing for Python 3.11
Full Changelog: v22.9.1...v22.12.0
Version 22.9.1
What's Changed
- docs: sanic now supports windows by @SaidBySolo in #2582
- Upgrade markdown templates to issue forms by @ahopkins in #2588
- improve error message if no apps found in registry by @scardozos in #2585
- fix: sideeffects created by changing fork to spawn by @SaidBySolo in #2591
- 22.9 Docs by @ahopkins in #2556
- Add interval sleep in reloader by @ahopkins in #2595
- Resolve edge case in nested BP Groups by @ahopkins in #2592
- Add GenericCreator for loading SSL certs in processes by @ahopkins in #2578
New Contributors
- @scardozos made their first contribution in #2585
Full Changelog: v22.9.0...v22.9.1
Version 22.9.0
Features
- #2445 Add custom loads function
- #2490 Make
WebsocketImplProtocol
async iterable - #2499 Sanic Server WorkerManager refactor
- #2506 Use
pathlib
for path resolution (for static file serving) - #2508 Use
path.parts
instead ofmatch
(for static file serving) - #2513 Better request cancel handling
- #2516 Add request properties for HTTP method info:
request.is_safe
request.is_idempotent
request.is_cacheable
- See MDN docs for more information about when these apply
- #2522 Always show server location in ASGI
- #2526 Cache control support for static files for returning 304 when appropriate
- #2533 Refactor
_static_request_handler
- #2540 Add signals before and after handler execution
http.handler.before
http.handler.after
- #2542 Add [redacted] to CLI :)
- #2546 Add deprecation warning filter
- #2550 Middleware priority and performance enhancements
Bugfixes
- #2495 Prevent directory traversion with static files
- #2515 Do not apply double slash to paths in certain static dirs in Blueprints
Deprecations and Removals
- #2525 Warn on duplicate route names, will be prevented outright in v23.3
- #2537 Raise warning and deprecation notice on duplicate exceptions, will be prevented outright in v23.3
Developer infrastructure
- #2504 Cleanup test suite
- #2505 Replace Unsupported Python Version Number from the Contributing Doc
- #2530 Do not include tests folder in installed package resolver
Improved Documentation
New Contributors
Full Changelog: v22.6.0...v22.9.0
Version 22.6.2
#2522 Always show server location in ASGI
Full Changelog: v22.6.1...v22.6.2