Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
137 lines (120 loc) · 4.16 KB
/
Copy pathpyproject.toml
File metadata and controls
137 lines (120 loc) · 4.16 KB
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
133
134
135
136
137
[build-system]
requires = ["hatchling>=1.27", "hatch-vcs"] # 1.27+ understands PEP 639
build-backend = "hatchling.build"
[project]
name = "sillybos"
# Derived from the git tag via hatch-vcs: release.yml computes each version
# from the commit history and tags it, so a literal here would be a second
# source of truth that nothing updates.
dynamic = ["version"]
description = "Decide before decoding: check that a file is a JPEG, PNG, TIFF or PDF within your limits before any image library or PDF renderer opens it"
readme = "README.md"
requires-python = ">=3.11"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Stephen Masters" },
{ name = "Yvette Mankerian" },
]
keywords = [
"security",
"image",
"pdf",
"ocr",
"scans",
"pillow",
"poppler",
"decompression-bomb",
"file-validation",
"archives",
"libraries",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Multimedia :: Graphics",
"Topic :: Security",
"Typing :: Typed",
]
# None. The check runs no decoder, so it needs none; the image headers are
# read with code of its own, and a PDF is asked about through poppler's
# pdfinfo in a separate process. A security library that pulled in the
# libraries it exists to guard would defeat itself.
dependencies = []
[project.optional-dependencies]
# open_checked: the check followed by Image.open with only the allowed readers.
pillow = ["pillow>=13.0"]
# The reference site at https://scattercode.github.io/sillybos/: the README,
# then the API and the command line from the docstrings (zensical.toml).
# mkdocstrings-python renders the docstrings; markdown-exec runs the parser
# for the command line page.
docs = ["zensical>=0.0.74", "mkdocstrings-python>=2.0", "markdown-exec>=1.12"]
dev = ["pytest>=8.0", "pytest-cov>=5.0", "ruff>=0.5", "mypy>=1.10", "pillow>=13.0"]
[project.scripts]
sillybos = "sillybos.cli:main"
[project.urls]
Homepage = "https://github.com/scattercode/sillybos"
Documentation = "https://scattercode.github.io/sillybos/"
Source = "https://github.com/scattercode/sillybos"
Changelog = "https://github.com/scattercode/sillybos/blob/main/CHANGELOG.md"
Issues = "https://github.com/scattercode/sillybos/issues"
Tetrak = "https://tetrak.dev/"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
# Writes the resolved version into the package at build time, so an installed
# copy can report it without git present. Generated, therefore gitignored.
version-file = "src/sillybos/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["src/sillybos"]
[tool.hatch.build.targets.sdist]
# The pointer packages are published on their own; keep them out of the sdist.
exclude = ["pointers"]
[tool.ruff]
line-length = 100
# Declared explicitly rather than left to ruff's defaults, which differ
# between ruff versions. Same arrangement as the sibling repositories, plus
# the S (bandit) rules: this is a security library, so its own code is held
# to them.
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # import sorting
"UP", # pyupgrade
"B", # bugbear
"RUF", # ruff's own: stale noqa, unsorted __all__, mutable class defaults
"S", # bandit: subprocess, asserts, unsafe parsers
]
ignore = [
# Line length is enforced by `ruff format`.
"E501",
]
[tool.ruff.lint.per-file-ignores]
# Tests assert, and build hostile files by hand.
"tests/**" = ["S101"]
[tool.ruff.lint.isort]
known-first-party = ["sillybos"]
[tool.mypy]
strict = true
files = ["src/sillybos", "tests", "scripts"]
mypy_path = "src"
[[tool.mypy.overrides]]
module = ["PIL", "PIL.*"]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.coverage.run]
source = ["sillybos"]
branch = true
[tool.coverage.report]
fail_under = 90
show_missing = true