From b0b14742df31ff64e84e841a0c6d73e981d99a76 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:22:20 +0100 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#847) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.7 → v0.6.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.7...v0.6.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * :pushpin: Update `ruff` version. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> --- .github/workflows/python-package.yml | 2 +- .pre-commit-config.yaml | 2 +- requirements/requirements_dev.txt | 2 +- tests/test_annotation_stores.py | 2 +- tests/test_docs.py | 2 +- tests/test_json_config_bokeh.py | 2 +- tests/test_server_bokeh.py | 2 +- tests/test_tileserver.py | 6 +++--- tiatoolbox/annotation/storage.py | 10 +++++----- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 686323a5d..688840262 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -30,7 +30,7 @@ jobs: sudo apt update sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools python -m pip install --upgrade pip - python -m pip install ruff==0.5.7 pytest pytest-cov pytest-runner + python -m pip install ruff==0.6.1 pytest pytest-cov pytest-runner pip install -r requirements/requirements.txt - name: Cache tiatoolbox static assets uses: actions/cache@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 89b0cbc0a..67256a495 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,7 +60,7 @@ repos: - id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst. - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.5.7 + rev: v0.6.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/requirements/requirements_dev.txt b/requirements/requirements_dev.txt index 0ea61cc16..111fe7e84 100644 --- a/requirements/requirements_dev.txt +++ b/requirements/requirements_dev.txt @@ -11,7 +11,7 @@ pytest>=7.2.0 pytest-cov>=4.0.0 pytest-runner>=6.0 pytest-xdist[psutil] -ruff==0.5.7 # This will be updated by pre-commit bot to latest version +ruff==0.6.1 # This will be updated by pre-commit bot to latest version toml>=0.10.2 twine>=4.0.1 wheel>=0.37.1 diff --git a/tests/test_annotation_stores.py b/tests/test_annotation_stores.py index 7acbe2e44..01bbdac45 100644 --- a/tests/test_annotation_stores.py +++ b/tests/test_annotation_stores.py @@ -194,7 +194,7 @@ def sample_triangle() -> Polygon: return Polygon([(0, 0), (1, 1), (2, 0)]) -@pytest.fixture() +@pytest.fixture def fill_store( cell_grid: list[Polygon], points_grid: list[Point], diff --git a/tests/test_docs.py b/tests/test_docs.py index ea446737a..20880482b 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -17,7 +17,7 @@ from collections.abc import Generator -@pytest.fixture() +@pytest.fixture def source_files(root_path: Path) -> Generator: """Recursively yield source files from the project.""" ignore = {"__pycache__"} diff --git a/tests/test_json_config_bokeh.py b/tests/test_json_config_bokeh.py index 4461cd431..2c3a16e7b 100644 --- a/tests/test_json_config_bokeh.py +++ b/tests/test_json_config_bokeh.py @@ -40,7 +40,7 @@ def annotation_path(data_path: dict[str, Path]) -> dict[str, Path]: return data_path -@pytest.fixture() +@pytest.fixture def bk_session(data_path: dict[str, Path]) -> ClientSession: """Create a bokeh session.""" run_tileserver() diff --git a/tests/test_server_bokeh.py b/tests/test_server_bokeh.py index 2289bcbc2..9544abc6d 100644 --- a/tests/test_server_bokeh.py +++ b/tests/test_server_bokeh.py @@ -46,7 +46,7 @@ def annotation_path(data_path: dict[str, Path]) -> dict[str, Path]: return data_path -@pytest.fixture() +@pytest.fixture def bk_session(data_path: dict[str, Path]) -> ClientSession: """Create a bokeh session.""" run_tileserver() diff --git a/tests/test_tileserver.py b/tests/test_tileserver.py index a3fa610d5..5451f716f 100644 --- a/tests/test_tileserver.py +++ b/tests/test_tileserver.py @@ -87,7 +87,7 @@ def _fill_store( return _fill_store -@pytest.fixture() +@pytest.fixture def app(remote_sample: Callable, tmp_path: Path) -> TileServer: """Create a testing TileServer WSGI app.""" # Make a low-res .jpg of the right shape to be used as @@ -122,7 +122,7 @@ def app(remote_sample: Callable, tmp_path: Path) -> TileServer: return app -@pytest.fixture() +@pytest.fixture def app_alt(fill_store: Callable) -> TileServer: """Create a testing TileServer WSGI app, with a different setup.""" sample_slide = WSIReader.open(np.zeros((1000, 1000, 3), dtype=np.uint8)) @@ -147,7 +147,7 @@ def app_alt(fill_store: Callable) -> TileServer: return app -@pytest.fixture() +@pytest.fixture def empty_app() -> TileServer: """Create a testing TileServer WSGI app with no layers.""" app = TileServer( diff --git a/tiatoolbox/annotation/storage.py b/tiatoolbox/annotation/storage.py index 8ce05566d..0cd476358 100644 --- a/tiatoolbox/annotation/storage.py +++ b/tiatoolbox/annotation/storage.py @@ -939,7 +939,7 @@ def _eval_where( return True if isinstance(predicate, str): return bool( - eval( # skipcq: PYL-W0123, # noqa: PGH001, S307 + eval( # skipcq: PYL-W0123, # noqa: S307 predicate, PY_GLOBALS, {"props": properties}, @@ -1513,7 +1513,7 @@ def select_values( if isinstance(select, str): py_locals = {"props": annotation.properties} - return eval( # skipcq: PYL-W0123, # noqa: PGH001, S307 + return eval( # skipcq: PYL-W0123, # noqa: S307 select, PY_GLOBALS, py_locals, @@ -2817,7 +2817,7 @@ def _initialize_query_string_parameters( query_parameters["where"] = where # Predicate is a string if isinstance(where, str): - sql_predicate = eval( # skipcq: PYL-W0123, # noqa: PGH001, S307 + sql_predicate = eval( # skipcq: PYL-W0123, # noqa: S307 where, SQL_GLOBALS, {}, @@ -3427,7 +3427,7 @@ def pquery( return_columns.append("[key]") if is_str_query and not is_star_query: select = cast(str, select) - select_names = eval( # skipcq: PYL-W0123, # noqa: PGH001, S307 + select_names = eval( # skipcq: PYL-W0123, # noqa: S307 select, SQL_GLOBALS, {}, @@ -3855,7 +3855,7 @@ def create_index( if not isinstance(where, str): msg = f"Invalid type for `where` ({type(where)})." raise TypeError(msg) - sql_predicate = eval( # skipcq: PYL-W0123, # noqa: PGH001, S307 + sql_predicate = eval( # skipcq: PYL-W0123, # noqa: S307 where, SQL_GLOBALS, )