Skip to content

Commit ad69eb4

Browse files
committed
fix(sftkit): make linter happy
1 parent fe044e9 commit ad69eb4

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ target-version = "py311"
2424

2525
[tool.ruff.lint]
2626
select = ["I", "F", "E", "PL"]
27-
ignore = ["PLR0913", "E722"]
27+
ignore = ["PLR0913", "PLC0415", "E722"]
2828

2929
[tool.mypy]
3030
ignore_missing_imports = true

sftkit/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ target-version = "py311"
4444

4545
[tool.ruff.lint]
4646
select = ["I", "F", "E", "PL"]
47-
ignore = ["PLR0913", "E722"]
47+
ignore = ["PLR0913", "PLC0415", "E722"]
4848

4949
[tool.mypy]
5050
ignore_missing_imports = true

sftkit/src/sftkit/http/_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ async def run(self, context: ContextT):
107107
# register service instances so they are available in api routes
108108
# kwargs set here can then be fetched with `name = Depends($name)`
109109
# in the router kwargs.
110+
110111
self.api.add_middleware(
111-
ContextMiddleware,
112-
context=context,
112+
ContextMiddleware, # type: ignore
113+
context=context, # type: ignore
113114
)
114115
webserver = uvicorn.Server(self.uvicorn_config)
115116
await webserver.serve()

sftkit/tests/conftest.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
def db_config() -> DatabaseConfig:
1818
return DatabaseConfig(
1919
host=os.environ.get("SFTKIT_TEST_DB_HOST"),
20-
port=os.environ.get("SFTKIT_TEST_DB_PORT", 5432),
20+
port=int(os.environ.get("SFTKIT_TEST_DB_PORT", "5432")),
2121
user=os.environ.get("SFTKIT_TEST_DB_USER"),
2222
password=os.environ.get("SFTKIT_TEST_DB_PASSWORD"),
2323
dbname=os.environ.get("SFTKIT_TEST_DB_DBNAME", "sftkit_test"),
@@ -32,17 +32,13 @@ async def static_test_db_pool(db_config: DatabaseConfig) -> AsyncGenerator[Pool,
3232

3333

3434
@pytest_asyncio.fixture(loop_scope="session", scope="function")
35-
async def test_db(
36-
db_config: DatabaseConfig, static_test_db_pool: Pool
37-
) -> AsyncGenerator[Database, None]:
35+
async def test_db(db_config: DatabaseConfig, static_test_db_pool: Pool) -> AsyncGenerator[Database, None]:
3836
dbname = "".join(random.choices(string.ascii_lowercase, k=20))
3937
cfg = db_config.model_copy()
4038
cfg.dbname = dbname
4139
await static_test_db_pool.execute(f'create database "{dbname}"')
4240
if db_config.user:
43-
await static_test_db_pool.execute(
44-
f'alter database "{dbname}" owner to "{db_config.user}"'
45-
)
41+
await static_test_db_pool.execute(f'alter database "{dbname}" owner to "{db_config.user}"')
4642
mininal_db_assets = ASSETS_DIR / "minimal_db"
4743
database = Database(
4844
config=cfg,

0 commit comments

Comments
 (0)