diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d3a6bc1..6181b043 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,7 +13,7 @@ repos: exclude: conda/meta.yaml - repo: https://github.com/psf/black - rev: 25.1.0 + rev: 26.5.1 hooks: - id: black @@ -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..cf13f06d 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 + - mypy ==2.3.0 - pre-commit ==4.3.0 - pyyaml - tbump >=6.9.0 diff --git a/pyproject.toml b/pyproject.toml index 5134c334..fce825f7 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", + "mypy==2.3.0", "pre-commit==4.3.0", "pyyaml", ] 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()