This is liable to change in the future.A
python_binary()rule is used to build a PEX file -- an exectuble python package that includes python sources and resources from all transitive
The name of the rule. The output PEX file will also get this name, with an additional
The module which serves as the entry point for this rule. The
__main__.pyfile of this module will be executed by the interpreter when the PEX file is run.
The package for which the main module should reside under in it's final location in the binary. If unset, the project relative directory that houses the BUCK file is used.
The name of the Python platform to build against by default (as defined in the `python#name` section of `.buckconfig`).
python_libraryrules to include in the PEX file (including all transitive dependencies).
A list of C/C++ library dependencies that need to be loaded before any other libraries when the python binary starts up. This requires dynamic loader support found on most systems (e.g. `LD_PRELOAD`).
Used to override the global packaging style set with python.package_style.
List of build target patterns that identify the build rules that can include this rule in its
python_binary( name = 'tailer', main_module = 'tailer', deps = [ ':tailerutils', ], ) python_library( name = 'tailerutils', # tailer.py, the main module, should be specified here. srcs = glob(['*.py']), )
Here is an example of using the `platform` parameter to select the "py2" Python platform as defined in `.buckconfig`:
; .buckconfig [python#py2] interpreter = /usr/bin/python2.7
# BUCK python_binary( name = 'bin', platform = 'py2', main_module = 'main', deps = [ ':bar', ], )