-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
132 lines (115 loc) · 3.18 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "pre_commit_images"
description = "Image optimization and manipulation with hooks for pre-commit."
authors = [
{ name="Raphael Boidol", email="[email protected]" },
]
urls = {"Respository" = "https://github.com/boidolr/pre-commit-images"}
license = {file = "LICENSE"}
readme = "README.md"
version = "1.8.4"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
]
requires-python = ">=3.10,<4"
dependencies = [
"pillow==11.1.0",
]
[project.optional-dependencies]
avif = [
"pillow-avif-plugin==1.4.6",
]
svg = [
"scour==0.38.2",
]
dev = [
"pre-commit",
"ruff",
"tox",
"tox-uv",
]
tests = [
"pytest",
"pytest-clarity",
"pytest-ruff",
"pytest-mypy",
]
[project.scripts]
optimize-avif = "pre_commit_images.optimize_avif:main"
optimize-jpg = "pre_commit_images.optimize_jpg:main"
optimize-png = "pre_commit_images.optimize_png:main"
optimize-svg = "pre_commit_images.optimize_svg:main"
optimize-webp = "pre_commit_images.optimize_webp:main"
resize = "pre_commit_images.resize:main"
[tool.setuptools]
packages = ["pre_commit_images"]
[tool.ruff]
line-length = 120
fix = true
[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", "W", # Pycodestyle
"UP", # pyupgrade
"FURB", # refurb
"S", # flake8-bandit
"C4", # flake8-comprehensions
"G", # flake8-logging-format
"ANN", # flake8-annotations
# "ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"PT", # flake8-pytest-style
"RET", # flake8-return
"PTH", # flake8-use-pathlib
"TID252", # flake8-tidy-imports (relative-imports)
"PERF", # Perflint
"FLY", # flynt
"I", # isort
"RUF100" # Unneeded noqa
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["S101"]
[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true
[tool.ruff.lint.isort]
force-single-line = true
order-by-type = false
[tool.mypy]
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
no_implicit_optional = true
ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = "--mypy --ruff"
filterwarnings = [
"error",
]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[tool.tox]
requires = ["tox>=4.19", "tox-uv>=1.19.1"]
envlist = ["py310", "py311", "py312", "py313", "pre-commit"]
isolated_build = true
[tool.tox.env_run_base]
description = "Run test under {base_python}"
commands = [["pytest", { replace = "posargs", default = ["tests"], extend = true }]]
extras = ["tests", "svg", "avif"]
runner = "uv-venv-lock-runner"
uv_sync_flags = ["--no-editable"]
[tool.tox.env.pre-commit]
description = "run commit hooks on code base"
skip_install = true
deps = ["pre-commit"]
commands = [["pre-commit", "run", "--all-files"]]
runner = "virtualenv"
[tool.tox.env.static]
commands = [["pytest", "--ignore", "tests"]]