Skip to content

Commit ebc6f67

Browse files
committed
update pre-commit to work with safety
1 parent 62d66b3 commit ebc6f67

File tree

9 files changed

+115
-107
lines changed

9 files changed

+115
-107
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
downloads/
22
env*
3-
requirements_optional.txt
43
tests/data
54
sticker*.txt
65
sorted
76
perf.py
87
/*.tgs
9-
/test_*
108

11-
poetry.lock
9+
uv.lock
1210

1311
# Byte-compiled / optimized / DLL files
1412
__pycache__/

.pre-commit-config.yaml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.3.3
3+
rev: v0.9.6
44
hooks:
55
- id: ruff
66
args: [ --fix ]
77
- id: ruff-format
88

99
- repo: https://github.com/RobertCraigie/pyright-python
10-
rev: v1.1.354
10+
rev: v1.1.394
1111
hooks:
1212
- id: pyright
1313

14-
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
15-
rev: v1.3.3
14+
- repo: local
1615
hooks:
17-
- id: python-safety-dependencies-check
18-
files: pyproject.toml
16+
- id: generate requirements
17+
name: generate requirements
18+
entry: uv export --no-hashes --no-dev -o requirements.txt
19+
language: system
20+
pass_filenames: false
21+
- id: safety
22+
name: safety
23+
entry: uv run safety
24+
language: system
25+
pass_filenames: false
26+
- id: make docs
27+
name: make docs
28+
entry: uv run handsdown --cleanup -o documentation/reference
29+
language: system
30+
pass_filenames: false
31+
- id: build package
32+
name: build package
33+
entry: uv build
34+
language: system
35+
pass_filenames: false
36+
- id: pytest
37+
name: pytest
38+
entry: uv run pytest
39+
language: system
40+
pass_filenames: false
1941

2042
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v4.5.0
43+
rev: v5.0.0
2244
hooks:
2345
- id: trailing-whitespace
2446
- id: end-of-file-fixer
@@ -35,7 +57,7 @@ repos:
3557
- id: mixed-line-ending
3658

3759
- repo: https://github.com/boidolr/pre-commit-images
38-
rev: v1.5.2
60+
rev: v1.8.4
3961
hooks:
4062
- id: optimize-jpg
4163
- id: optimize-png

documentation/reference/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ A full list of `Tstickers` project modules.
1111
- [Convert](tstickers/convert.md#convert)
1212
- [Convert Pyrlottie](tstickers/convert_pyrlottie.md#convert-pyrlottie)
1313
- [Convert Rlottie Python](tstickers/convert_rlottie_python.md#convert-rlottie-python)
14-
- [Downloader](tstickers/downloader.md#downloader)
14+
- [Manager](tstickers/manager.md#manager)

documentation/reference/tstickers/cli.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,15 @@
66
77
- [Cli](#cli)
88
- [cli](#cli)
9-
- [is_library_installed](#is_library_installed)
109

1110
## cli
1211

13-
[Show source in cli.py:22](../../../tstickers/cli.py#L22)
12+
[Show source in cli.py:18](../../../tstickers/cli.py#L18)
1413

1514
Cli entry point.
1615

1716
#### Signature
1817

1918
```python
2019
def cli() -> None: ...
21-
```
22-
23-
24-
25-
## is_library_installed
26-
27-
[Show source in cli.py:18](../../../tstickers/cli.py#L18)
28-
29-
#### Signature
30-
31-
```python
32-
def is_library_installed(library_name: str) -> bool: ...
3320
```

documentation/reference/tstickers/convert.md

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
- [Convert](#convert)
88
- [Backend](#backend)
9-
- [assure_dir_exists](#assure_dir_exists)
109
- [convertAnimated](#convertanimated)
1110
- [convertAnimatedFunc](#convertanimatedfunc)
1211
- [convertStatic](#convertstatic)
@@ -26,33 +25,9 @@ class Backend(IntEnum): ...
2625

2726

2827

29-
## assure_dir_exists
30-
31-
[Show source in convert.py:38](../../../tstickers/convert.py#L38)
32-
33-
Make the directory if it does not exist.
34-
35-
#### Arguments
36-
37-
----
38-
- `parts` *Path* - path parts
39-
40-
#### Returns
41-
42-
-------
43-
- `Path` - the full path
44-
45-
#### Signature
46-
47-
```python
48-
def assure_dir_exists(*parts: Path | str) -> Path: ...
49-
```
50-
51-
52-
5328
## convertAnimated
5429

55-
[Show source in convert.py:106](../../../tstickers/convert.py#L106)
30+
[Show source in convert.py:90](../../../tstickers/convert.py#L90)
5631

5732
Convert animated stickers to webp, gif and png.
5833

@@ -110,7 +85,7 @@ def convertAnimatedFunc(
11085

11186
## convertStatic
11287

113-
[Show source in convert.py:75](../../../tstickers/convert.py#L75)
88+
[Show source in convert.py:58](../../../tstickers/convert.py#L58)
11489

11590
Convert static stickers to png and gif.
11691

@@ -135,7 +110,7 @@ def convertStatic(swd: Path, threads: int = 4) -> int: ...
135110

136111
## convertWithPIL
137112

138-
[Show source in convert.py:55](../../../tstickers/convert.py#L55)
113+
[Show source in convert.py:38](../../../tstickers/convert.py#L38)
139114

140115
Convert the webp file to png.
141116

documentation/reference/tstickers/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
- [Convert](./convert.md)
1616
- [Convert Pyrlottie](./convert_pyrlottie.md)
1717
- [Convert Rlottie Python](./convert_rlottie_python.md)
18-
- [Downloader](./downloader.md)
18+
- [Manager](./manager.md)

0 commit comments

Comments
 (0)