forked from sigstore/model-transparency
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
226 lines (196 loc) · 5.67 KB
/
pyproject.toml
File metadata and controls
226 lines (196 loc) · 5.67 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
[build-system]
requires = ["hatchling>=1.27"]
build-backend = "hatchling.build"
[project]
name = "rh-model-signing"
dynamic = ["version"]
description = "A tool for signing and verifying ML models (Red Hat Tech Preview)"
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
authors = [
{ name = "Sigstore Authors", email = "sigstore-dev@googlegroups.com" }
]
maintainers = [
{ name = "Aleksy Siek", email = "asiek@redhat.com" },
{ name = "Kevin Conner", email = "kconner@redhat.com" },
{ name = "Nina Bongartz", email = "nolear@redhat.com" },
{ name = "Sachin Sampras", email = "sacm@redhat.com" },
]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Security",
"Topic :: Security :: Cryptography",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
dependencies = [
"asn1crypto",
"blake3",
"click",
"cryptography",
"in-toto-attestation",
"oras>=0.2.30",
"sigstore>=4.2",
"sigstore-models>=0.0.5",
"typing_extensions",
]
requires-python = ">=3.10"
keywords = [
"machine learning",
"artificial intelligence",
"model signing",
"AI security",
"ML security",
"AI supply chain security",
"ML supply chain security",
]
[project.optional-dependencies]
pkcs11 = [
"PyKCS11",
]
otel = [
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-distro",
"opentelemetry-instrumentation",
"opentelemetry-instrumentation-urllib3",
"opentelemetry-exporter-otlp",
]
[project.scripts]
model_signing = "model_signing._cli:main"
rh_model_signing = "model_signing._cli:main"
[project.urls]
Homepage = "https://pypi.org/project/rh-model-signing/"
Changelog = "https://github.com/securesign/model-transparency/blob/main/CHANGELOG.md"
Documentation = "https://github.com/securesign/model-transparency"
Source = "https://github.com/securesign/model-transparency"
Issues = "https://github.com/securesign/model-transparency/issues"
PyPI = "https://pypi.org/project/rh-model-signing/"
[tool.hatch.version]
path = "src/model_signing/__init__.py"
[tool.hatch.build]
packages = ["src/model_signing"]
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.envs.hatch-test]
installer = "pip"
parallel = true
randomize = true
extra-args = ["-m", "not integration"]
features = [
"pkcs11",
]
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
[tool.hatch.envs.bench]
description = """Custom environment for running benchmarks.
Use `hatch run +py=3... bench:generate ${args}` to generate test models.
Use `hatch run +py=3... bench:serialize ${args}` to benchmark serialization code.
Use `hatch run +py=3... bench:hash ${args}` to benchmark hashing code.
Use `hatch run +py=3... bench:chunk ${args}` to benchmark the chunk size parameter.
"""
extra-dependencies = [
"numpy",
"psutil",
"py-cpuinfo",
]
[[tool.hatch.envs.bench.matrix]]
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
[tool.hatch.envs.bench.scripts]
generate = "python benchmarks/generate.py {args}"
serialize = "python benchmarks/serialize.py {args}"
hash = "python benchmarks/exp_hash.py {args}"
chunk = "python benchmarks/exp_chunk.py {args}"
[tool.hatch.envs.docs]
description = """Custom environment for pdoc.
Use `hatch run docs:serve` to view documentation.
"""
extra-dependencies = [
"pdoc"
]
[tool.hatch.envs.docs.scripts]
serve = "pdoc model_signing --docformat google --edit-url model_signing=https://github.com/securesign/model-transparency/blob/main/src/model_signing/ {args}"
build = "serve --output-directory html"
[tool.hatch.envs.type]
description = """Custom environment for pytype.
Use `hatch run type:check` to check types.
"""
extra-dependencies = [
"py-cpuinfo",
"pytest",
"pytype",
]
features = [
"pkcs11",
]
installer = "pip"
python = "3.12"
[tool.hatch.envs.type.scripts]
check = "pytype -k -j auto src tests benchmarks"
[tool.hatch.envs.hatch-static-analysis]
config-path = "none"
[tool.hatch.envs.hatch-static-analysis.scripts]
format-check = "ruff format --check src/"
format-fix = "ruff format src/"
lint-check = "ruff check src/"
lint-fix = "ruff check --fix src/"
[tool.hatch.envs.cli]
description = """Custom environment for CLI tests.
Use `hatch run cli:test` to run CLI tests.
"""
features = [
"pkcs11",
]
[tool.hatch.envs.cli.scripts]
test = "bash ./scripts/tests/testrunner"
[tool.coverage.report]
exclude_also = [
"pass",
"return NotImplemented",
]
omit = ["tests/*"]
show_missing = true
skip_covered = true
skip_empty = true
# Add support for testing via the old `pytest .` way, too.
[tool.pytest.ini_options]
markers = [
"integration: mark a test as an integration test.",
]
pythonpath = "src"
[tool.ruff]
line-length = 80
exclude = [
"docs/demo.ipynb",
]
[tool.ruff.format]
docstring-code-format = true
line-ending = "lf"
skip-magic-trailing-comma = true
[tool.ruff.lint]
select = ["B", "D", "E", "F", "I", "N", "PLC", "PLE", "PT", "SIM", "UP", "W"]
ignore = [
"PLC0415", # Intentional lazy imports for optional dependencies
]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
[tool.ruff.lint.isort]
force-single-line = true
force-sort-within-sections = true
lines-after-imports = 2
single-line-exclusions = ["collections.abc", "typing"]
[tool.ruff.lint.pep8-naming]
ignore-names = ["TestOneInput"]
[tool.ruff.lint.pydocstyle]
convention = "google"