forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pants.toml
242 lines (208 loc) · 7.57 KB
/
pants.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
[GLOBAL]
print_stacktrace = true
# Enable our custom loose-source plugins.
pythonpath = ["%(buildroot)s/pants-plugins"]
backend_packages.add = [
"pants.backend.build_files.fix.deprecations",
"pants.backend.build_files.fmt.black",
"pants.backend.python",
"pants.backend.experimental.python.packaging.pyoxidizer",
"pants.backend.python.lint.autoflake",
"pants.backend.python.lint.black",
"pants.backend.python.lint.docformatter",
"pants.backend.python.lint.flake8",
"pants.backend.python.lint.isort",
"pants.backend.python.typecheck.mypy",
"pants.backend.python.lint.pyupgrade",
"pants.backend.python.mixed_interpreter_constraints",
"pants.backend.shell",
"pants.backend.shell.lint.shellcheck",
"pants.backend.shell.lint.shfmt",
"pants.backend.docker",
"pants.backend.docker.lint.hadolint",
"pants.backend.experimental.adhoc",
"pants.backend.experimental.go",
"pants.backend.experimental.java",
"pants.backend.experimental.java.lint.google_java_format",
"pants.backend.experimental.java.debug_goals",
"pants.backend.experimental.javascript",
"pants.backend.experimental.javascript.lint.prettier",
"pants.backend.experimental.python",
"pants.backend.experimental.python.packaging.pyoxidizer",
"pants.backend.experimental.scala",
"pants.backend.experimental.scala.lint.scalafmt",
"pants.backend.experimental.scala.lint.scalafix",
"pants.backend.experimental.scala.debug_goals",
"pants.backend.experimental.tools.workunit_logger",
"pants.backend.experimental.visibility",
"pants.backend.tools.preamble",
"pants.backend.tools.taplo",
"pants_explorer.server",
"internal_plugins.releases",
"internal_plugins.test_lockfile_fixtures",
]
plugins = [
"hdrhistogram", # For use with `--stats-log`.
]
# The invalidation globs cover the PYTHONPATH by default, but we exclude some files that are on the
# path but not consumed by python, and additionally add the rust code.
pantsd_invalidation_globs.add = [
"!*_test.py",
"!BUILD",
"!src/python/pants_release/**",
# NB: The `target` directory is ignored via `pants_ignore` below.
"src/rust/engine/**/*.rs",
"src/rust/engine/**/*.toml",
]
# Path patterns to ignore for filesystem operations on top of the builtin patterns.
pants_ignore.add = [
# venv directories under build-support.
"/build-support/*.venv/",
# We shouldn't walk or watch the rust compiler artifacts because it is slow.
"/src/rust/engine/target",
# We want to .gitignore Java .class files, but pants should pay attention to them.
"!*.class",
# We also want to override the .gitignore'd pants.pex file
"!/pants.pex",
# Ignore node modules for docs processing tools
"/docs/node_modules",
# We have Pants stuff in here
"!.github/",
"!/src/rust/engine/.cargo",
]
build_ignore.add = [
# Disable Go targets by default so Pants developers do not need Go installed.
"testprojects/src/go/**",
]
unmatched_build_file_globs = "error"
# TODO: We would like to be able to use `validate` or `defer` here, but further hardening of
# network codepaths is needed. See:
# https://github.com/pantsbuild/pants/issues/16096.
cache_content_behavior = "fetch"
[DEFAULT]
# Tell `scie-pants` to use our `./pants` bootstrap script.
delegate_bootstrap = true
[anonymous-telemetry]
enabled = true
repo_id = "7775F8D5-FC58-4DBC-9302-D00AE4A1505F"
[cli.alias]
--all-changed = "--changed-since=HEAD --changed-dependents=transitive"
[source]
root_patterns = [
"src/*",
"test/*",
"tests/*",
"3rdparty/*",
"/build-support/bin",
"/build-support/flake8",
"/build-support/migration-support",
"/pants-plugins",
# For `conftest.py`
"/",
]
[environments-preview.names]
# We don't define any local environments because the options system covers our cases adequately.
docker = "//:docker_env"
# Used for iterating on remote-execution.
remote = "//:buildgrid_remote"
[tailor]
build_file_header = """\
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""
ignore_paths = ["build-support/migration-support/BUILD"]
ignore_adding_targets = [
"src/python/pants:__main__",
"src/python/pants/backend/docker/subsystems:dockerfile_wrapper_script",
"src/python/pants/backend/python/dependency_inference/scripts:dependency_parser0",
"src/python/pants/backend/terraform:hcl2_parser0",
]
[update-build-files]
# We use `pants.backend.build_files.fmt.black`
fmt = false
[pex]
venv_use_symlinks = true
# This is off by default, but we want to dogfood it before switching on for everyone.
emit_warnings = true
[python]
# N.B.: When upgrading to a new Python version, you must update the Pants
# `python_distribution` targets, currently:
# + src/python/pants:pants-packaged
# + src/python/pants/testutil:testutil_wheel
# And update the PythonBuildStandalone version/URL:
# + src/python/pants/core/subsystems/python_bootstrap.py
interpreter_constraints = ["==3.9.*"]
macos_big_sur_compatibility = true
enable_resolves = true
pip_version = "latest"
[python.resolves]
python-default = "3rdparty/python/user_reqs.lock"
flake8 = "3rdparty/python/flake8.lock"
mypy = "3rdparty/python/mypy.lock"
pytest = "3rdparty/python/pytest.lock"
[python-infer]
assets = true
unowned_dependency_behavior = "error"
[docformatter]
args = ["--wrap-summaries=100", "--wrap-descriptions=100"]
[flake8]
config = "build-support/flake8/.flake8"
source_plugins = ["build-support/flake8"]
install_from_resolve = "flake8"
requirements = ["//3rdparty/python:flake8"]
[shellcheck]
args = ["--external-sources"]
[shfmt]
# See https://github.com/mvdan/sh/blob/master/cmd/shfmt/shfmt.1.scd#printer-flags.
args = ["-i 2", "-ci", "-sr"]
[pytest]
args = ["--no-header", "-vv"]
execution_slot_var = "TEST_EXECUTION_SLOT"
install_from_resolve = "pytest"
requirements = ["//3rdparty/python:pytest"]
[test]
extra_env_vars = [
# TODO: These are exposed to tests in order to allow for python interpreter discovery when
# Pants-tests-Pants: in particular, the [python] subsystem consumes them.
# see https://github.com/pantsbuild/pants/issues/11638
"PYENV_ROOT",
"HOME",
"PATH",
# We'd always like complete backtraces in tests.
"RUST_BACKTRACE=1",
]
timeout_default = 60
[mypy]
install_from_resolve = "mypy"
requirements = ["//3rdparty/python:mypy"]
[coverage-py]
interpreter_constraints = ["==3.9.*"]
[preamble]
template_by_globs = "@build-support/preambles/config.yaml"
[generate-lockfiles]
diff = true
[pyupgrade]
args = ["--keep-runtime-typing", "--py38-plus"]
[jvm]
default_resolve = "jvm_testprojects"
[jvm.resolves]
# A shared resolve for all testproject/example code. Because this is not shipped with Pants
# binaries, it requires no isolation.
jvm_testprojects = "3rdparty/jvm/testprojects.lockfile"
# A resolve for the java_parser, which is shipped with Pants, and invoked with its own isolated
# classpath. Consequently, we isolate it to its own lockfile.
# Note: The jvm_artifact targets in this resolve must be kept in sync with the requirements
# in `generate_java_parser_lockfile_request`.
java_parser_dev = "src/python/pants/backend/java/dependency_inference/java_parser.lock"
# Has the same isolation requirements as `java_parser`.
# Note: The jvm_artifact targets in this resolve must be kept in sync with with the requirements
# in `generate_scala_parser_lockfile_request`.
scala_parser_dev = "src/python/pants/backend/scala/dependency_inference/scala_parser.lock"
strip_jar_dev = "src/python/pants/jvm/strip_jar/strip_jar.lock"
jar_tool_dev = "src/python/pants/jvm/jar_tool/jar_tool.lock"
[scala]
version_for_resolve = { "scala_parser_dev" = "2.13.8" }
[scalac]
args = ["-Yrangepos", "-Xlint:unused"]
[scala-infer]
force_add_siblings_as_dependencies = false