Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ 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
- id: check-yaml
exclude: conda/meta.yaml

- repo: https://github.com/psf/black
rev: 25.1.0
rev: 26.5.1
hooks:
- id: black

Expand All @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions conda/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/test_optimized_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 4 additions & 8 deletions zstash/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -250,8 +247,7 @@ def create_database(
tar text,
offset integer
);
"""
)
""")
con.commit()

if not args.no_tars_md5:
Expand Down
4 changes: 1 addition & 3 deletions zstash/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions zstash/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()


Expand Down
Loading