blob: 426e47b99098a3620de22e533b4fc8ff3049255d [file] [log] [blame]
/*
* Copyright 2018-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
{namespace python_common}
/***/
{template .srcs_arg}
{call buck.arg}
{param name: 'srcs' /}
{param default : '[]' /}
{param desc}
The set of Python (<code>.py</code>) files to include in this library.
{/param}
{/call}
{/template}
/***/
{template .platform_srcs_arg}
{call buck.arg}
{param name : 'platform_srcs' /}
{param default : '[]' /}
{param desc}
Python-platform-specific source files. These should be specified as a
list of pairs where the first element in each pair is an un-anchored
regex against which the platform name is matched, and the second element
is a list of source files. The regex should use <code>java.util.regex.Pattern</code> syntax.
The platform name is a Python platform <em>flavor</em> defined in
the {call buckconfig.python /} section of <code>.buckconfig</code>.
{/param}
{/call}
{/template}
/***/
{template .resources_arg}
{call buck.arg}
{param name: 'resources' /}
{param default : '[]' /}
{param desc}
Static files to be packaged along with the Python sources.
These resources can be accessed at runtime using
the <a href="http://setuptools.readthedocs.io/en/latest/pkg_resources.html">pkg_resources</a> module distributed
with Python's setuptools.
{/param}
{/call}
{/template}
/***/
{template .platform_resources_arg}
{call buck.arg}
{param name : 'platform_resources' /}
{param default : '[]' /}
{param desc}
Python-platform-specific resource files. These should be specified as a
list of pairs where the first element in each pair is an un-anchored
regex against which the platform name is matched, and the second element
is a list of resource files. The regex should use <code>java.util.regex.Pattern</code> syntax.
The platform name is a Python platform <em>flavor</em> defined in
the {call buckconfig.python /} section of <code>.buckconfig</code>.
{/param}
{/call}
{/template}
/***/
{template .base_module_arg}
{call buck.arg}
{param name: 'base_module' /}
{param default : 'None' /}
{param desc}
The package in which the specified source files and resources should reside in their final
location in the top-level binary. If unset, Buck uses the project-relative directory
that contains the BUCK file.
{/param}
{/call}
{/template}
/***/
{template .platform_arg}
{call buck.arg}
{param name : 'platform' /}
{param default : 'None' /}
{param desc}
The name of the Python platform <em>flavor</em> to build against by default as defined in
the {call buckconfig.python /} section of <code>.buckconfig</code>.
{/param}
{/call}
{/template}
/***/
{template .linker_flags_arg}
{call buck.arg}
{param name : 'linker_flags' /}
{param default : '[]' /}
{param desc}
Additional linker flags that should be applied to any linking which is specific to this rule.
Note that whether these flags are used is dependent on the native link strategy selected in
<code>.buckconfig</code> and currently applies only to the <code>merged</code> <code>{call buckconfig.python_native_link_strategy /}</code>;
the <code>separate</code> link strategy pulls in shared libraries that are linked in the
context of the rules that own them, such as {call buck.ruleLink}{param name : 'cxx_library' /}{/call}.
{/param}
{/call}
{/template}
/***/
{template .package_style_arg}
{call buck.arg}
{param name : 'package_style' /}
{param default : 'None' /}
{param desc}
Used to override the global packaging style that is set in <code>[{call buckconfig.python_package_style /}]</code>.
{/param}
{/call}
{/template}
/***/
{template .preload_deps_arg}
{call buck.arg}
{param name : 'preload_deps' /}
{param default : '[]' /}
{param desc}
A list of C/C++ library dependencies that need to be loaded before any
other libraries when the PEX starts up. This requires dynamic loader support,
such as <code>LD_PRELOAD</code>, found on most systems. This list is order-
sensitive and the preload libraries listed here are passed down to the dynamic
linker in the same order.
{/param}
{/call}
{/template}
/***/
{template .exclude_deps_from_merged_linking_arg}
{call buck.arg}
{param name : 'exclude_deps_from_merged_linking' /}
{param default : 'False' /}
{param desc}
When linking the top-level binary with a <code>merged</code> <code>{call buckconfig.python_native_link_strategy /}</code>,
do not merge or re-link any native transitive deps of this library. This is useful if
this library wraps prebuilt native extensions which cannot be re-linked as part of
library merging.
{/param}
{/call}
{/template}