From a5097c06c5c7f9750439aec8dde5180d0e38165c Mon Sep 17 00:00:00 2001 From: rettigl Date: Sat, 2 Mar 2024 22:36:15 +0100 Subject: [PATCH] fix ruff to <0.3.0, and re-format files again --- .pre-commit-config.yaml | 12 ++++++------ pyproject.toml | 2 +- specsanalyzer/__init__.py | 1 - specsanalyzer/config.py | 1 - specsanalyzer/convert.py | 1 - specsanalyzer/core.py | 1 - specsanalyzer/img_tools.py | 1 - specsanalyzer/io.py | 1 - specsscan/__init__.py | 1 - specsscan/core.py | 1 - specsscan/helpers.py | 1 - tests/helpers.py | 1 - tests/test_config.py | 1 - tests/test_convert.py | 2 -- tests/test_helpers.py | 1 - tests/test_img_tools.py | 1 - tests/test_io.py | 1 - tests/test_lens_modes.py | 1 - tests/test_specsanalyzer.py | 5 +---- tests/test_specsscan.py | 4 +--- 20 files changed, 9 insertions(+), 31 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1dfce03..7f535da 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.3.0 + rev: v0.2.2 hooks: # Run the formatter. - id: ruff-format @@ -23,11 +23,11 @@ repos: rev: v1.7.1 hooks: - id: mypy -#- repo: https://github.com/asottile/reorder_python_imports -# rev: v3.8.2 -# hooks: -# - id: reorder-python-imports -# args: [--application-directories, '.:src', --py36-plus] +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.8.2 + hooks: + - id: reorder-python-imports + args: [--application-directories, '.:src', --py36-plus] - repo: https://github.com/asottile/pyupgrade rev: v2.37.3 hooks: diff --git a/pyproject.toml b/pyproject.toml index 2abf1d0..25f9575 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ pytest = ">=7.0.1" pytest-cov = ">=3.0.0" pytest-xdist = ">=2.5.0" pytest-clarity = ">=1.0.1" -ruff = ">=0.1.7" +ruff = ">=0.1.7, <0.3.0" mypy = ">=1.6.0" types-pyyaml = ">=6.0.12.12" types-requests = ">=2.31.0.9" diff --git a/specsanalyzer/__init__.py b/specsanalyzer/__init__.py index 2a1e20b..e6b114e 100755 --- a/specsanalyzer/__init__.py +++ b/specsanalyzer/__init__.py @@ -1,5 +1,4 @@ """SpecsAnalyzer class easy access APIs""" - # Easy access APIs from .core import SpecsAnalyzer diff --git a/specsanalyzer/config.py b/specsanalyzer/config.py index a05fa84..a88f243 100755 --- a/specsanalyzer/config.py +++ b/specsanalyzer/config.py @@ -1,5 +1,4 @@ """This module contains a config library for loading yaml/json files into dicts""" - from __future__ import annotations import json diff --git a/specsanalyzer/convert.py b/specsanalyzer/convert.py index 371c4a4..d3b54f4 100755 --- a/specsanalyzer/convert.py +++ b/specsanalyzer/convert.py @@ -1,5 +1,4 @@ """Specsanalyzer image conversion module""" - from __future__ import annotations import numpy as np diff --git a/specsanalyzer/core.py b/specsanalyzer/core.py index c0cd51c..a2872d0 100755 --- a/specsanalyzer/core.py +++ b/specsanalyzer/core.py @@ -1,5 +1,4 @@ """This is the specsanalyzer core class""" - from __future__ import annotations import os diff --git a/specsanalyzer/img_tools.py b/specsanalyzer/img_tools.py index 2a67e52..be38091 100755 --- a/specsanalyzer/img_tools.py +++ b/specsanalyzer/img_tools.py @@ -1,5 +1,4 @@ """This module contains image manipulation tools for the specsanalyzer package""" - from __future__ import annotations from typing import Sequence diff --git a/specsanalyzer/io.py b/specsanalyzer/io.py index 44a453f..a80830e 100755 --- a/specsanalyzer/io.py +++ b/specsanalyzer/io.py @@ -1,5 +1,4 @@ """This module contains file input/output functions for the specsanalyzer module""" - from __future__ import annotations from pathlib import Path diff --git a/specsscan/__init__.py b/specsscan/__init__.py index 7071c27..4dc0f55 100755 --- a/specsscan/__init__.py +++ b/specsscan/__init__.py @@ -1,5 +1,4 @@ """SpecsScan class easy access APIs""" - # Easy access APIs from .core import SpecsScan diff --git a/specsscan/core.py b/specsscan/core.py index 9938ccd..70db6a3 100755 --- a/specsscan/core.py +++ b/specsscan/core.py @@ -1,5 +1,4 @@ """This is the SpecsScan core class""" - from __future__ import annotations import copy diff --git a/specsscan/helpers.py b/specsscan/helpers.py index 4e444f2..c1f342d 100644 --- a/specsscan/helpers.py +++ b/specsscan/helpers.py @@ -1,5 +1,4 @@ """This script contains helper functions used by the specscan class""" - from __future__ import annotations import datetime as dt diff --git a/tests/helpers.py b/tests/helpers.py index fa1e406..ae33e27 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,5 +1,4 @@ """Helper functions for tests""" - import numpy as np import xarray as xr diff --git a/tests/test_config.py b/tests/test_config.py index d536130..0517a33 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,5 +1,4 @@ """This is a code that performs several tests for the settings loader.""" - import os import tempfile from importlib.util import find_spec diff --git a/tests/test_convert.py b/tests/test_convert.py index 06b774e..0c0959b 100755 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -1,6 +1,4 @@ -# pylint: disable=duplicate-code """This is a code that performs several tests for the convert functions""" - import os import numpy as np diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 7c73f53..20f13e8 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,7 +1,6 @@ """This script performs tests for the helper functions in the core.py script to support the load_scan method. """ - import os from pathlib import Path diff --git a/tests/test_img_tools.py b/tests/test_img_tools.py index 83be11c..542faaa 100755 --- a/tests/test_img_tools.py +++ b/tests/test_img_tools.py @@ -1,5 +1,4 @@ """This is a code that performs several tests for the image tool module""" - import os import numpy as np diff --git a/tests/test_io.py b/tests/test_io.py index 930115e..6164c43 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1,5 +1,4 @@ """This is a code that performs several tests for the input/output functions""" - import os import random from pathlib import Path diff --git a/tests/test_lens_modes.py b/tests/test_lens_modes.py index 307b630..0ca9de1 100644 --- a/tests/test_lens_modes.py +++ b/tests/test_lens_modes.py @@ -1,5 +1,4 @@ """This is a code that performs several tests for the convert functions""" - import os import numpy as np diff --git a/tests/test_specsanalyzer.py b/tests/test_specsanalyzer.py index 11859e7..9d44b37 100755 --- a/tests/test_specsanalyzer.py +++ b/tests/test_specsanalyzer.py @@ -1,7 +1,4 @@ -"""This is a code that performs several tests for the SpecsAnalyzer -core class functions -""" - +"""This is a code that performs several tests for the SpecsAnalyzer core class functions""" import os from importlib.util import find_spec diff --git a/tests/test_specsscan.py b/tests/test_specsscan.py index b8a32d6..0811ca0 100755 --- a/tests/test_specsscan.py +++ b/tests/test_specsscan.py @@ -1,7 +1,5 @@ -"""This is a code that performs several tests for the SpecsScan -core class functions +"""This is a code that performs several tests for the SpecsScan core class functions """ - import os import numpy as np