esptest.common.version module

class esptest.common.version.VersionLimit(version_limit='')[source]

Bases: object

Represent a set of supported versions as one or more ranges.

Supported string formats:

  • v1.0 means v1.0 to unlimited.

  • Patch or multi-part versions are supported, for example v1.0.1 and v1.0.0-v2.0.3.

  • v1.0-v2.0 means the closed range [v1.0, v2.0].

  • [v1.0-v2.0), (v1.0-v2.0], and (v1.0-v2.0) express open/closed boundaries; for example, (v3.0-v4.0] excludes v3.0 and v3.0.0, but includes v3.0.1.

  • (v1.0-) means versions greater than v1.0 to unlimited.

  • Use ; to combine multiple ranges, for example v1.0-v2.0; v4.0.

& returns the intersection, | returns the union, and remove() subtracts ranges.

Parameters:

version_limit (str)

VERSION_LIMIT_PATTERN = re.compile('^\\s*(?P<left>[\\[\\(])?\\s*(?P<min_version>v?\\d+(?:\\.\\d+)*)(?:\\s*-\\s*(?P<max_version>v?\\d+(?:\\.\\d+)*)?)?\\s*(?P<right>[\\]\\)])?\\s*$')
EMPTY_VERSION_LIMIT_STR = '<empty>'
add(other)[source]
Parameters:

other (str | VersionLimit)

Return type:

VersionLimit

is_any()[source]
Return type:

bool

is_empty()[source]
Return type:

bool

remove(other)[source]
Parameters:

other (str | VersionLimit)

Return type:

VersionLimit

contains(version)[source]
Parameters:

version (str | Version)

Return type:

bool