An executable Python program.
par_binary() is a drop-in replacement for py_binary() that also builds a self-contained, single-file executable for the application, with a .par file extension.
The name
attribute shouldn‘t include the .par
file extension, it’s added automatically. So, for a rule like par_binary(name="myname")
, build the file myname.par
by doing bazel build //mypackage:myname.par
See py_binary for arguments and usage.
An executable Python test.
Just like par_binary, but for py_test instead of py_binary. Useful if you specifically need to test a module's behaviour when used in a .par binary.
A self-contained, single-file Python program, with a .par file extension.
You probably want to use par_binary() instead of this.
TODO(b/27502830): A directory foo.par.runfiles is also created. This is a bug, don't use or depend on it.
Identical to par_binary, but the rule is marked as being a test.
You probably want to use par_test() instead of this.