Skip to content

Commit 0d6494f

Browse files
committed
migrate from blackt to ruff format + bump deps
1 parent 22e8486 commit 0d6494f

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
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

layeredimage/io/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def openLayerImage(file: str | Path) -> LayeredImage:
4747
Returns:
4848
-------
4949
LayeredImage: a layered image object
50+
5051
"""
5152
functionMap = {
5253
".ora": openLayer_ORA,
@@ -87,6 +88,7 @@ def saveLayerImage(fileName: str | Path, layeredImage: LayeredImage) -> None:
8788
Returns:
8889
-------
8990
None
91+
9092
"""
9193
functionMap = {
9294
".ora": saveLayer_ORA,

layeredimage/layeredimage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(
2626
layersAndGroups (list[Layer, Group]): List of layers and groups
2727
dimensions (tuple[int, int], optional): dimensions of the canvas. Defaults to None.
2828
**kwargs (Any): add any keyword args to self.extras
29+
2930
"""
3031
# Write here
3132
self.layersAndGroups = layersAndGroups
@@ -145,6 +146,7 @@ def render(layerOrGroup: Layer | Group, project_image: np.ndarray) -> np.ndarray
145146
Returns:
146147
-------
147148
np.ndarray: Flattened image
149+
148150
"""
149151
if isinstance(layerOrGroup, Layer):
150152
return blendLayersArray(

layeredimage/layergroup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def __init__(
3737
Defaults to True.
3838
blendmode (Blendtype): The blending mode to use. Defaults to BlendType.NORMAL
3939
**kwargs (Any): add any keyword args to self.extras
40+
4041
"""
4142
self.name = name
4243
self.offsets = offsets
@@ -96,6 +97,7 @@ def __init__(
9697
is often configured per layer or per group by an 'eye' icon).
9798
Defaults to True.
9899
blendmode (Blendtype): The blending mode to use. Defaults to BlendType.NORMAL
100+
99101
"""
100102
super().__init__(
101103
name, (0, 0), offsets=offsets, opacity=opacity, visible=visible, blendmode=blendmode
@@ -149,6 +151,7 @@ def __init__(
149151
is often configured per layer or per group by an 'eye' icon).
150152
Defaults to True.
151153
blendmode (Blendtype): The blending mode to use. Defaults to BlendType.NORMAL
154+
152155
"""
153156
# Initialise dimens to 0 and then calculate as below
154157
super().__init__(

pyproject.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,18 @@ blendmodes = "<2026,>=2024.1"
2727
pylsr = "<2026,>=2024"
2828
pyora = "<2,>=0.3.11"
2929
pypdn = "<2,>=1.0.6"
30-
psd-tools = "<2,>=1.9.30"
30+
psd-tools = "<2,>=1.9.31"
3131
pillow = "<11,>=10.2.0"
3232
gimpformats = "<2025,>=2023.1"
3333
loguru = "<2,>=0.7.2"
3434

3535
[tool.poetry.group.dev.dependencies]
3636
imgcompare = "^2.0.1"
37-
pytest = "^7.4.4"
37+
pytest = "^8.0.2"
3838
handsdown = "^2.1.0"
39-
coverage = "^7.4.1"
39+
coverage = "^7.4.3"
4040
ruff = "^0.1.13"
41-
blackt = "^2024.0.1"
42-
pyright = "^1.1.348"
41+
pyright = "^1.1.351"
4342

4443
[build-system]
4544
requires = ["poetry-core"]
@@ -67,9 +66,11 @@ fixable = ["ALL"]
6766
[tool.ruff.lint.per-file-ignores]
6867
"**/{tests,docs,tools}/*" = ["D", "S101", "E402"]
6968

70-
[tool.black]
71-
line-length = 100
72-
target-version = ["py38"]
69+
[tool.ruff.format]
70+
indent-style = "tab"
71+
docstring-code-format = true
72+
line-ending = "lf"
73+
7374

7475
[tool.pyright]
7576
venvPath = "."

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ blendmodes<2026,>=2024.1
22
gimpformats<2025,>=2023.1
33
loguru<2,>=0.7.2
44
pillow<11,>=10.2.0
5-
psd-tools<2,>=1.9.30
5+
psd-tools<2,>=1.9.31
66
pylsr<2026,>=2024
77
pyora<2,>=0.3.11
88
pypdn<2,>=1.0.6

0 commit comments

Comments
 (0)