-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: fix python ast, run pre-commit, rebase on latest docs changes
- Loading branch information
1 parent
6661e78
commit 24637d9
Showing
235 changed files
with
444 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
|
||
@get("/") | ||
def handler(state: State) -> None: ... | ||
def handler(state: State) -> None: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
|
||
@get("/cached-path", cache=120) # seconds | ||
def my_cached_handler() -> str: ... | ||
def my_cached_handler() -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from litestar import Litestar, Request, get | ||
from litestar import Request, get | ||
|
||
|
||
def key_builder(request: Request) -> str: | ||
return request.url.path + request.headers.get("my-header", "") | ||
|
||
|
||
@get("/cached-path", cache=True, cache_key_builder=key_builder) | ||
def cached_handler() -> str: ... | ||
def cached_handler() -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
|
||
@get("/cached-path", cache=True) | ||
def my_cached_handler() -> str: ... | ||
def my_cached_handler() -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from litestar.channels import ChannelsPlugin | ||
|
||
channels_plugin = ChannelsPlugin(..., arbitrary_channels_allowed=True) | ||
channels_plugin = ChannelsPlugin(..., arbitrary_channels_allowed=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
backend=MemoryChannelsBackend(), | ||
max_backlog=1000, | ||
backlog_strategy="backoff", | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
backend=MemoryChannelsBackend(), | ||
max_backlog=1000, | ||
backlog_strategy="dropleft", | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from litestar.channels import ChannelsPlugin | ||
|
||
channels_plugin = ChannelsPlugin(..., channels=["foo", "bar"]) | ||
channels_plugin = ChannelsPlugin(..., channels=["foo", "bar"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
channels.publish({"message": "Hello"}, "general") | ||
channels.publish({"message": "Hello"}, "general") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
async with channels.start_subscription(["foo", "bar"]) as subscriber: | ||
... # do some stuff here | ||
... # do some stuff here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
async with channels.start_subscription(["foo", "bar"]) as subscriber: | ||
... # do some stuff here | ||
await channels.unsubscribe(subscriber, ["foo"]) | ||
# do some stuff here | ||
await channels.unsubscribe(subscriber, ["foo"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
subscriber = await channels.subscribe(["foo", "bar"]) | ||
... # do some stuff here | ||
await channels.unsubscribe(subscriber, ["foo"]) | ||
# do some stuff here | ||
await channels.unsubscribe(subscriber, ["foo"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import click | ||
|
||
from litestar import Litestar | ||
|
||
|
||
@click.command() | ||
def my_command(app: Litestar) -> None: ... | ||
def my_command(app: Litestar) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from setuptools import setup | ||
|
||
setup( | ||
name="my-litestar-plugin", | ||
..., | ||
entry_points={ | ||
"litestar.commands": ["my_command=my_litestar_plugin.cli:main"], | ||
}, | ||
) | ||
name="my-litestar-plugin", | ||
# ..., other setup arguments | ||
entry_points={ | ||
"litestar.commands": ["my_command=my_litestar_plugin.cli:main"], | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar info | ||
litestar info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[tool.poetry.plugins."litestar.commands"] | ||
my_command = "my_litestar_plugin.cli:main" | ||
my_command = "my_litestar_plugin.cli:main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar run --reload-dir=. --reload-dir=../other-library/src | ||
litestar run --reload-dir=. --reload-dir=../other-library/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
LITESTAR_RELOAD_DIRS=.,../other-library/src | ||
LITESTAR_RELOAD_DIRS=.,../other-library/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
LITESTAR_RELOAD_EXCLUDES=*.py,*.yml | ||
LITESTAR_RELOAD_EXCLUDES=*.py,*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar run --reload-include="*.rst" --reload-include="*.yml" | ||
litestar run --reload-include="*.rst" --reload-include="*.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
LITESTAR_RELOAD_INCLUDES=*.rst,*.yml | ||
LITESTAR_RELOAD_INCLUDES=*.rst,*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar routes | ||
litestar routes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar run | ||
litestar run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar sessions clear | ||
litestar sessions clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar run --ssl-certfile=certs/cert.pem --ssl-keyfile=certs/key.pem | ||
litestar run --ssl-certfile=certs/cert.pem --ssl-keyfile=certs/key.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
litestar schema typescript | ||
litestar schema typescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export namespace API { | ||
// ... | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export namespace MyNamespace { | ||
// ... | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from litestar import Litestar | ||
from litestar.config.app import ExperimentalFeatures | ||
|
||
app = Litestar(experimental_features=[ExperimentalFeatures.DTO_CODEGEN]) | ||
app = Litestar(experimental_features=[ExperimentalFeatures.DTO_CODEGEN]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
@dataclass | ||
class WithCount(Generic[T]): | ||
count: int | ||
data: List[T] | ||
data: List[T] |
3 changes: 2 additions & 1 deletion
3
docs/examples/data_transfer_objects/factory/enveloping_return_data_2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from advanced_alchemy.dto import SQLAlchemyDTO | ||
|
||
from litestar.dto import DTOConfig | ||
|
||
|
||
class UserDTO(SQLAlchemyDTO[User]): | ||
config = DTOConfig(exclude={"password", "created_at"}) | ||
config = DTOConfig(exclude={"password", "created_at"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ def get_users() -> WithCount[User]: | |
created_at=datetime.now(), | ||
), | ||
], | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
"pets.0.id", | ||
"pets.0.user_id", | ||
} | ||
) | ||
) |
3 changes: 2 additions & 1 deletion
3
docs/examples/data_transfer_objects/factory/paginated_return_data_1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from advanced_alchemy.dto import SQLAlchemyDTO | ||
|
||
from litestar.dto import DTOConfig | ||
|
||
|
||
class UserDTO(SQLAlchemyDTO[User]): | ||
config = DTOConfig(exclude={"password", "created_at"}) | ||
config = DTOConfig(exclude={"password", "created_at"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ def get_users() -> ClassicPagination[User]: | |
created_at=datetime.now(), | ||
), | ||
], | ||
) | ||
) |
3 changes: 2 additions & 1 deletion
3
docs/examples/data_transfer_objects/factory/response_return_data_1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from advanced_alchemy.dto import SQLAlchemyDTO | ||
|
||
from litestar.dto import DTOConfig | ||
|
||
|
||
class UserDTO(SQLAlchemyDTO[User]): | ||
config = DTOConfig(exclude={"password", "created_at"}) | ||
config = DTOConfig(exclude={"password", "created_at"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/examples/debugging/running_litestar_with_pdb_on_exception.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
app = Litestar(pdb_on_exception=True) | ||
app = Litestar(pdb_on_exception=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.