-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpants.toml
More file actions
244 lines (206 loc) · 8.67 KB
/
Copy pathpants.toml
File metadata and controls
244 lines (206 loc) · 8.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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[GLOBAL]
pants_version = "2.32.0" # Use latest stable version
# Enable colors for better readability
colors = true
# Dynamic UI shows progress (disable in CI if needed)
dynamic_ui = true
# Streaming output for real-time feedback
streaming_workunits_report_interval = 1.0
# Enable backends for polyglot monorepo
backend_packages = [
# Python ecosystem
"pants.backend.python",
"pants.backend.experimental.python.lint.ruff.check",
"pants.backend.experimental.python.lint.ruff.format",
"pants.backend.python.typecheck.mypy",
# Go ecosystem (experimental)
"pants.backend.experimental.go",
"pants.backend.experimental.go.lint.golangci_lint",
# # Protobuf code generation
"pants.backend.codegen.protobuf.python",
"pants.backend.experimental.codegen.protobuf.go",
"pants.backend.codegen.protobuf.lint.buf",
# # Shell scripts
"pants.backend.shell",
"pants.backend.shell.lint.shellcheck",
"pants.backend.shell.lint.shfmt",
# # Docker coordination
"pants.backend.docker",
]
# Directories to ignore
pants_ignore = [
"/.git/",
"/.pants.d/",
"/dist/",
"/node_modules/",
"/__pycache__/",
"*.pyc",
"/.venv/",
"/.terraform/",
"/.pytest_cache/",
]
# Python configuration
[python]
# Match the interpreter production actually ships (the Dockerfile installs
# 3.14.x). Note `<=3.14` would NOT do that: under PEP 440, 3.14.5 > 3.14, so
# that bound excludes every 3.14 patch release and silently fell back to 3.13.
interpreter_constraints = [">=3.14,<3.15"]
enable_resolves = true
default_resolve = "stravapipe"
# Python dependency management
[python.resolves]
# Stravapipe package resolve - points to LOCKFILE, not source
stravapipe = "packages/stravapipe/stravapipe.lock"
# Exclude greenlet - only needed for async SQLAlchemy, we use sync psycopg
[python.resolves_to_constraints_file]
stravapipe = "build-support/constraints.txt"
# Interpreter discovery
[python-bootstrap]
# Pants only probes binaries named `python`/`python3` by default. On Homebrew
# `python3` is 3.13, so 3.14 is invisible without naming it explicitly.
names = ["python", "python3", "python3.14"]
# Go configuration
[golang]
minimum_expected_version = "1.26"
# Protobuf configuration
[python-protobuf]
# Generate .pyi stub files for mypy type checking
# Using modern generate_type_stubs (preferred over mypy_plugin)
generate_type_stubs = true
# Source root patterns
[source]
root_patterns = [
"/packages/*/src", # src-layout packages (stravapipe)
"/packages/*", # flat-layout packages
"/schemas",
"/scripts",
"/local-dev/containers/*",
]
# Python dependency inference
[python-infer]
# Automatically infer dependencies from imports
imports = true
string_imports = true
# Ruff linting configuration
[ruff]
# Use ruff config from stravapipe's pyproject.toml
config = "packages/stravapipe/pyproject.toml"
# Ruff is a downloaded binary, not a resolve entry, so it can't use
# `install_from_resolve` like pytest/mypy. Pin it by hand to the version in
# stravapipe.lock instead, otherwise `pants lint` (CI) and `uv run ruff`
# (local) report different diagnostics. Pants only ships hashes through
# 0.15.5, so anything newer needs its own `known_versions` rows —
# regenerate with `just ruff-hashes <version>` when this version moves.
version = "0.16.3"
known_versions = [
"0.16.3|linux_arm64 |8319ba22f655e6efc086103486d7165bf0de73f71ff1c5f25ba580153ad05feb|10411229",
"0.16.3|linux_x86_64|d67c9b5949981698c48915abf65e0b3406ba9184ad73521cdf20a926bc889c73|11225151",
"0.16.3|macos_arm64 |136a4db6512d9b16dda56ac8604696ed65c3b1a914a142de029e7f8d5006f1d9|9944235",
"0.16.3|macos_x86_64|05c2a6705e7c0c056d6d93ff538978583f0c47b4c28d334ab9d58d2e8daf4c24|10742637",
]
# Mypy type checking configuration
[mypy]
# Use mypy config from stravapipe's pyproject.toml
config = "packages/stravapipe/pyproject.toml"
# Type-check with the mypy pinned in the resolve rather than Pants' bundled
# one, so `pants check` (CI) and `uv run mypy` (local) agree, and dependency
# updates to mypy actually reach CI.
install_from_resolve = "stravapipe"
requirements = ["mypy"]
# Shell formatting
[shfmt]
# MUST match the flags in `just sh-format` / `sh-format-check`
# (justfiles/scripts.just: `shfmt -i 2 -ci`), which CI's Validation job runs.
# Any divergence makes the two formatters fight: shfmt defaults to tabs (repo
# uses 2-space, hence `-i 2`), and without `-ci` Pants strips the case-body
# indentation that `just sh-format` adds, so each tool "fixes" the other's
# output and `pants fmt`/`lint` reports perpetual changes.
args = ["-i", "2", "-ci"]
# golangci-lint configuration
[golangci-lint]
# golangci-lint only supports Go versions <= the Go it was *built with*, so this
# has to move with the toolchain: 2.12.2 is built with go1.26.2. On an older
# golangci-lint, loading go1.26 stdlib sources panics with
# "file requires newer Go version go1.26 (application built with go1.25)".
# Regenerate `known_versions` below with `just golangci-hashes <version>`.
version = "2.12.2"
# Allow using a version not in Pants' built-in list
use_unsupported_version = "warning"
# URL template for downloading golangci-lint
url_template = "https://github.com/golangci/golangci-lint/releases/download/v{version}/golangci-lint-{version}-{platform}.tar.gz"
# Map Pants platform names to golangci-lint platform names (inline table must be single line)
url_platform_mapping = { "macos_x86_64" = "darwin-amd64", "macos_arm64" = "darwin-arm64", "linux_x86_64" = "linux-amd64", "linux_arm64" = "linux-arm64" }
# Tell Pants how to download this version (Pants 2.32 only ships hashes to 2.7.1)
known_versions = [
"2.12.2|macos_x86_64|f6f06d94b6241521c53d15450c5209b028270bf966f842afb11c030c79f5bc16|15391537",
"2.12.2|macos_arm64|a9c54498731b3128f79e090be6110f3e5fffccc617b08142ed244d4126c73f29|14354152",
"2.12.2|linux_x86_64|8df580d2670fed8fa984aac0507099af8df275e665215f5c7a2ae3943893a553|15022786",
"2.12.2|linux_arm64|44cd40a8c76c86755375adfeea52cfd3533cb43d7bd647771e0ae065e166df3a|13672880",
]
# If there's a .golangci.yml config file, it will be used automatically
# args = [] # Custom args if needed
# Go dependency inference
# [golang-infer]
# imports = true
# Build caching configuration
# Using GitHub Actions cache (configured by pantsbuild/setup-action)
# Local cache for development
# [GLOBAL.cache]
# local_store_dir = ".pants.d/cache"
# ==========================================
# Test Configuration
# ==========================================
[test]
# Run tests in parallel (adjust based on CPU cores)
use_coverage = false # Enable with --use-coverage flag when needed
# Test timeouts
timeout_default = 60 # seconds (default timeout for each test)
timeout_maximum = 300 # seconds (maximum allowed timeout)
# Output mode: all (show everything), failed (only failures), none (summary only)
output = "failed" # Only show failed test output for cleaner CI logs
# Pytest-specific configuration
[pytest]
# Install pytest from the stravapipe resolve rather than Pants' built-in tool
# lockfile. Test files `import pytest`, so dependency inference already pulls
# pytest in from the resolve; without this, Pants' own pytest is installed
# alongside it and the two collide in one PEX venv.
install_from_resolve = "stravapipe"
requirements = ["pytest", "pytest-cov"]
args = [
"-v", # Verbose output
"--tb=short", # Short traceback format
]
# Note: pytest-xdist for parallel execution ("-n", "auto") requires it in dependencies
# Go test settings
[go-test]
args = [
"-v", # Verbose output
]
# Note: -race flag not supported by Pants Go backend test runner
# Python coverage configuration
[coverage-py]
report = ["console", "xml"] # Generate console output and XML for CI
output_dir = "{distdir}/coverage/python" # Coverage reports go to dist/coverage/python/
# Fail build if coverage below threshold (optional - disabled for now)
# fail_under = 70
# ==========================================
# Docker Configuration
# ==========================================
[docker]
# Default registry for docker_image targets
# All artifacts (dev + prod) stored in desirelines-artifacts Artifact Registry
# Terraform uses deployment_version variable to pull correct image tag
# Note: Registry address is added by [docker.registries] config below
default_repository = "desirelines-artifacts/desirelines-services/{name}"
# Build arguments
build_args = []
# Verbose output for debugging
build_verbose = false
# Pass environment variables needed for gcloud credential helper
env_vars = ["HOME", "PATH"]
[docker.registries."us-central1-docker.pkg.dev"]
# Artifact Registry configuration
address = "us-central1-docker.pkg.dev"
default = true # Mark as default registry for publishing
# Authentication: gcloud auth configure-docker us-central1-docker.pkg.dev
# Pants uses gcloud credentials automatically once configured