Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The library is built with modern Python practices (3.13+) and uses type hints ex
- **uv** for package management and building
- **Docker** for development and testing environments
- **pytest** for testing
- **ruff** and **mypy** for linting and type checking
- **ruff** and **ty** for linting and type checking

## Project Structure

Expand Down Expand Up @@ -112,7 +112,7 @@ The library can be configured using environment variables:

## Development Conventions

1. **Type Safety**: Strict mypy checking is enforced
1. **Type Safety**: Strict ty checking is enforced
2. **Code Style**: Ruff is used for linting with specific rules configured
3. **Testing**: All functionality should have corresponding tests
4. **Async/Await**: All database operations are asynchronous
Expand Down
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ lint:
uv run eof-fixer .
uv run ruff format
uv run ruff check --fix
uv run mypy .
uv run ty check

lint-ci:
uv run eof-fixer . --check
uv run ruff format --check
uv run ruff check --no-fix
uv run mypy .
uv run ty check

publish:
rm -rf dist
Expand Down
2 changes: 1 addition & 1 deletion db_retry/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def build_connection_factory(
url: sqlalchemy.URL,
timeout: float,
) -> typing.Callable[[], typing.Awaitable["ConnectionType"]]:
connect_args: typing.Final[dict[str, typing.Any]] = PGDialect_asyncpg().create_connect_args(url)[1] # type: ignore[no-untyped-call]
connect_args: typing.Final[dict[str, typing.Any]] = PGDialect_asyncpg().create_connect_args(url)[1]
raw_target_session_attrs: typing.Final[str | None] = connect_args.pop("target_session_attrs", None)
target_session_attrs: typing.Final[SessionAttribute | None] = (
SessionAttribute(raw_target_session_attrs) if raw_target_session_attrs else None
Expand Down
2 changes: 1 addition & 1 deletion db_retry/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def postgres_retry[**P, T](
wait=tenacity.wait_exponential_jitter(),
retry=tenacity.retry_if_exception(_retry_handler),
reraise=True,
before=tenacity.before_log(logger, logging.DEBUG),
before=tenacity.before_log(logger, logging.DEBUG), # ty: ignore[invalid-argument-type]
)
@functools.wraps(func)
async def wrapped_method(*args: P.args, **kwargs: P.kwargs) -> T:
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dev = [
]
lint = [
"ruff",
"mypy",
"ty",
"eof-fixer",
"asyncpg-stubs",
]
Expand All @@ -49,10 +49,6 @@ build-backend = "uv_build"
module-name = "db_retry"
module-root = ""

[tool.mypy]
python_version = "3.13"
strict = true

[tool.ruff]
fix = false
unsafe-fixes = true
Expand Down
Loading