-
Notifications
You must be signed in to change notification settings - Fork 154
/
Copy pathpyproject.toml
284 lines (251 loc) · 6.81 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
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "safety"
version = "3.2.14"
description = "Scan dependencies for known vulnerabilities and licenses."
keywords = ["safety", "vulnerabilities", "dependencies", "licenses", "scan"]
readme = "README.md"
authors = [
{name = "Safety", email = "cli@safetycli.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Topic :: Security",
"Natural Language :: English",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"Intended Audience :: Telecommunications Industry",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.8"
dependencies = [
"Authlib>=1.2.0",
"Click>=8.0.2", # Just to set a minimum version, Typer works with >=8.0.0
"dparse>=0.6.4",
"filelock~=3.16.1",
"jinja2>=3.1.0",
"marshmallow>=3.15.0", # TODO: To be removed
"packaging>=21.0",
"psutil~=6.1.0",
"pydantic>=2.6.0,<2.10.0",
"requests", # TODO: To be replaced by httpx or aiohttp
"ruamel.yaml>=0.17.21",
"safety-schemas==0.0.10",
# TODO: To be removed after migrate away from pkg_resources
"setuptools>=65.5.1",
"typer>=0.12.1",
"typing-extensions>=4.7.1",
]
license = "MIT"
license-files = ["LICENSES/*"]
[project.urls]
homepage = "https://safetycli.com"
source = "https://github.com/pyupio/safety"
issues = "https://github.com/pyupio/safety/issues"
changelog = "https://github.com/pyupio/safety/blob/main/CHANGELOG.md"
documentation = "https://docs.safetycli.com/safety-docs"
[project.optional-dependencies]
github = [
"pygithub>=1.43.3"
]
gitlab = [
"python-gitlab>=1.3.0"
]
spdx = [
"spdx-tools>=0.8.2"
]
[project.scripts]
safety = "safety.cli:cli"
# Build specific configurations
[tool.hatch.build.targets.sdist]
only-include = [
"CHANGELOG.md",
"README.md",
"SECURITY.md",
"LICENSES/*",
"safety",
"tests",
"pyproject.toml"
]
[tool.hatch.build.targets.wheel]
packages = [
"safety"
]
include-package-data = true
zip-safe = false
# Tool specific configurations
## Hatch environments
[tool.hatch.envs.default]
installer = "uv"
type = "virtual"
# This should always be set to the minimum supported Python version.
# To test with a different version, modify this value, refresh
# the environment, and run it via the VSCode launch configuration
# (it will pick up the new interpreter).
#
# To reset the default environment, run:
# hatch env remove
# hatch env create
python = "3.8"
path = ".hatch"
dependencies = [
"coverage[toml]>=6.0",
"pytest==8.3.4",
"pyinstaller==6.11.1",
"commitizen",
"tomli"
]
# Common scripts used across environments
[tool.hatch.envs.default.scripts]
bump = "cz bump --check-consistency --yes --changelog --gpg-sign --annotated-tag --annotated-tag-message 'Version $(hatch version)'"
beta-bump = "cz bump -pr beta --check-consistency --yes --changelog --gpg-sign --annotated-tag --annotated-tag-message 'Version $(hatch version)'"
local-bump = "cz bump {args} --files-only --yes"
binary-dist = "python --version && python -m PyInstaller safety.spec {args}"
[tool.hatch.envs.test]
installer = "uv"
type = "container"
[tool.hatch.envs.test.scripts]
test = 'pytest -m "" {args:tests}'
test-cov = 'coverage run -m pytest -m "" {args:tests}'
cov-report = [
"coverage combine",
"coverage report --show-missing",
]
cov = [
"test-cov",
"cov-report",
]
[tool.hatch.envs.test.overrides]
matrix.targets.dependencies = [
# { value = "pydantic==2.6.0", if = ["pydantic-minimal"] },
{ value = "pydantic~=2.9.0", if = ["pydantic-latest"] },
{ value = "typer==0.12.1", if = ["typer-minimal"] },
{ value = "Click==8.0.2", if = ["typer-minimal"] },
{ value = "typer~=0.13", if = ["typer-latest"] },
{ value = "Click~=8.1", if = ["typer-latest"] }
]
# Prevent running the OS specific tests locally
matrix.os_type.scripts = [
{ key = "test", value = "echo Skipped", env = ["REMOTE_CONTAINERS=true"]},
{ key = "test-cov", value = "echo Skipped", env = ["REMOTE_CONTAINERS=true"]},
{ key = "cov-report", value = "echo Skipped", env = ["REMOTE_CONTAINERS=true"]},
{ key = "cov", value = "echo Skipped", env = ["REMOTE_CONTAINERS=true"]}
]
# Note: scripts/matrix.py is used to generate the matrix for
# the GitHub CI workflow, the script is very naive and a switch in the
# order of the matrixes can cause the script to fail.
# This was pragmatic to avoid having to maintain the matrix in two places.
#
# Make sure to update the script if you structural changes to the matrixes.
# Examples:
# * Add/Remove python versions is okay.
# * Add/Remove targets is okay.
# * Reorder matrixes is not okay.
#
[[tool.hatch.envs.test.matrix]]
# Full Python version testing
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
# Critical dependency testing only on boundary versions
[[tool.hatch.envs.test.matrix]]
python = [
"3.8", "3.13"
]
targets = [
"typer-minimal",
# "pydantic-minimal",
"pydantic-latest",
"typer-latest"
]
# Critical tests for OS compatibility
# This only runs on GitHub CI
[[tool.hatch.envs.test.matrix]]
python = [
"3.8", "3.13"
]
targets = [
"typer-latest"
]
os_type = [
"ubuntu-24.04",
"windows-2019",
"macos-14",
]
# Choose what config should be used for the artifacts build
[tool.project.build.artifacts]
python = "3.13"
package_os_type = "ubuntu-24.04"
targets = [
"typer-latest"
]
os_type = [
"ubuntu-24.04",
"windows-2019",
"macos-14"
]
[tool.hatch.envs.lint]
detached = true
dependencies = [
"ruff",
]
[tool.hatch.envs.lint.scripts]
typing = "pyright"
style = [
"ruff check {args:.}",
"ruff format --check --diff {args:.}",
]
fmt = [
"ruff format {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.pyright]
include = [
"safety/scan/"
]
pythonVersion = "3.8"
pythonPlatform = "All"
reportMissingImports = "error"
reportMissingTypeStubs = false
[tool.pytest.ini_options]
addopts = "--strict-markers"
markers = [
"basic: requires no extras",
]
[tool.coverage.run]
source_pkgs = ["safety"]
branch = true
parallel = true
omit = [
]
[tool.coverage.paths]
source = ["safety", "*/safety"]
[tool.coverage.report]
exclude_lines = [
]
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "pep621"
update_changelog_on_bump = false
annotated_tag = true
changelog_incremental = false
[tool.flake8]
exclude = ["docs"]