Implementation of PyInfo provider and PyInfo-specific utilities.
Encapsulates information provided by the Python rules.
Instead of creating this object directly, use PyInfoBuilder
and the PyCommonApi
utilities.
The .py
source files (if any) that are considered directly provided by the target. This field is intended so that static analysis tools can recover the original Python source files, regardless of any build settings (e.g. precompiling), so they can analyze source code. The values are typically the .py
files in the srcs
attribute (or equivalent).
Added in version 1.1.0.
Precompiled Python files that are considered directly provided by the target and must be included.
These files usually come from, e.g., a library setting precompile=enabled
to forcibly enable precompiling for itself. Downstream binaries are expected to always include these files, as the originating target expects them to exist.
Type definition files (usually .pyi
files) for the Python modules provided by this target. Usually they describe the source files listed in direct_original_sources
. This field is primarily for static analysis tools.
These files are usually build-time only and not included as part of a runnable program.
Note
This may contain implementation-specific file types specific to a particular type checker.
Added in version 1.1.0.
Whether any of this target’s transitive sources requires a Python 2 runtime.
Whether any of this target’s transitive sources requires a Python 3 runtime.
A depset of import path strings to be added to the PYTHONPATH
of executable Python targets. These are accumulated from the transitive deps
. The order of the depset is not guaranteed and may be changed in the future. It is recommended to use default
order (the default).
Automatically generated pyc files that downstream binaries (or equivalent) can choose to include in their output. If not included, then transitive_implicit_pyc_source_files
should be included instead.
Added in version 0.37.0.
Source .py
files for transitive_implicit_pyc_files
that downstream binaries (or equivalent) can choose to include in their output. If not included, then transitive_implicit_pyc_files
should be included instead.
Added in version 0.37.0.
The transitive set of .py
source files (if any) that are considered the original sources for this target and its transitive dependencies. This field is intended so that static analysis tools can recover the original Python source files, regardless of any build settings (e.g. precompiling), so they can analyze source code. The values are typically the .py
files in the srcs
attribute (or equivalent).
This is superset of direct_original_sources
.
Added in version 1.1.0.
The transitive set of precompiled files that must be included.
These files usually come from, e.g., a library setting precompile=enabled
to forcibly enable precompiling for itself. Downstream binaries are expected to always include these files, as the originating target expects them to exist.
The transitive set of type definition files (usually .pyi
files) for the Python modules for this target and its transitive dependencies. this target. Usually they describe the source files listed in transitive_original_sources
. This field is primarily for static analysis tools.
These files are usually build-time only and not included as part of a runnable program.
Note
This may contain implementation-specific file types specific to a particular type checker.
Added in version 1.1.0.
A (postorder
-compatible) depset of .py
files that are considered required and downstream binaries (or equivalent) must include in their outputs to have a functioning program.
Normally, these are the .py
files in the appearing in the target’s srcs
and the srcs
of the target’s transitive deps
, however, precompile settings may cause .py
files to be omitted. In particular, pyc-only builds may result in this depset being empty.
Changed in version 0.37.0: The files are considered necessary for downstream binaries to function; previously they were considerd informational and largely unused.
Whether any of this target’s transitive deps
has a shared library file (such as a .so
file).
This field is currently unused in Bazel and may go away in the future.
Warning
Experimental API. This API is still under development and may change or be removed without notice.
Added in version 1.5.0.
Builder for PyInfo.
To create an instance, use py_common.get()
and call PyInfoBuilder()
Builds into a Bazel-builtin PyInfo object, if available.
BuiltinPyInfo
| None
None is returned if Bazel’s builtin PyInfo object is disabled.
Get the has_py2_only_sources
value.
Get the has_py3_only_sources
value.
Get the uses_shared_libraries
value.
Merge other PyInfos into this PyInfo.
Merge other PyInfos into this PyInfo.
PyInfoBuilder
self
Sets has_py2_only_sources
based on current and incoming value
.
PyInfoBuilder
self
Sets has_py3_only_sources
based on current and incoming value
.
PyInfoBuilder
self
Merge a target’s Python information in this object.
PyInfoBuilder
self.
Merge multiple targets into this object.
PyInfoBuilder
self.
Sets uses_shared_libraries
based on current and incoming value
.
– (bool
)
Another uses_shared_libraries
value. It will be merged into this builder’s state.
PyInfoBuilder
self
Creates an instance.
Sets has_py2_only_sources
to value
.
PyInfoBuilder
self
Sets has_py3_only_sources
to value
.
PyInfoBuilder
self
Sets uses_shared_libraries
to value
.
– (bool
)
The value to set.
PyInfoBuilder
self
An entry in PyInfo.venv_symlinks
One of the VenvSymlinkKind
values. It represents which directory within the venv to create the path under.
A runfiles-root relative path that venv_path
will symlink to. If None
, it means to not create a symlink.
Represents the PyPI package name that the code originates from. It is normalized according to the PEP440 with all -
replaced with _
, i.e. the same as the package name in the hub repository that it would come from.
A path relative to the kind
directory within the venv.
Represents the PyPI package version that the code originates from. It is normalized according to the PEP440 standard.
An enum of types of venv directories.
Indicates to create paths under the directory that has binaries within the venv.
Indicates to create paths under the venv’s site-packages directory.
Indicates to create paths under the venv’s include directory.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4