Quick feedback, it would be even more helpful if t...
# development
c
Quick feedback, it would be even more helpful if this deprecation notice included information about which BUILD file the deprecated target was found in (or the target’s address even)
Copy code
10:09:39.57 [WARN] DEPRECATED: the target name python_library will be removed in version 2.9.0.dev0.

Use `python_sources` instead, which behaves the same.

To automate fixing this, download <https://github.com/pantsbuild/pants/blob/release_2.8.0.dev4/build-support/migration-support/rename_targets_pants28.py>, then run `python3 rename_targets_pants28.py --help` for instructions.
h
The reason I didn't do that it is would result in hundreds of warnings. One per target. That seemed like a bad idea. Wdyt?
c
Oh, right, yeah… hmmm… that is undesireable too, of course. Isn’t there a limit for a certain class of warnings, that they get silenced if there are loads of them?
Or if this is simply custom code, with a warning logg, could there be a counter, so we only log the first X (small number) instances, then after that drop the specific information and keep this generic template, so it doesn’t spam…
I do get this warning on the pants repo, but I haven’t gone fishing for where it comes from.. 😉
h
We don't currently have a way to do that. We switched from using
warnings
to using
logging.warning
in https://github.com/pantsbuild/pants/pull/12007 All logging in Pants gets proxied to Rust. So we would need a way for our Rust code to know "for this message, only log it n times". And more specifically, "for this message format/regex", given that it might be subtly different like saying the bad address Not sure what that would look like, but probably possible!
I think where I want to spend more energy instead is
./pants mend
. Rather than having to download that script, just run
./pants mend
👍 1
c
Yeah, it’s not worth spending a lot of effort on.