From 9171d30a0447f3c6e73c932121a74f37b31cb7e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2026 17:52:41 +0000 Subject: [PATCH 1/3] Update pre-commit dependencies --- .pre-commit-config.yaml | 8 ++++---- conda/dev.yml | 6 +++--- pyproject.toml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d3a6bc1..e00e2522 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ fail_fast: true # (run `python scripts/sync_pre_commit_versions.py` to sync them) repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -13,12 +13,12 @@ repos: exclude: conda/meta.yaml - repo: https://github.com/psf/black - rev: 25.1.0 + rev: 26.5.1 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 6.0.1 + rev: 8.0.1 hooks: - id: isort @@ -33,7 +33,7 @@ repos: exclude: analysis_data_preprocess - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.2 + rev: v2.3.0 hooks: - id: mypy args: ["--config=pyproject.toml", "--install-types", "--non-interactive"] diff --git a/conda/dev.yml b/conda/dev.yml index 291dfbb0..730196fc 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -16,11 +16,11 @@ dependencies: # `.pre-commit-config.yaml`, then run # `python scripts/sync_pre_commit_versions.py` to update the pinned versions # here and in the `qa` extra of pyproject.toml. - - black ==25.1.0 + - black ==26.5.1 - flake8 ==7.3.0 - flake8-isort ==6.1.2 - - isort ==6.0.1 - - mypy ==1.18.2 + - isort ==8.0.1 + - mypy ==2.3.0 - pre-commit ==4.3.0 - pyyaml - tbump >=6.9.0 diff --git a/pyproject.toml b/pyproject.toml index 5134c334..15f7a02b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,11 +23,11 @@ zstash = "zstash.main:main" # (run `python scripts/sync_pre_commit_versions.py` to sync them) [project.optional-dependencies] qa = [ - "black==25.1.0", + "black==26.5.1", "flake8==7.3.0", "flake8-isort==6.1.2", - "isort==6.0.1", - "mypy==1.18.2", + "isort==8.0.1", + "mypy==2.3.0", "pre-commit==4.3.0", "pyyaml", ] From 7b7e07abb3238a75ec4e472f0dd9d9dd4ee3b4e9 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Fri, 14 Aug 2026 13:05:10 -0500 Subject: [PATCH 2/3] Get conda env to solve --- .pre-commit-config.yaml | 2 +- conda/dev.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e00e2522..6181b043 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: black - repo: https://github.com/PyCQA/isort - rev: 8.0.1 + rev: 6.0.1 hooks: - id: isort diff --git a/conda/dev.yml b/conda/dev.yml index 730196fc..cf13f06d 100644 --- a/conda/dev.yml +++ b/conda/dev.yml @@ -19,7 +19,7 @@ dependencies: - black ==26.5.1 - flake8 ==7.3.0 - flake8-isort ==6.1.2 - - isort ==8.0.1 + - isort ==6.0.1 - mypy ==2.3.0 - pre-commit ==4.3.0 - pyyaml diff --git a/pyproject.toml b/pyproject.toml index 15f7a02b..fce825f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ qa = [ "black==26.5.1", "flake8==7.3.0", "flake8-isort==6.1.2", - "isort==8.0.1", + "isort==6.0.1", "mypy==2.3.0", "pre-commit==4.3.0", "pyyaml", From 5643ea6fd3cda3c340d689547adce4f68d1bada6 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Fri, 14 Aug 2026 13:13:46 -0500 Subject: [PATCH 3/3] Get pre-commit passing --- tests/unit/test_optimized_update.py | 6 ++---- zstash/create.py | 12 ++++-------- zstash/main.py | 4 +--- zstash/utils.py | 8 +++----- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/tests/unit/test_optimized_update.py b/tests/unit/test_optimized_update.py index 5934209b..3edc9ec7 100644 --- a/tests/unit/test_optimized_update.py +++ b/tests/unit/test_optimized_update.py @@ -570,15 +570,13 @@ def mock_database(): cur = conn.cursor() # Create files table - cur.execute( - """ + cur.execute(""" CREATE TABLE files ( name TEXT, size INTEGER, mtime TIMESTAMP ) - """ - ) + """) yield cur diff --git a/zstash/create.py b/zstash/create.py index 872b91e4..3406535e 100644 --- a/zstash/create.py +++ b/zstash/create.py @@ -228,19 +228,16 @@ def create_database( cur: sqlite3.Cursor = con.cursor() # Create 'config' table - cur.execute( - """ + cur.execute(""" create table config ( arg text primary key, value text ); - """ - ) + """) con.commit() # Create 'files' table - cur.execute( - """ + cur.execute(""" create table files ( id integer primary key, name text, @@ -250,8 +247,7 @@ def create_database( tar text, offset integer ); - """ - ) + """) con.commit() if not args.no_tars_md5: diff --git a/zstash/main.py b/zstash/main.py index 7d011d23..27155cf3 100755 --- a/zstash/main.py +++ b/zstash/main.py @@ -52,9 +52,7 @@ def main(): For help with a specific command zstash command --help -""".format( - __version__ - ) +""".format(__version__) ) parser.add_argument("command", help="command to run (create, update, extract, ...)") # parse_args defaults to [1:] for args, but you need to diff --git a/zstash/utils.py b/zstash/utils.py index fb2e3a3d..8994da0e 100644 --- a/zstash/utils.py +++ b/zstash/utils.py @@ -161,7 +161,7 @@ def run_command(command: str, error_str: str) -> None: ) stdout: bytes stderr: bytes - (stdout, stderr) = p1.communicate() + stdout, stderr = p1.communicate() status: int = p1.returncode if status != 0: error_str = "Error={}, Command was `{}`".format(error_str, command) @@ -255,16 +255,14 @@ def update_config(cur: sqlite3.Cursor): def create_tars_table(cur: sqlite3.Cursor, con: sqlite3.Connection): # Create 'tars' table - cur.execute( - """ + cur.execute(""" create table tars ( id integer primary key, name text, size integer, md5 text ); - """ - ) + """) con.commit()