_package#

class rezbuild_utils._package.BuildPackageVersion#

Bases: object

An object to manipulate the version attribute following Knots conventions.

It assumes a package with a traditional semver versioning is being built.

Knots specificities:

  • The extra-patch is an additional “sub-patch” token for rez versioning of vendor packages.

property extra_patch: str#
property full_version: str#
property major: str#
property minor: str#
property patch: str#
property vendor_version: str#
rezbuild_utils._package.preserve_build_attributes()#

Dirty hack to avoid package creation to remove build attributes.

Use at your own risk.

Example:

with preserve_build_attributes(), make_package("python", ".") as package:
    package.version = "0.1.0"
    package.build_command = "python {root}/build.py"
    # ...