-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathpyproject.toml
More file actions
296 lines (268 loc) · 8.25 KB
/
pyproject.toml
File metadata and controls
296 lines (268 loc) · 8.25 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "fromager"
authors = [
{ name = "Mark McLoughlin", email = "markmc@redhat.com" },
{ name = "Doug Hellmann", email = "dhellmann@redhat.com" },
]
description = "Wheel maker"
readme = "README.md"
dynamic = ["version"]
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Utilities",
]
requires-python = ">=3.12"
dependencies = [
"click>=8.1.7",
"elfdeps>=0.2.0",
"license-expression",
"packaging",
"psutil",
"pydantic",
"pypi_simple",
"pyproject_hooks>=1.0.0,!=1.1.0",
"PyYAML",
"rich",
"requests",
"resolvelib",
"requests-mock",
"starlette",
"stevedore",
"tomlkit",
"tqdm",
"wheel",
"uv>=0.8.19",
"uvicorn",
]
[project.optional-dependencies]
build = [
"build",
"twine",
]
mypy = [
"mypy",
"pytest",
"types-html5lib",
"types-psutil",
"types-PyYAML",
"types-requests",
"types-toml",
"types-tqdm",
]
test = [
"coverage[toml]!=4.4,>=4.0",
"pytest",
"requests-mock",
"spdx-tools",
"twine>=6.1.0",
"hatchling",
"hatch-vcs",
"click!=8.3.0",
"setuptools-scm",
]
docs = [
"sphinx",
"sphinx-click",
"myst-parser",
"sphinx-rtd-theme",
"autodoc-pydantic",
"sphinxcontrib.spelling",
]
[project.urls]
Repository = "https://github.com/python-wheel-build/fromager"
Documentation = "https://fromager.readthedocs.io/en/latest/"
[project.scripts]
fromager = "fromager.__main__:invoke_main"
[project.entry-points."fromager.override_methods"]
# override methods and their default implementations
get_build_system_dependencies = "fromager.dependencies:default_get_build_system_dependencies"
get_build_backend_dependencies = "fromager.dependencies:default_get_build_backend_dependencies"
get_build_sdist_dependencies = "fromager.dependencies:default_get_build_sdist_dependencies"
resolver_provider = "fromager.resolver:default_resolver_provider"
download_source = "fromager.sources:default_download_source"
build_sdist = "fromager.sources:default_build_sdist"
build_wheel = "fromager.wheels:default_build_wheel"
[project.entry-points."fromager.cli"]
bootstrap = "fromager.commands.bootstrap:bootstrap"
bootstrap-parallel = "fromager.commands.bootstrap:bootstrap_parallel"
build = "fromager.commands.build:build"
build-sequence = "fromager.commands.build:build_sequence"
build-parallel = "fromager.commands.build:build_parallel"
build-order = "fromager.commands.build_order:build_order"
find-updates = "fromager.commands.find_updates:find_updates"
graph = "fromager.commands.graph:graph"
lint = "fromager.commands.lint:lint"
list-overrides = "fromager.commands.list_overrides:list_overrides"
list-versions = "fromager.commands.list_versions:list_versions"
migrate-config = "fromager.commands.migrate_config:migrate_config"
minimize = "fromager.commands.minimize:minimize"
package = "fromager.commands.package:package"
stats = "fromager.commands.stats:stats"
step = "fromager.commands.step:step"
canonicalize = "fromager.commands.canonicalize:canonicalize"
download-sequence = "fromager.commands.download_sequence:download_sequence"
wheel-server = "fromager.commands.server:wheel_server"
lint-requirements = "fromager.commands.lint_requirements:lint_requirements"
[tool.coverage.run]
branch = true
parallel = true
relative_files = true
source = ["fromager", "tests/"]
[tool.coverage.paths]
source = ["src/fromager", ".hatch/**/site-packages/fromager"]
tests = ["tests/"]
[tool.coverage.report]
show_missing = true
skip_covered = true
exclude_lines = [
"pragma: no cover",
"@abc.abstractmethod",
"@typing.overload",
"if typing.TYPE_CHECKING",
]
[tool.hatch.version]
path = "src/fromager/version.py"
source = "vcs"
[tool.hatch.build.targets.wheel]
packages = ["src/fromager"]
[tool.ruff]
target-version = "py312"
# same as black's default line length
line-length = 88
exclude = [
"src/fromager/version.py", # file is generated dynamically, out of our control
]
[tool.ruff.lint]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
select = [
"B", # flake8-bugbear
"E", # pycodestyle
"F", # pyflakes
"Q", # flake8-quotes
"I", # isort
"N", # pep8-naming
"W", # pycodestyle
"RUF", # ruff-specific rules
"UP", # pyupgrade
"TID", # flake8-tidy-imports
]
ignore = [
"E501", # Line too long
"RUF005", # Consider iterable unpacking instead of concatenation
"TID252", # Prefer absolute imports over relative imports from parent modules
"UP015", # Unnecessary open mode parameters
]
[tool.ruff.lint.isort]
known-first-party = ["fromager"]
[tool.mypy]
mypy_path = ["src", "tests", "e2e"]
# TODO: tighten type checks
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
warn_return_any = true
# TODO: remove excludes and silent follow
follow_imports = "silent"
exclude = [
"^e2e/.*/build/.*$",
"^e2e/pyo3_test/.*$",
]
[[tool.mypy.overrides]]
# packages without typing annotations and stubs
module = ["hatchling", "hatchling.build", "license_expression", "pyproject_hooks", "requests_mock", "resolver", "spdx_tools.*", "stevedore"]
ignore_missing_imports = true
[tool.basedpyright]
reportUnannotatedClassAttribute = false
reportUnusedCallResult = false
reportUntypedFunctionDecorator = false
reportUnknownMemberType = false
reportUnusedParameter = false
reportAny = false
reportImplicitOverride = false
reportAttributeAccessIssue = false # adding our own private property on click commands
reportImplicitStringConcatenation = false
[tool.hatch.envs.default]
# No specific python version here, so it uses the active Python by default.
dependencies = []
[tool.hatch.envs.test]
features = ["test"]
# {args:tests} allows passing arguments to specify which tests to run
[tool.hatch.envs.test.scripts]
test = "python -m coverage run -m pytest --log-level DEBUG -vv {args:tests}"
coverage-erase = "coverage erase"
coverage-combine = "coverage combine"
coverage-report = ["coverage combine", "coverage report --format=markdown | tee coverage-report-$(date +%Y%m%d-%H%M%S).md"]
[tool.hatch.envs.lint]
description = "Run linters."
skip-install = true # Corresponds to skipping project installation for linting
features = ["build"]
dependencies = [
"ruff",
"packaging",
"check-python-versions",
"pre-commit"
]
[tool.hatch.envs.lint.scripts]
check = [
"ruff check src tests",
"ruff format --check src tests",
"python ./e2e/mergify_lint.py",
]
fix = [
"ruff format src tests docs",
"ruff check --fix src tests docs",
]
precommit = "pre-commit run --all-files"
install-hooks = "pre-commit install"
pkglint = [
"python -m build",
"twine check dist/*.tar.gz dist/*.whl",
"check-python-versions --only pyproject.toml,.github/workflows/test.yaml",
]
# Local pre-commit hook scripts
mergify = "python ./e2e/mergify_lint.py"
[tool.hatch.envs.e2e]
description = "Run end-to-end tests."
dependencies = ["coverage[toml]", "twine"]
env-vars.COVERAGE_PROCESS_START = "{root}/pyproject.toml"
[tool.hatch.envs.e2e.scripts]
# Script to create cov.pth for coverage in subprocesses
setup-cov = "python e2e/setup_coverage.py"
# Generic script to run any command in the e2e environment
# e.g. hatch run e2e:run ./e2e/test_bootstrap.sh
run = "{args}"
[tool.hatch.envs.mypy]
description = "Python type checking with mypy."
features = ["mypy"]
[tool.hatch.envs.mypy.scripts]
check = [
"mypy -p fromager",
"mypy tests/",
"mypy e2e/",
]
[tool.hatch.envs.docs]
description = "Sphinx docs."
features = ["docs"]
[tool.hatch.envs.docs.scripts]
build = "sphinx-build -M html docs docs/_build -j auto --keep-going {args:--fail-on-warning --fresh-env -n}"
[tool.pytest.ini_options]
markers = [
"network: test that need network access",
]