-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
317 lines (278 loc) · 7.19 KB
/
pyproject.toml
File metadata and controls
317 lines (278 loc) · 7.19 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
[project]
name = "pan-airs-api-mgmt-sdk"
description = "Palo Alto Networks Prisma AIRS Runtime API Management SDK"
requires-python = ">=3.10"
authors = [
{name = "Palo Alto Networks AI Runtime Security SDK Team", email = "dl-airs-api-sdk@paloaltonetworks.com"},
]
License-Expression = "LicenseRef-PolyForm-Internal-Use-License-1.0.0"
License-File = [
"LICENSE"
]
readme = "README.md"
keywords = [
"PaloAltoNetworks",
"Prisma AIRS",
"Palo Alto Networks",
"AI Security",
"AI Runtime Security",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: Other/Proprietary License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Typing :: Typed",
]
dynamic = [
"version",
]
dependencies = [
"aiodns>=1.1",
"aiohttp ~= 3.11",
"aiohttp-retry ~= 2.9",
"urllib3>=2.1.0,<3.0.0",
"python-dateutil>=2.8.2",
"pydantic>=2",
"truststore>=0.9.1",
"typing-extensions>=4.7.1",
]
[dependency-groups]
dev = [
"coverage-enable-subprocess>=1.0",
"coverage[toml]",
"mypy>=1.5",
"pytest-asyncio>=1.0.0",
"pytest-cov>=6.0",
"pytest-mock>=3.14.1",
"pytest-randomly>=3.16.0",
"pytest-rerunfailures>=15.1",
"pytest-timeout>=2.3.1",
"pytest-xdist[psutil]>=3.7.0",
"pytest>=8.3.5",
"python-dotenv>=1.2.1",
"readme-renderer[md]>=44.0",
"requests>=2.31.0",
"types-python-dateutil>=2.8.19.14",
"truststore>=0.10.1; python_full_version >= '3.10'",
]
ci = [
"google-auth>=2.45.0",
"hatch>=1.16.2",
"hatchling>=1.28.0",
"httpx[http2]>=0.28.1",
"packaging>=25.0",
"rich>=14.2.0",
"truststore>=0.10.4",
"versioningit>=3.3.0",
]
[project.urls]
Homepage = "https://www.paloaltonetworks.com/prisma/prisma-ai-runtime-security"
Documentation = "https://pan.dev/ai-runtime-security/scan/api/"
source = "https://github.com/paloaltonetworks/airs-api-mgmt-sdk"
###########################
# Build System: Hatchling #
###########################
[build-system]
requires = [
"hatchling",
"versioningit",
]
build-backend = "hatchling.build"
# Define sdist package includes/excludes
[tool.hatch.build.targets.sdist]
ignore-vcs = true
only-include = [
"src/airs_api_mgmt/",
"README.md",
"CHANGELOG.md",
"py.typed",
]
exclude = [
".openapi-generator",
"__pycache__",
".ruff_cache",
".mypy_cache",
".pytest_cache",
".coverage*",
"*.pyc",
"*.log",
"*.tmp",
]
# Define wheel package includes/excludes
[tool.hatch.build.targets.wheel]
packages = [
"src/airs_api_mgmt"
]
# Hatch/versioningit dynamically reads build version from git tags
[tool.hatch.version]
source = "versioningit"
# Use UV with Hatch for dependency management (instead of virtualenv/pip) in all environments
[tool.hatch.envs.default]
installer = "uv"
# Use optional dependencies in test environments
features = []
#
# Automatic Versioning using Git Tags
# https://versioningit.readthedocs.io/en/stable/index.html
#
[tool.versioningit.next-version]
method = "smallest-release"
[tool.versioningit.format]
distance = "{next_version}.dev{distance}+{rev}"
# Example formatted version: 1.2.4.dev42+ge174a1f
dirty = "{base_version}+d{build_date:%Y%m%d}"
# Example formatted version: 1.2.3+d20230922
distance-dirty = "{base_version}.dev{distance}+{rev}.d{build_date:%Y%m%d}"
# Example formatted version: 1.2.4.dev42+ge174a1f.d20230922
[tool.versioningit.write]
file = "src/airs_api_mgmt/_version.py"
[tool.hatch.build.hooks.versioningit-onbuild]
source-file = "src/airs_api_mgmt/_version.py"
build-file = "airs_api_mgmt/_version.py"
require-match = false
append-line = "__version__ = \"{version}\""
##########################
# PyTest - Code Coverage #
##########################
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = "-ra -q --ignore=tests/integration_tests"
testpaths = [
"tests",
"examples",
]
markers = [
"integration: marks tests as integration tests (deselected by default)",
]
#########################
# Code Test Coverage #
#########################
# $ hatch test
[tool.hatch.envs.hatch-test]
extra-args = []
randomize = true
parallel = true
features = []
# Defaults
# https://hatch.pypa.io/latest/config/internal/testing/#scripts
[tool.hatch.envs.hatch-test.scripts]
run = "pytest{env:HATCH_TEST_ARGS:} {args}"
run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}"
cov-combine = "coverage combine"
cov-report = "coverage report"
pip = "{env:HATCH_UV} pip {args}"
[[tool.hatch.envs.hatch-test.matrix]]
# https://devguide.python.org/versions/
python = [
"3.11",
"3.12",
"3.13",
"3.14",
]
[tool.hatch.envs.full-test.scripts]
coverage = "pytest --cov --cov-report=term-missing --cov-config=pyproject.toml"
#########################################
# coverage.py - Code Coverage Reporting #
#########################################
#
# https://coverage.readthedocs.io/en/latest/config.html
#
[tool.coverage.run]
command_line = "-m pytest"
data_file = ".cache/.coverage"
branch = true
parallel = true
concurrency = ["thread", "multiprocessing"]
sigterm = true
source = [
"src/",
"tests/",
]
[tool.coverage.paths]
# The entries in this section are lists of file paths that should be considered
# equivalent when combining data from different machines
airs_api_mgmt = ["src/airs_api_mgmt"]
tests = ["tests"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
########################
# MyPy - Type Checking #
########################
[tool.hatch.envs.mypy]
# Use dev dependencies in mypy environment
features = []
[tool.hatch.envs.mypy.scripts]
check = "mypy --no-install-types airs_api_mgmt tests"
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = [
"src/",
"tests/",
]
strict = true
show_error_context = true
show_error_code_links = true
pretty = true
# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
## Getting these passing should be easy
strict_equality = true
## Strongly recommend enabling this one as soon as you can
check_untyped_defs = true
## These shouldn't be too much additional work, but may be tricky to
## get passing if you use a lot of untyped libraries
disallow_subclassing_any = true
disallow_untyped_decorators = true
disallow_any_generics = true
#disallow_incomplete_defs = true
#disallow_untyped_defs = true
# Disable impossibly strict configs
implicit_reexport = true
disallow_untyped_calls = false
disable_error_code = ["import-untyped", "no-untyped-def"]
warn_return_any = false
#############################
# Bandit - Security Linting #
#############################
[tool.bandit]
exclude_dirs = [
".cache",
".venv",
"bin",
"dist",
"reports",
"tests",
"venv",
]
skips = [
"B104",
]
#############################
# Ruff - Linting & Formatting #
#############################
[tool.ruff]
exclude = [
"src/airs_api_mgmt/sdk/models",
"tests/sdk/models"
]
#############################
# UV - Package Management #
#############################
[tool.uv]
required-version = ">=0.9.17"
default-groups = [
"dev",
]
[[tool.uv.index]]
url = "https://pypi.org/simple/"
default = true