Skip to content

Commit

Permalink
Fix Ruff checks
Browse files Browse the repository at this point in the history
deskew/__init__.py:4:40: F401(ruff): `typing.Optional` imported but unused [See: https://docs.astral.sh/ruff/rules/unused-import]
deskew/__init__.py:343:9: B028(ruff): No explicit `stacklevel` keyword argument found [See: https://docs.astral.sh/ruff/rules/no-explicit-stacklevel]
  • Loading branch information
sbrunner committed Jan 7, 2025
1 parent 4f70103 commit eaa3531
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 84 deletions.
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ repos:
hooks:
- id: copyright
- id: workflows-require-timeout
- id: poetry-check
additional_dependencies:
- poetry==1.8.5 # pypi
- id: poetry-lock
additional_dependencies:
- poetry==1.8.5 # pypi
Expand Down
4 changes: 2 additions & 2 deletions deskew/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import subprocess # nosec
import tempfile
import warnings
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any

import matplotlib.axes
import matplotlib.projections.polar
Expand Down Expand Up @@ -340,7 +340,7 @@ def determine_skew(
"""
if num_angles is not None:
min_deviation = 180 / num_angles
warnings.warn("num_angles is deprecated, please use min_deviation", DeprecationWarning)
warnings.warn("num_angles is deprecated, please use min_deviation", DeprecationWarning, stacklevel=2)

angle, _ = determine_skew_dev(
image,
Expand Down
120 changes: 44 additions & 76 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ matplotlib = { version = "3.10.0", optional = true }
debug_images = ["opencv-python-headless", "matplotlib"]

[tool.poetry.group.dev.dependencies]
prospector = { extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "1.13.3" }
prospector = { version = "1.13.3", extras = ["with_bandit", "with_mypy", "with_pyroma", "with_ruff"] }
prospector-profile-duplicated = "1.10.0"
prospector-profile-utils = "1.14.1"
pytest = "8.3.4"
pytest-profiling = "1.8.1"
coverage = "7.6.10"
prospector-profile-duplicated = "1.10.0"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning", "poetry-plugin-tweak-dependencies-version", "poetry-plugin-drop-python-upper-constraint"]
Expand Down

0 comments on commit eaa3531

Please sign in to comment.