From e5466e494ab255f3239e1a2090e55977abfc84c2 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 30 Oct 2024 16:30:01 -0500 Subject: [PATCH 1/3] Add more pre-commit hooks --- .pre-commit-config.yaml | 10 ++++++++++ src/sqliteimport/importer.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 245d099..bc1a811 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,6 +31,11 @@ repos: name: "Enforce Python 3.9+ idioms" args: ["--py39-plus"] + - repo: "https://github.com/sirosen/slyp" + rev: "0.8.1" + hooks: + - id: "slyp" + - repo: "https://github.com/psf/black-pre-commit-mirror" rev: "24.10.0" hooks: @@ -59,6 +64,11 @@ repos: - id: "check-dependabot" - id: "check-readthedocs" + - repo: "https://github.com/rhysd/actionlint" + rev: "v1.7.3" + hooks: + - id: "actionlint" + - repo: "https://github.com/kurtmckee/pre-commit-hooks" rev: "v0.1.1" hooks: diff --git a/src/sqliteimport/importer.py b/src/sqliteimport/importer.py index b94404c..baac359 100644 --- a/src/sqliteimport/importer.py +++ b/src/sqliteimport/importer.py @@ -78,7 +78,7 @@ def load(database: pathlib.Path | str | sqlite3.Connection) -> None: class SqliteDistribution(importlib.metadata.Distribution): - def __init__(self, name: str, connection: sqlite3.Connection): + def __init__(self, name: str, connection: sqlite3.Connection) -> None: self.__name = name self.__connection = connection self.__accessor = Accessor(connection) From 54c0cb72d94dc3344f44c40d7bbe5241f203fa9d Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 30 Oct 2024 16:32:39 -0500 Subject: [PATCH 2/3] Run `tox run -m update` --- .pre-commit-config.yaml | 2 +- requirements/docs/requirements.txt | 2 +- requirements/mypy/requirements.txt | 2 +- requirements/test/requirements.txt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc1a811..5ca3803 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: "trailing-whitespace" - repo: "https://github.com/asottile/pyupgrade" - rev: "v3.18.0" + rev: "v3.19.0" hooks: - id: "pyupgrade" name: "Enforce Python 3.9+ idioms" diff --git a/requirements/docs/requirements.txt b/requirements/docs/requirements.txt index 5b58a5a..2aca30d 100644 --- a/requirements/docs/requirements.txt +++ b/requirements/docs/requirements.txt @@ -8,7 +8,7 @@ idna==3.10 ; python_version >= "3.9" imagesize==1.4.1 ; python_version >= "3.9" importlib-metadata==8.5.0 ; python_version < "3.10" and python_version >= "3.9" jinja2==3.1.4 ; python_version >= "3.9" -markupsafe==3.0.1 ; python_version >= "3.9" +markupsafe==3.0.2 ; python_version >= "3.9" packaging==24.1 ; python_version >= "3.9" pygments==2.18.0 ; python_version >= "3.9" requests==2.32.3 ; python_version >= "3.9" diff --git a/requirements/mypy/requirements.txt b/requirements/mypy/requirements.txt index c5f3346..77945a0 100644 --- a/requirements/mypy/requirements.txt +++ b/requirements/mypy/requirements.txt @@ -1,4 +1,4 @@ mypy-extensions==1.0.0 ; python_version >= "3.9" -mypy==1.12.0 ; python_version >= "3.9" +mypy==1.13.0 ; python_version >= "3.9" tomli==2.0.2 ; python_version < "3.11" and python_version >= "3.9" typing-extensions==4.12.2 ; python_version >= "3.9" diff --git a/requirements/test/requirements.txt b/requirements/test/requirements.txt index 3f57750..f3582b3 100644 --- a/requirements/test/requirements.txt +++ b/requirements/test/requirements.txt @@ -1,11 +1,11 @@ colorama==0.4.6 ; python_version >= "3.9" and sys_platform == "win32" -coverage[toml]==7.6.3 ; python_version >= "3.9" +coverage[toml]==7.6.4 ; python_version >= "3.9" exceptiongroup==1.2.2 ; python_version < "3.11" and python_version >= "3.9" importlib-metadata==8.5.0 ; python_version < "3.10" and python_version >= "3.9" iniconfig==2.0.0 ; python_version >= "3.9" packaging==24.1 ; python_version >= "3.9" pluggy==1.5.0 ; python_version >= "3.9" -pytest-randomly==3.15.0 ; python_version >= "3.9" +pytest-randomly==3.16.0 ; python_version >= "3.9" pytest==8.3.3 ; python_version >= "3.9" tomli==2.0.2 ; python_full_version <= "3.11.0a6" and python_version >= "3.9" zipp==3.20.2 ; python_version < "3.10" and python_version >= "3.9" From 5d0d96cb9b7a480f35f60e112173ba94276f4bb1 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Wed, 30 Oct 2024 16:41:10 -0500 Subject: [PATCH 3/3] Alphabetize some of the tool configuration The Poetry configuration is still sorted first because it contains the project metadata. --- pyproject.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8447ecc..1c8bcb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,16 @@ strict = true sqlite_cache = true +# pytest +# ------ + +[tool.pytest.ini_options] +addopts = "--color=yes" +filterwarnings = [ + "error", +] + + # scriv # ----- @@ -81,13 +91,3 @@ fragment_directory = "changelog.d" insert_marker = "scriv-insert-here" main_branches = ["main", "releases"] new_fragment_template = "file: fragment-template.rst.txt" - - -# pytest -# ------ - -[tool.pytest.ini_options] -addopts = "--color=yes" -filterwarnings = [ - "error", -]