Skip to content

Commit 33a9666

Browse files
authored
Merge pull request #8 from modern-python/ty
migrate to ty
2 parents a4b9a86 + edf68ac commit 33a9666

5 files changed

Lines changed: 7 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The library is built with modern Python practices (3.13+) and uses type hints ex
2020
- **uv** for package management and building
2121
- **Docker** for development and testing environments
2222
- **pytest** for testing
23-
- **ruff** and **mypy** for linting and type checking
23+
- **ruff** and **ty** for linting and type checking
2424

2525
## Project Structure
2626

@@ -112,7 +112,7 @@ The library can be configured using environment variables:
112112

113113
## Development Conventions
114114

115-
1. **Type Safety**: Strict mypy checking is enforced
115+
1. **Type Safety**: Strict ty checking is enforced
116116
2. **Code Style**: Ruff is used for linting with specific rules configured
117117
3. **Testing**: All functionality should have corresponding tests
118118
4. **Async/Await**: All database operations are asynchronous

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ lint:
2020
uv run eof-fixer .
2121
uv run ruff format
2222
uv run ruff check --fix
23-
uv run mypy .
23+
uv run ty check
2424

2525
lint-ci:
2626
uv run eof-fixer . --check
2727
uv run ruff format --check
2828
uv run ruff check --no-fix
29-
uv run mypy .
29+
uv run ty check
3030

3131
publish:
3232
rm -rf dist

db_retry/connections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def build_connection_factory(
2020
url: sqlalchemy.URL,
2121
timeout: float,
2222
) -> typing.Callable[[], typing.Awaitable["ConnectionType"]]:
23-
connect_args: typing.Final[dict[str, typing.Any]] = PGDialect_asyncpg().create_connect_args(url)[1] # type: ignore[no-untyped-call]
23+
connect_args: typing.Final[dict[str, typing.Any]] = PGDialect_asyncpg().create_connect_args(url)[1]
2424
raw_target_session_attrs: typing.Final[str | None] = connect_args.pop("target_session_attrs", None)
2525
target_session_attrs: typing.Final[SessionAttribute | None] = (
2626
SessionAttribute(raw_target_session_attrs) if raw_target_session_attrs else None

db_retry/retry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def postgres_retry[**P, T](
3333
wait=tenacity.wait_exponential_jitter(),
3434
retry=tenacity.retry_if_exception(_retry_handler),
3535
reraise=True,
36-
before=tenacity.before_log(logger, logging.DEBUG),
36+
before=tenacity.before_log(logger, logging.DEBUG), # ty: ignore[invalid-argument-type]
3737
)
3838
@functools.wraps(func)
3939
async def wrapped_method(*args: P.args, **kwargs: P.kwargs) -> T:

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dev = [
3636
]
3737
lint = [
3838
"ruff",
39-
"mypy",
39+
"ty",
4040
"eof-fixer",
4141
"asyncpg-stubs",
4242
]
@@ -49,10 +49,6 @@ build-backend = "uv_build"
4949
module-name = "db_retry"
5050
module-root = ""
5151

52-
[tool.mypy]
53-
python_version = "3.13"
54-
strict = true
55-
5652
[tool.ruff]
5753
fix = false
5854
unsafe-fixes = true

0 commit comments

Comments
 (0)