Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#847)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.7 → v0.6.1](astral-sh/ruff-pre-commit@v0.5.7...v0.6.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* 📌 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>
  • Loading branch information
pre-commit-ci[bot] and shaneahmed authored Aug 20, 2024
1 parent af5f284 commit b0b1474
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/test_annotation_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__"}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_json_config_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_server_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tileserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions tiatoolbox/annotation/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
{},
Expand Down Expand Up @@ -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,
{},
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit b0b1474

Please sign in to comment.