Skip to content

Commit e37140e

Browse files
committed
migrate from blackt to ruff format
1 parent fdd70ad commit e37140e

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.1.14
3+
rev: v0.2.2
44
hooks:
55
- id: ruff
66
args: [ --fix ]
7+
- id: ruff-format
78

89
- repo: https://github.com/RobertCraigie/pyright-python
9-
rev: v1.1.347
10+
rev: v1.1.351
1011
hooks:
1112
- id: pyright
1213

13-
- repo: https://github.com/FHPythonUtils/Blackt
14-
rev: '2024.0.1'
15-
hooks:
16-
- id: blackt
17-
1814
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
19-
rev: v1.3.2
15+
rev: v1.3.3
2016
hooks:
2117
- id: python-safety-dependencies-check
2218
files: pyproject.toml
@@ -39,7 +35,7 @@ repos:
3935
- id: mixed-line-ending
4036

4137
- repo: https://github.com/boidolr/pre-commit-images
42-
rev: v1.5.1
38+
rev: v1.5.2
4339
hooks:
4440
- id: optimize-jpg
4541
- id: optimize-png

blendmodes/blend.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ def imageIntToFloat(image: np.ndarray) -> np.ndarray:
367367
Returns:
368368
-------
369369
np.ndarray: numpy array of floats
370+
370371
"""
371372
return image / 255
372373

@@ -381,6 +382,7 @@ def imageFloatToInt(image: np.ndarray) -> np.ndarray:
381382
Returns:
382383
-------
383384
np.ndarray: numpy array of ints
385+
384386
"""
385387
clippedIm = np.clip((image * 255).round(), 0, 255)
386388
with warnings.catch_warnings():
@@ -421,6 +423,7 @@ def blend(background: np.ndarray, foreground: np.ndarray, blendType: BlendType)
421423
[0. 0. 0.]
422424
[0. 0. 0.]
423425
[0. 0. 0.]]]
426+
424427
"""
425428
blendLookup = {
426429
BlendType.NORMAL: normal,
@@ -491,6 +494,7 @@ def blendLayers(
491494
opacity=0.7,
492495
offsets=(100, 50)
493496
)
497+
494498
"""
495499
arr = blendLayersArray(
496500
background=background,
@@ -540,6 +544,7 @@ def blendLayersArray(
540544
opacity=0.7,
541545
offsets=(100, 50)
542546
)
547+
543548
"""
544549
# Convert the Image.Image to a numpy array if required
545550
if isinstance(background, Image.Image):

documentation/reference/blendmodes/blend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def additive(background: np.ndarray, foreground: np.ndarray) -> np.ndarray: ...
150150

151151
## alpha_comp_shell
152152

153-
[Show source in blend.py:623](../../../blendmodes/blend.py#L623)
153+
[Show source in blend.py:626](../../../blendmodes/blend.py#L626)
154154

155155
Implement common transformations occurring in any blend or composite mode.
156156

pyproject.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ readme = "README.md"
2323
[tool.poetry.dependencies]
2424
python = ">=3.9,<4.0"
2525
Pillow = "<11,>=10.2.0"
26-
numpy = "<2,>=1.26.3"
26+
numpy = "<2,>=1.26.4"
2727
aenum = "<4,>=3.1.15"
2828

2929

3030
[tool.poetry.group.dev.dependencies]
3131
imgcompare = "^2.0.1"
32-
pytest = "^7.4.4"
32+
pytest = "^8.0.2"
3333
handsdown = "^2.1.0"
34-
coverage = "^7.4.0"
34+
coverage = "^7.4.3"
3535
ruff = "^0.1.13"
36-
blackt = "^2024.0.1"
37-
pyright = "^1.1.347"
36+
pyright = "^1.1.351"
3837

3938
[build-system]
4039
requires = ["poetry-core"]
@@ -64,9 +63,11 @@ fixable = ["ALL"]
6463
[tool.ruff.lint.per-file-ignores]
6564
"**/{tests,docs,tools}/*" = ["D", "S101", "E402"]
6665

67-
[tool.black]
68-
line-length = 100
69-
target-version = ["py38"]
66+
[tool.ruff.format]
67+
indent-style = "tab"
68+
docstring-code-format = true
69+
line-ending = "lf"
70+
7071

7172
[tool.pyright]
7273
venvPath = "."

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Pillow<11,>=10.2.0
22
aenum<4,>=3.1.15
3-
numpy<2,>=1.26.3
3+
numpy<2,>=1.26.4

0 commit comments

Comments
 (0)