witty-crayon-22786
09/21/2022, 7:28 PMcurved-television-6568
09/21/2022, 7:30 PM╰─❯ pyenv version
3.9.13 (set by /Users/andreas.stenius/.pyenv/version)
3.8.13 (set by /Users/andreas.stenius/.pyenv/version)
but apart from that it’s nothing special. I did a repor off of main
yesterday. I’m happy to run some diagnostics to help pin this down if you have any for me..witty-crayon-22786
09/21/2022, 7:31 PMcurved-television-6568
09/21/2022, 7:31 PMwitty-crayon-22786
09/21/2022, 7:32 PMcurved-television-6568
09/21/2022, 7:33 PMhappy-kitchen-89482
09/21/2022, 7:34 PMcurved-television-6568
09/21/2022, 7:37 PMcurved-television-6568
09/21/2022, 7:38 PMcurved-television-6568
09/21/2022, 7:39 PMwitty-crayon-22786
09/21/2022, 7:39 PMsudo py-spy dump -p $pid
… probably for the test process firstcurved-television-6568
09/21/2022, 7:43 PMwitty-crayon-22786
09/21/2022, 7:43 PMwitty-crayon-22786
09/21/2022, 7:44 PMhundreds-father-404
09/21/2022, 8:02 PMbitter-ability-32190
09/21/2022, 8:57 PMpartition
-ing schema for `fmt`/`lint` for check
as well so that each are consistent.
Unfortunately I'm starting to lose steam, so if anyone is interested in picking it up, LMK
(and I'd VERY much like to keep this change in a single release, so timing does matter)
Also RIP fmt/lint/check plugin authors. I'm so sorry 😭bitter-ability-32190
09/22/2022, 2:57 PM_GoalSubsystemT = TypeVar("_GoalSubsystemT", bound=GoalSubsystem)
async def _get_subpartitions(
subsystem: type[_GoalSubsystemT],
): ...
...
_get_subpartitions(lint_subsystem)
# Note: `LintSubsystem` is `class LintSubsystem(GoalSubsystem):`
yields
error: Argument 1 to "_get_subpartitions" has incompatible type "LintSubsystem"; expected "Type[<nothing>]" [arg-type]
https://mypy.readthedocs.io/en/stable/kinds_of_types.html#the-type-of-class-objects makes me think what I'm doing is OKbitter-ability-32190
09/22/2022, 5:24 PMPolite
)
`lint.py`:
• Plugins register rules using *PoliteRequest.registration_rules()
(there are multiple unions being registered)
• Plugins define 2 rules* (*future PR will provide a "default" implementation of the first rule if opted-into)
◦ A "partitioner" rule. This takes all the specs FieldSets (for targets) / files (for target-less), and returns Partitions
: a mapping from key: Any
to elements: tuple[T, ...]
. (Note the elements can by anything) Most tools have an implementation of "if skip, return empty. Otherwise return one partition of all the inputs". Some plugins do actual partitioning though, and those get to do interesting thing. This is also an opportunity to do expensive work once.
◦ A "runner" rule. This rule takes a SubPartition
(the key, and a subset of the partition) and returns a LintResult
• The rules look like:
◦ PoliteRequest.PartitionRequest -> Partitions
◦ PoliteRequest.SubPartition -> LintResult
`fmt.py`:
• Same idea as lint.py
with one change: the partition elements are filepaths for both target-aware tools and targetless tools
• The snapshot is retrieved in the "runner" rule by doing await PoliteRequest.SubPartition.get_snapshot(request)
bitter-ability-32190
09/22/2022, 5:44 PMterraform fmt
is it OK if we're formatting a subset of files in a directory? E.g. if a directory has [a, b, c]
and we fmt [a, b]
in one process and [c]
in another?ancient-vegetable-10556
09/22/2022, 11:23 PMwitty-crayon-22786
09/23/2022, 12:29 AMancient-vegetable-10556
09/23/2022, 3:41 PMGolangSubsystem
. There’s a bunch of options that look like they might be environment-sensitive, can you confirm that my suggestions here make sense? https://docs.google.com/document/d/1vXRHWK7ZjAIp2BxWLwRYm1QOKDeXx02ONQWvXDloxkg/edit#heading=h.f7dousqg1kefhundreds-father-404
09/23/2022, 4:15 PMwitty-crayon-22786
09/23/2022, 4:23 PMcurved-television-6568
09/23/2022, 4:25 PMbitter-ability-32190
09/23/2022, 5:19 PMfix
)bitter-ability-32190
09/23/2022, 6:23 PMargs
options to tools which don't take argv _today_"
Pros of adding it:
• Future-proof. The user who is using Pants today can upgrade the version of the tool to one that does take argv
, and can now pass args
◦ Otherwise the user would have to either fork the support in-repo, or upstream the change and wait and upgrade Pants 😞
• Consistency across all tool subsystems. They all have args
option
Cons of adding it:
• Funky UI for users of versions that don't take an argv. They try and pass something and the tool goes boomancient-vegetable-10556
09/23/2022, 7:02 PMancient-vegetable-10556
09/23/2022, 8:12 PM[GLOBAL].ca_certs_path
. This is a BootstrapOption, which is inherently non-environment-sensitive. There’s clearly places where we need an environment-sensitive value, but we also need a value which is fixed to the environment where Pants is being run (e.g. in scheduler.py
). Is the solution here to add a new option for process-level certs paths (which defaults to ca_certs_path
), or something else?fast-nail-55400
09/24/2022, 3:30 PMchevron==0.14.0
entry in requirements.txt
has the comment: Should only be used by build-support. What is the context for that comment? (I'd like to use a templating library in a rule in the Go backend and using a templating library that is already in the lockfile would be preferred.)