ambitious-actor-36781
11/09/2021, 3:14 AMpython_library
and the 2.8.0 python_sources
just the name?
it /feels/ like everything works differentlyfast-nail-55400
11/09/2021, 3:49 AMpython_library
represented multiple source files and there were “subtargets” addressable on the command-line via file specs (i.e., the name of the file). These file subtargets were a special case in the engine.
In 2.8.x, per-file subtargets have been generalized into “target generators” where a target can dynamically create other targets. python_sources
is a target generator that generates python_source
targets (which represent each Python file).
One of the motivations for the feature was for the Go backend. The go_mod
target is a target generator which generates targets for the packages in third-party dependencies. This allows those packages to be part of the build graph so that Pants knows the dependencies among them. This is an example of a target generator that does not generate per-file targets (since the “unit of build” in Go programs is the package).witty-crayon-22786
11/09/2021, 4:48 AMpython_library
and python_sources
should be identical.hundreds-father-404
11/09/2021, 3:52 PMpython_source
and python_test
target
• you can set `overrides`:
python_tests(
name="tests",
overrides={
"foo_test.py": {"timeout": 120},
("bar_test.py", "baz_test.py"): {"timeout": 200},
},
)
The other changes are:
• ./pants peek
will have different target_type
for some targets. Whereas ./pants peek path/to/f_test.py
used to say python_tests
, now it's python_test
• ./pants filter --target-type
differentiates between python_source
vs. python_sources
• The globs ./pants $goal dir:
now matches "generated targets" with goals like list
and peek
when using dir:
and dir::
, whereas we used to leave them off
What changes are you seeing?