Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Sep 7, 2023
1 parent 7badaf5 commit 09575f8
Show file tree
Hide file tree
Showing 9 changed files with 205 additions and 174 deletions.
36 changes: 19 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/python-poetry/poetry
rev: "1.6.1"
rev: "1.6.0"
hooks:
- id: poetry-check
- repo: https://github.com/provinzkraut/unasyncd
Expand All @@ -27,7 +27,7 @@ repos:
- id: unasyncd
additional_dependencies: ["ruff"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.286"
rev: "v0.0.287"
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -46,7 +46,7 @@ repos:
hooks:
- id: blacken-docs
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.2"
rev: "v3.0.3"
hooks:
- id: prettier
exclude: "_templates|.git|.all-contributorsrc"
Expand All @@ -68,9 +68,9 @@ repos:
exclude: "test_apps|tools|docs|tests/examples|tests/docker_service_fixtures|tests/unit/test_contrib/test_pydantic/test_beanie_integration"
additional_dependencies:
[
polyfactory,
aiosqlite,
annotated_types,
anyio,
async_timeout,
asyncmy,
asyncpg,
Expand All @@ -95,41 +95,42 @@ repos:
oracledb,
piccolo,
picologging,
polyfactory,
prometheus_client,
psycopg,
pydantic>=2,
pydantic-extra-types,
pydantic>=2,
pytest,
pytest-lazy-fixture,
pytest-mock,
pytest-timeout,
pytest_docker,
python-dotenv,
python-jose,
pytest-timeout,
pyyaml,
redis,
rich,
rich-click,
sqlalchemy>=2.0.12,
starlette,
types-beautifulsoup4,
structlog,
time-machine,
types-beautifulsoup4,
types-python-jose,
types-pyyaml,
types-redis,
types-python-jose,
uvicorn,
prometheus_client,
time-machine,
]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.324
rev: v1.1.325
hooks:
- id: pyright
exclude: "test_apps|tools|docs|_openapi|tests/examples|tests/docker_service_fixtures"
additional_dependencies:
[
polyfactory,
aiosqlite,
annotated_types,
anyio,
async_timeout,
asyncmy,
asyncpg,
Expand All @@ -154,30 +155,31 @@ repos:
oracledb,
piccolo,
picologging,
polyfactory,
prometheus_client,
psycopg,
pydantic>=2,
pydantic-extra-types,
pydantic>=2,
pytest,
pytest-lazy-fixture,
pytest-mock,
pytest-timeout,
pytest_docker,
python-dotenv,
python-jose,
pytest-timeout,
pyyaml,
redis,
rich,
rich-click,
sqlalchemy>=2.0.12,
starlette,
structlog,
time-machine,
types-beautifulsoup4,
types-python-jose,
types-pyyaml,
types-redis,
types-python-jose,
uvicorn,
prometheus_client,
time-machine,
]
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: "v0.6.8"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ app = Litestar(route_handlers=[hello_world])
demonstrates a pattern of application modularity, SQLAlchemy 2.0 ORM, Redis cache connectivity, and more. Like all
Litestar projects, this application is open to contributions, big and small.
- [litestar-fullstack](https://github.com/litestar-org/litestar-fullstack): A reference application that contains most of the boilerplate required for a web application.
It features a Litestar app configured with best practices, SQLAlchemy 2.0 and SAQ, a frontend integrated with Vitejs and Jinja2 templates, Docker, and more.
It features a Litestar app configured with best practices, SQLAlchemy 2.0 and SAQ, a frontend integrated with Vitejs and Jinja2 templates, Docker, and more.
- [litestar-hello-world](https://github.com/litestar-org/litestar-hello-world): A bare-minimum application setup. Great
for testing and POC work.

Expand Down
2 changes: 2 additions & 0 deletions docs/PYPI_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ app = Litestar(route_handlers=[hello_world])
- [starlite-pg-redis-docker](https://github.com/litestar-org/starlite-pg-redis-docker): In addition to Litestar, this
demonstrates a pattern of application modularity, SQLAlchemy 2.0 ORM, Redis cache connectivity, and more. Like all
Litestar projects, this application is open to contributions, big and small.
- [litestar-fullstack](https://github.com/litestar-org/litestar-fullstack): A reference application that contains most of the boilerplate required for a web application.
It features a Litestar app configured with best practices, SQLAlchemy 2.0 and SAQ, a frontend integrated with Vitejs and Jinja2 templates, Docker, and more.
- [litestar-hello-world](https://github.com/litestar-org/litestar-hello-world): A bare-minimum application setup. Great
for testing and POC work.

Expand Down
2 changes: 1 addition & 1 deletion litestar/events/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def _worker(receive_stream: MemoryObjectReceiveStream) -> None:

async def __aenter__(self) -> SimpleEventEmitter:
self._exit_stack = AsyncExitStack()
send_stream, receive_stream = anyio.create_memory_object_stream(math.inf)
send_stream, receive_stream = anyio.create_memory_object_stream(math.inf) # type: ignore[var-annotated]
self._send_stream = send_stream
task_group = anyio.create_task_group()

Expand Down
4 changes: 2 additions & 2 deletions litestar/testing/life_span_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class LifeSpanHandler(Generic[T]):

def __init__(self, client: T) -> None:
self.client = client
self.stream_send = StapledObjectStream[Optional["LifeSpanSendMessage"]](*create_memory_object_stream(inf))
self.stream_receive = StapledObjectStream["LifeSpanReceiveMessage"](*create_memory_object_stream(inf))
self.stream_send = StapledObjectStream[Optional["LifeSpanSendMessage"]](*create_memory_object_stream(inf)) # type: ignore[arg-type]
self.stream_receive = StapledObjectStream["LifeSpanReceiveMessage"](*create_memory_object_stream(inf)) # type: ignore[arg-type]

with self.client.portal() as portal:
self.task = portal.start_task_soon(self.lifespan)
Expand Down
Loading

0 comments on commit 09575f8

Please sign in to comment.