Skylib module containing functions for checking Bazel versions.

Macros and Functions

versions.get

Returns the current Bazel version

Example usage (generated)

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.get(
)

versions.parse

Parses a version string into a 3-tuple of ints

int tuples can be compared directly using binary operators (<, >).

Example usage (generated)

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.parse(
    # the Bazel version string
    bazel_version = None,
)

bazel_version

the Bazel version string


versions.check

Check that the version of Bazel is valid within the specified range.

Example usage (generated)

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.check(
    # minimum version of Bazel expected
    minimum_bazel_version = None,
)

minimum_bazel_version

minimum version of Bazel expected

maximum_bazel_version

maximum version of Bazel expected

bazel_version

the version of Bazel to check. Used for testing, defaults to native.bazel_version


versions.is_at_most

Check that a version is lower or equals to a threshold.

Example usage (generated)

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.is_at_most(
    # the maximum version string
    threshold = None,
    # the version string to be compared to the threshold
    version = None,
)

threshold

the maximum version string

version

the version string to be compared to the threshold


versions.is_at_least

Check that a version is higher or equals to a threshold.

Example usage (generated)

load("@bazel_skylib//lib:versions.bzl", "versions")

versions.is_at_least(
    # the minimum version string
    threshold = None,
    # the version string to be compared to the threshold
    version = None,
)

threshold

the minimum version string

version

the version string to be compared to the threshold