Skip to content

Latest commit

 

History

History
152 lines (94 loc) · 8.75 KB

workspace_rules.md

File metadata and controls

152 lines (94 loc) · 8.75 KB

Public repository rule API re-exports

lock_repo_model_pdm

load("@rules_pycross//pycross:workspace.bzl", "lock_repo_model_pdm")

lock_repo_model_pdm(project_file, lock_file, default, optional_groups, all_optional_groups,
                    development_groups, all_development_groups, require_static_urls)

PARAMETERS

Name Description Default Value
project_file

-

none
lock_file

-

none
default

-

True
optional_groups

-

[]
all_optional_groups

-

False
development_groups

-

[]
all_development_groups

-

False
require_static_urls

-

True

lock_repo_model_poetry

load("@rules_pycross//pycross:workspace.bzl", "lock_repo_model_poetry")

lock_repo_model_poetry(project_file, lock_file, default, optional_groups, all_optional_groups)

PARAMETERS

Name Description Default Value
project_file

-

none
lock_file

-

none
default

-

True
optional_groups

-

[]
all_optional_groups

-

False

lock_repo_model_uv

load("@rules_pycross//pycross:workspace.bzl", "lock_repo_model_uv")

lock_repo_model_uv(project_file, lock_file, default, optional_groups, all_optional_groups,
                   development_groups, all_development_groups, require_static_urls)

PARAMETERS

Name Description Default Value
project_file

-

none
lock_file

-

none
default

-

True
optional_groups

-

[]
all_optional_groups

-

False
development_groups

-

[]
all_development_groups

-

False
require_static_urls

-

True

pycross_lock_repo

load("@rules_pycross//pycross:workspace.bzl", "pycross_lock_repo")

pycross_lock_repo(name, lock_model, kwargs)

Create a repo containing packages described by an imported lock.

PARAMETERS

Name Description Default Value
name the repo name. none
lock_model the serialized lock model struct. Use lock_repo_model_pdm or lock_repo_model_poetry. none
kwargs additional args to pass to resolved_lock_repo and package_repo. none

pycross_register_for_python_toolchains

load("@rules_pycross//pycross:workspace.bzl", "pycross_register_for_python_toolchains")

pycross_register_for_python_toolchains(name, python_toolchains_repo, platforms, glibc_version,
                                       musl_verison, macos_version)

Register target environments and toolchains for a given list of Python versions.

PARAMETERS

Name Description Default Value
name the toolchain repo name. none
python_toolchains_repo a label to the registered rules_python tolchain repo. none
platforms an optional list of platforms to support (e.g., "x86_64-unknown-linux-gnu"). By default, all platforms supported by rules_python are registered. None
glibc_version the maximum supported GLIBC version. None
musl_verison the maximum supported musl version. None
macos_version the maximum supported macOS version. None

pycross_lock_file_repo

load("@rules_pycross//pycross:workspace.bzl", "pycross_lock_file_repo")

pycross_lock_file_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 In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

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).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).
Dictionary: String -> String optional