Compare commits
2 Commits
main
...
breaking-c
Author | SHA1 | Date | |
---|---|---|---|
|
c695c5250a | ||
|
23c1eaab29 |
|
@ -1 +1,10 @@
|
|||
__version__ = "22.12.0"
|
||||
__version__ = "23.3.0"
|
||||
__compatibility__ = "22.12"
|
||||
|
||||
from inspect import currentframe, stack
|
||||
|
||||
for frame_info in stack():
|
||||
if frame_info.frame is not currentframe():
|
||||
value = frame_info.frame.f_globals.get("__SANIC_COMPATIBILITY__")
|
||||
if value:
|
||||
__compatibility__ = value
|
||||
|
|
18
sanic/breaking/__init__.py
Normal file
18
sanic/breaking/__init__.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from sanic.__version__ import __compatibility__
|
||||
|
||||
if __compatibility__ == "22.12":
|
||||
from .v22_12.request import (
|
||||
File,
|
||||
Request,
|
||||
RequestParameters,
|
||||
parse_multipart_form,
|
||||
)
|
||||
elif __compatibility__ == "23.3":
|
||||
from .v23_3.request import (
|
||||
File,
|
||||
Request,
|
||||
RequestParameters,
|
||||
parse_multipart_form,
|
||||
)
|
||||
else:
|
||||
raise RuntimeError(f"Unknown compatibility value: {__compatibility__}")
|
0
sanic/breaking/v22_12/__init__.py
Normal file
0
sanic/breaking/v22_12/__init__.py
Normal file
1123
sanic/breaking/v22_12/request.py
Normal file
1123
sanic/breaking/v22_12/request.py
Normal file
File diff suppressed because it is too large
Load Diff
0
sanic/breaking/v23_3/__init__.py
Normal file
0
sanic/breaking/v23_3/__init__.py
Normal file
9
sanic/breaking/v23_3/request.py
Normal file
9
sanic/breaking/v23_3/request.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
from ..v22_12.request import File
|
||||
from ..v22_12.request import Request as LegacyRequest
|
||||
from ..v22_12.request import RequestParameters, parse_multipart_form
|
||||
|
||||
|
||||
class Request(LegacyRequest):
|
||||
@property
|
||||
def something_new(self):
|
||||
return 123
|
1130
sanic/request.py
1130
sanic/request.py
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user