Anyone have settings they've liked for `update-bui...
# general
h
Anyone have settings they've liked for
update-build-files
formatting? I'm using yapf, but I'm not really crazy about what the defaults do. Here's a good example
Copy code
python_sources(
    overrides={"cloud_storage.py": {
        "dependencies": ["//:reqs#boto3"]
    }})
h
I'm v-pro Black, but @fresh-cat-90827 might have Yapf opinions as the contributor for that feature
h
my only rationale for using yapf is that's what we format our py modules with already 🤷
👍 1
If I ever get time to explore pants source code, I'd love to not have to write this out
Copy code
[yapf]
version = "yapf==0.20.0"
h
how come you have to write that out rather than the default?
h
I initially had
Copy code
[yapf]
version = "0.20.0"
and that led to a confusing error saying it couldn't resolve a known version
I'm trying to figure out why
update-build-files
runs differently than when I run
yapf
on a
BUILD
file manually
👀 1
h
Ah. So we used to actually use "0.20.0", but we changed it so that you can do things like VCS requirements & forks of tools 🙂
Maybeeeee we could add an affordance so that "0.20.0" defaults to
yapf==0.20.0
? I'm not sure if that's too magical? Seems reasonable to me!
You could use
-ldebug
to see the argv Pants is using
h
looks like the versioning was causing the difference.
0.32.0
behaves differently.
👍 1
h
what do you think about https://pantsbuild.slack.com/archives/C046T6T9U/p1648595750306249?thread_ts=1648594815.824819&cid=C046T6T9U? If that can remove a common gotcha, I'm generally +1. We really want to keep removing friction like that
h
I think I just misunderstood the flexibility of
version
from the docs
👍 1