Skip to content

Commit 69a1c0d

Browse files
authored
Fixes for Ruff>=0.16.0 (#814)
* Automated upgrades by Ruff uvx --with 'ruff>=0.16.0' ruff check . --fix --unsafe-fixes * Fix remaining Ruff errors with GPT-5.6 Sol high https://gist.github.com/simonw/6da7906a9fea6e90da131c21a9055199 * Fix flake E501 long lines * New Protocol for migrations to make ty happy
1 parent a947dc6 commit 69a1c0d

57 files changed

Lines changed: 967 additions & 1042 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ venv
1515
.schema
1616
.vscode
1717
.hypothesis
18+
.claude/
1819
Pipfile
1920
Pipfile.lock
2021
uv.lock

‎docs/cli-reference.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ See :ref:`cli_convert`.
662662
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
663663

664664
r.parsedate(value: 'str', dayfirst: 'bool' = False, yearfirst: 'bool' = False,
665-
errors: 'Optional[object]' = None) -> 'Optional[str]'
665+
errors: 'object | None' = None) -> 'str | None'
666666

667667
Parse a date and convert it to ISO date format: yyyy-mm-dd
668668
- dayfirst=True: treat xx as the day in xx/yy/zz
@@ -671,7 +671,7 @@ See :ref:`cli_convert`.
671671
- errors=r.SET_NULL to set values that cannot be parsed to null
672672

673673
r.parsedatetime(value: 'str', dayfirst: 'bool' = False, yearfirst: 'bool' =
674-
False, errors: 'Optional[object]' = None) -> 'Optional[str]'
674+
False, errors: 'object | None' = None) -> 'str | None'
675675

676676
Parse a datetime and convert it to ISO datetime format: yyyy-mm-ddTHH:MM:SS
677677
- dayfirst=True: treat xx as the day in xx/yy/zz

‎docs/conf.py‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
3-
41
import inspect
5-
from pathlib import Path
6-
from subprocess import Popen, PIPE, check_output
72
import sys
3+
from pathlib import Path
4+
from subprocess import PIPE, CalledProcessError, Popen, check_output
85

96
# This file is execfile()d with the current directory set to its
107
# containing dir.
@@ -50,7 +47,7 @@
5047
def _linkcode_git_ref():
5148
try:
5249
return check_output(["git", "rev-parse", "HEAD"]).decode("utf8").strip()
53-
except Exception:
50+
except (CalledProcessError, OSError):
5451
return "main"
5552

5653

@@ -79,7 +76,7 @@ def linkcode_resolve(domain, info):
7976
obj = inspect.unwrap(obj)
8077
source_file = inspect.getsourcefile(obj)
8178
_, line_number = inspect.getsourcelines(obj)
82-
except Exception:
79+
except (OSError, TypeError, ValueError):
8380
return None
8481

8582
if source_file is None:

‎pyproject.toml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ build-backend = "setuptools.build_meta"
7979
max-line-length = 160
8080
# Black compatibility, E203 whitespace before ':':
8181
extend-ignore = ["E203"]
82-
extend-exclude = [".venv", "build", "dist", "docs", "sqlite_utils.egg-info"]
82+
extend-exclude = [
83+
".venv",
84+
".claude",
85+
"build",
86+
"dist",
87+
"docs",
88+
"sqlite_utils.egg-info",
89+
]
8390

8491
[tool.setuptools.package-data]
8592
sqlite_utils = ["py.typed"]

‎sqlite_utils/__init__.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from .utils import suggest_column_types
2-
from .hookspecs import hookimpl
3-
from .hookspecs import hookspec
41
from .db import Database
2+
from .hookspecs import hookimpl, hookspec
53
from .migrations import Migrations
4+
from .utils import suggest_column_types
65

7-
__all__ = ["Database", "Migrations", "suggest_column_types", "hookimpl", "hookspec"]
6+
__all__ = ["Database", "Migrations", "hookimpl", "hookspec", "suggest_column_types"]

0 commit comments

Comments
 (0)