Skip to content

Latest commit

 

History

History
235 lines (146 loc) · 16.7 KB

rules.md

File metadata and controls

235 lines (146 loc) · 16.7 KB

Public API re-exports

pycross_lock_file

pycross_lock_file(name, always_build_packages, build_prefix, build_target_overrides,
                  default_alias_single_version, environment_prefix, local_wheels, lock_model_file,
                  out, package_build_dependencies, package_prefix, pypi_index, remote_wheels,
                  repo_prefix, target_environments)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
always_build_packages A list of package keys (name or name@version) to always build from source. List of strings optional []
build_prefix An optional prefix to apply to package build targets. Defaults to _build String optional "_build"
build_target_overrides A mapping of package keys (name or name@version) to existing pycross_wheel_build build targets. Dictionary: String -> String optional {}
default_alias_single_version Generate aliases for all packages that have a single version in the lock file. Boolean optional False
environment_prefix An optional prefix to apply to environment targets. Defaults to _env String optional "_env"
local_wheels A list of wheel files. List of labels optional []
lock_model_file The lock model JSON file. Label required
out The output file. Label required
package_build_dependencies A dict of package keys (name or name@version) to a list of that packages build dependency keys. Dictionary: String -> List of strings optional {}
package_prefix An optional prefix to apply to package targets. String optional ""
pypi_index The PyPI-compatible index to use (must support the JSON API). String optional ""
remote_wheels A mapping of remote wheels to their sha256 hashes. Dictionary: String -> String optional {}
repo_prefix The prefix to apply to repository targets. Defaults to the lock file target name. String optional ""
target_environments A list of pycross_target_environment labels. List of labels optional []

pycross_lock_repo

pycross_lock_repo(name, lock_file, repo_mapping)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this repository. Name required
lock_file The generated bzl lock file. Label required
repo_mapping A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target). Dictionary: String -> String required

pycross_pdm_lock_model

pycross_pdm_lock_model(name, default, dev, groups, lock_file, project_file)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
default Whether to install dependencies from the default group. Boolean optional True
dev Whether to install dev dependencies. Boolean optional False
groups Select groups of optional-dependencies or dev-dependencies to install. List of strings optional []
lock_file The pdm.lock file. Label required
project_file The pyproject.toml file with pdm dependencies. Label required

pycross_poetry_lock_model

pycross_poetry_lock_model(name, poetry_lock_file, poetry_project_file)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
poetry_lock_file The poetry.lock file. Label required
poetry_project_file The pyproject.toml file with Poetry dependencies. Label required

pycross_target_environment

pycross_target_environment(name, abis, envornment_markers, implementation, platforms,
                           python_compatible_with, version)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
abis A list of PEP 425 abi tags. List of strings optional []
envornment_markers Environment marker overrides. Dictionary: String -> String optional {}
implementation The PEP 425 implementation abbreviation (defaults to 'cp' for CPython). String optional "cp"
platforms A list of PEP 425 platform tags. List of strings optional []
python_compatible_with A list of constraints that, when satisfied, indicates this target_platform should be selected. List of labels required
version The python version. String required

pycross_wheel_build

pycross_wheel_build(name, copts, deps, linkopts, sdist, target_environment)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
copts Additional C compiler options. List of strings optional []
deps A list of build dependencies for the wheel. List of labels optional []
linkopts Additional C linker options. List of strings optional []
sdist The sdist file. Label required
target_environment The target environment to build for. Label optional None

pycross_wheel_library

pycross_wheel_library(name, deps, enable_implicit_namespace_pkgs, python_version, wheel)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
deps A list of this wheel's Python library dependencies. List of labels optional []
enable_implicit_namespace_pkgs If true, disables conversion of native namespace packages into pkg-util style namespace packages. When set all py_binary and py_test targets must specify either legacy_create_init=False or the global Bazel option --incompatible_default_to_explicit_init_py to prevent init.py being automatically generated in every directory. This option is required to support some packages which cannot handle the conversion to pkg-util style. Boolean optional True
python_version The python version required for this wheel ('PY2' or 'PY3') String optional ""
wheel The wheel file. Label required

pypi_file

pypi_file(name, filename, index, keep_metadata, package_name, package_version, repo_mapping, sha256)

Downloads a file from a PyPI-compatible package index.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this repository. Name required
filename The name of the file to download. String required
index The base URL of the PyPI-compatible package index to use. Defaults to pypi.org. String optional "https://pypi.org"
keep_metadata Whether to store the pypi_metadata.json file for debugging. Boolean optional False
package_name The package name. String required
package_version The package version. String required
repo_mapping A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target). Dictionary: String -> String required
sha256 The expected SHA-256 of the file downloaded. String required

PycrossTargetEnvironmentInfo

PycrossTargetEnvironmentInfo(python_compatible_with, file)

A target environment description.

FIELDS

Name Description
python_compatible_with A list of constraints used to select this platform.
file The JSON file containing target environment information.

PycrossWheelInfo

PycrossWheelInfo(name_file, wheel_file)

Information about a Python wheel.

FIELDS

Name Description
name_file File: A file containing the canonical name of the wheel.
wheel_file File: The wheel file itself.