diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cf942e8f7a27889485f61976ff3c06e796a84c75..0cf5eae9c2c87b252d8ec80c4b4a596dbe1e2747 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,23 +2,23 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 22.12.0 hooks: - id: black - repo: https://github.com/pycqa/docformatter - rev: v1.5.0 + rev: v1.5.1 hooks: - id: docformatter - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.982 + rev: v0.991 hooks: - id: mypy args: [ @@ -28,12 +28,12 @@ repos: --ignore-missing-imports, ] - repo: https://github.com/asottile/pyupgrade - rev: v3.1.0 + rev: v3.3.1 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: check-ast - id: check-added-large-files diff --git a/src/bob/io/base/__init__.py b/src/bob/io/base/__init__.py index d9be717ebc05f2822af3eee72a4a47a2108f7325..6b0b20d8d7b2007b1843880d5282158d21f6085e 100644 --- a/src/bob/io/base/__init__.py +++ b/src/bob/io/base/__init__.py @@ -131,7 +131,6 @@ def write_file(filename, data, format="pillow") -> None: ``format`` : str The format to use to read the file. By default imageio selects the appropriate for you based on the filename and its contents """ - extension = os.path.splitext(filename)[1] # get the extension if extension in hdf5_extensions: @@ -171,7 +170,6 @@ def load(inputs) -> np.ndarray: ``data`` : :py:class:`numpy.ndarray` The data loaded from the given ``inputs``. """ - from collections.abc import Iterable import numpy @@ -261,7 +259,6 @@ def _generate_features(reader, paths, same_size=False): features and the shape of the first feature. The rest of objects are the actual values in features. The features are returned in C order. """ - shape_determined = False for i, path in enumerate(paths): diff --git a/src/bob/io/base/testing_utils.py b/src/bob/io/base/testing_utils.py index 240a9ad8986ee5303ba55981937b2e83a38bb530..c1823241e16ccdd0dd0bac6b7f96fc8a12294370 100644 --- a/src/bob/io/base/testing_utils.py +++ b/src/bob/io/base/testing_utils.py @@ -41,7 +41,6 @@ def datafile(f, module=None, path="data"): ``filename`` : str The full path of the file """ - resource = __name__ if module is None else module final_path = f if path is None else os.path.join(path, f) import pkg_resources diff --git a/tests/test_hdf5.py b/tests/test_hdf5.py index 3caeac9a0807c01f73d20d70a5cf89576678959c..c6106498815b7f6cc0a0a12d9e7a4b0dc59009ef 100644 --- a/tests/test_hdf5.py +++ b/tests/test_hdf5.py @@ -15,7 +15,6 @@ from bob.io.base import load, save def read_write_check(data, numpy_assert=True): """Testing loading and save different file types.""" - with tempfile.NamedTemporaryFile(prefix="bobtest_", suffix=".hdf5") as f: save(data, f.name) data2 = load(f.name)