narrow-librarian-17683
05/08/2026, 2:43 PMpython_sources() globs only seem to read from the build root, not the the sandbox, and autogenerated files live in the sandbox.
2. GenerateSourcesRequest outputs into the sandbox and integrates with the dependency graph, but its outputs don't seem to wire up to ruff and pyright automatically.
Is a custom LintTargetsRequest only way? Or is some built-in mechanism for wiring ruff up to the output of a codegen plugin?acoustic-spring-13969
05/08/2026, 5:20 PMpants tailor :: to setup your BUILD files?
Running pants fix :: or pants fmt :: should be sufficient, could you share your pants.toml file? and the output of all the commands I've shared?narrow-librarian-17683
05/08/2026, 5:27 PMacoustic-spring-13969
05/08/2026, 5:41 PMpants tailor :: for pants to understand that it is a target and how it is related to other parts of your codebase. Then you can run pants lint <target-name>:: to check lint/formatting .
You can also run pants list <target-name>:: to ensure you're targeting the right targetnarrow-librarian-17683
05/08/2026, 5:43 PMpants tailor be looking at? The generated code doesn't exist on my "normal" filesystem, only in /tmp/pants-sandbox/happy-kitchen-89482
05/08/2026, 6:01 PMnarrow-librarian-17683
05/08/2026, 6:01 PMnarrow-librarian-17683
05/08/2026, 6:01 PMhappy-kitchen-89482
05/08/2026, 6:01 PMhappy-kitchen-89482
05/08/2026, 6:02 PMruff on it?narrow-librarian-17683
05/08/2026, 6:03 PMnarrow-librarian-17683
05/08/2026, 6:05 PMbuf build, which checks the Protobuf files for correctness
⢠pants calls buf generate, which calls our custom Protobuf plugins that generate code
⢠pants lints and formats both the generator and generated codenarrow-librarian-17683
05/08/2026, 6:06 PMnarrow-librarian-17683
05/08/2026, 6:14 PMbuf generate) that takes in a custom ProtoSourcesField and produces a PythonSourceField . Unfortunately, I couldn't figure out how to wire that up to ruff check rulesnarrow-librarian-17683
05/08/2026, 6:20 PMrules() method returned a union with something exensible (and hydrated with enable_codegen=True), I could just subclass it? It looks like that's what Pytest does. But honestly I'm so new to pants I have no idea if that's truehappy-kitchen-89482
05/08/2026, 7:15 PMad_hoc rule is enough?narrow-librarian-17683
05/08/2026, 7:17 PMhappy-kitchen-89482
05/08/2026, 7:17 PMhappy-kitchen-89482
05/08/2026, 7:17 PMnarrow-librarian-17683
05/08/2026, 7:17 PMhappy-kitchen-89482
05/08/2026, 7:17 PMhappy-kitchen-89482
05/08/2026, 7:17 PMnarrow-librarian-17683
05/08/2026, 7:18 PMhappy-kitchen-89482
05/08/2026, 7:20 PMnarrow-librarian-17683
05/08/2026, 7:21 PMhappy-kitchen-89482
05/08/2026, 9:41 PMruff itself, but I imagine it can still use the existing machinery for downloading and invoking ithappy-kitchen-89482
05/08/2026, 9:42 PMwide-midnight-78598
05/10/2026, 11:50 PMwide-midnight-78598
05/10/2026, 11:51 PMnarrow-librarian-17683
05/11/2026, 3:52 PMpython_tests(
name="tests",
sources=["test/**/*.py"],
dependencies=[
"//protobuf:autogenerated-python",
],
)wide-midnight-78598
05/11/2026, 4:28 PMnarrow-librarian-17683
05/11/2026, 6:05 PMpants lint /`pants format` right?wide-midnight-78598
05/11/2026, 6:13 PMlint or format right now, though, which is the problem, correct?
We chain commands like pants fix fmt lint check test (or whatever), so, a custom plugin could work that just calls the generation and lint commands internally (like, call the python functions, or a command line).
With adhoc you'd be calling something like pants run :special_target and it would hopefully work. That means no custom plugin.narrow-librarian-17683
05/11/2026, 6:27 PMpants lint / pants format , but it just calls ruff directlynarrow-librarian-17683
05/11/2026, 6:28 PMwide-midnight-78598
05/11/2026, 6:35 PMwide-midnight-78598
05/11/2026, 6:36 PMnarrow-librarian-17683
05/11/2026, 6:37 PMnarrow-librarian-17683
05/11/2026, 6:37 PMwide-midnight-78598
05/11/2026, 6:42 PMnarrow-librarian-17683
05/11/2026, 6:44 PMnarrow-librarian-17683
05/11/2026, 6:44 PMwide-midnight-78598
05/11/2026, 6:44 PMnarrow-librarian-17683
05/11/2026, 6:44 PMwide-midnight-78598
05/11/2026, 6:44 PMwide-midnight-78598
05/11/2026, 6:45 PMwide-midnight-78598
05/11/2026, 7:24 PMwide-midnight-78598
05/11/2026, 7:29 PM