Skip to content

Commit

Permalink
FIX: mypy dependency problem and revert unnecessary file rename (#132)
Browse files Browse the repository at this point in the history
Updated the version of mypy and of the SQLAlchemy dependency
(the latter was needed to avoid some INTERNAL ERRORs when running
mypy):

- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](pre-commit/pre-commit-hooks@v4.0.1...v4.1.0)
- [github.com/asottile/pyupgrade: v2.29.1 → v2.31.0](asottile/pyupgrade@v2.29.1...v2.31.0)
- [github.com/pre-commit/mirrors-mypy: v0.910-1 → v0.930](pre-commit/mirrors-mypy@v0.910-1...v0.930)

This also reverts commit 9eda5b8.
  • Loading branch information
giovannipizzi authored Jan 11, 2022
1 parent 9eda5b8 commit 16e6ff9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exclude: &exclude_files >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-json
- id: check-yaml
Expand Down Expand Up @@ -55,7 +55,7 @@ repos:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -78,10 +78,10 @@ repos:
- pytest==6.2.4

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v0.931
hooks:
- id: mypy
additional_dependencies:
- "sqlalchemy[mypy]==1.4.22"
- "sqlalchemy[mypy]==1.4.29"
- typing-extensions
files: ^(disk_objectstore/.*py)$
2 changes: 1 addition & 1 deletion disk_objectstore/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import delete, select, text, update

from .db import Obj, get_session
from .database import Obj, get_session
from .exceptions import InconsistentContent, NotExistent, NotInitialised
from .utils import (
CallbackStreamWrapper,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion performance-benchmarks/validation-calls/performance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from sqlalchemy import func
from tqdm import tqdm


from disk_objectstore.db import Obj
from disk_objectstore.database import Obj
from disk_objectstore import Container
from disk_objectstore.utils import PackedObjectReader, StreamDecompresser, get_hash
c = Container('test-newrepo-sdb/')
Expand Down
2 changes: 1 addition & 1 deletion tests/concurrent_tests/periodic_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from sqlalchemy.sql.expression import select

from disk_objectstore.container import Container, NotExistent, ObjectType
from disk_objectstore.db import Obj
from disk_objectstore.database import Obj

MAX_RETRIES_NO_PERM = 1000

Expand Down
8 changes: 4 additions & 4 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pytest

import disk_objectstore.exceptions as exc
from disk_objectstore import CompressMode, Container, ObjectType, db, utils
from disk_objectstore import CompressMode, Container, ObjectType, database, utils

COMPRESSION_ALGORITHMS_TO_TEST = ["zlib+1", "zlib+9"]

Expand Down Expand Up @@ -2233,9 +2233,9 @@ def test_validate_overlapping_packed(temp_container): # pylint: disable=invalid
assert not any(errors.values())

# Change the offset of the second object so that it's overlapping
temp_container._get_cached_session().query(db.Obj).filter(
db.Obj.hashkey == hashkey_second
).update({db.Obj.offset: db.Obj.offset - 1})
temp_container._get_cached_session().query(database.Obj).filter(
database.Obj.hashkey == hashkey_second
).update({database.Obj.offset: database.Obj.offset - 1})

errors = temp_container.validate()
problems = errors.pop("overlapping_packed")
Expand Down

0 comments on commit 16e6ff9

Please sign in to comment.