acoustic-librarian-29560
05/30/2024, 9:15 PMacoustic-librarian-29560
05/30/2024, 9:15 PMcurved-television-6568
05/31/2024, 6:39 AMalias is "required", so not providing one will break assumptions about it being present: https://github.com/pantsbuild/pants/blob/ec86d19cd954cd49a9562880a7c0dbc45632778c/src/python/pants/engine/target.py#L255-L256
I think you can get away with an empty string as value rather than leaving it out (not sure, though.) preferably you pick some internal looking name, as it will show up in error messages etc, and not having a legible value could be confusing then. (pants use a single underscore prefix for such targets.)
Now to what's actually going on on that line, it is fetching any __defaults__ that should apply to the targets being generated. That is, say you make your own target generator that generates python_source targets.. if you have __defaults__({python_source: dict(tags=["foo"])}) you'd expect those generated targets to be tagged with "foo", right? 🙂curved-television-6568
05/31/2024, 6:40 AMacoustic-librarian-29560
05/31/2024, 12:39 PMacoustic-librarian-29560
05/31/2024, 2:29 PMcurved-television-6568
05/31/2024, 2:51 PMcurved-television-6568
05/31/2024, 2:51 PMcurved-television-6568
05/31/2024, 2:52 PMacoustic-librarian-29560
05/31/2024, 2:53 PM