Version
This part of the project documentation focuses on
an information-oriented approach. Use it as a
reference for the technical implementation of the
pact_methodology
project code.
Version
Represents a version of a product footprint.
Attributes:
Name | Type | Description |
---|---|---|
version |
int
|
The version number, which must be an integer in the range 0 to 2^31-1. |
Raises:
Type | Description |
---|---|
ValueError
|
If the version number is not an integer or is out of range. |
Source code in pact_methodology/product_footprint/version.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
__eq__(other)
Compares two Version objects for equality.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
object
|
The object to compare with. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the objects are equal, False otherwise. |
Source code in pact_methodology/product_footprint/version.py
28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
__init__(version)
Initializes a new Version object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
version
|
int
|
The version number. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the version number is not an integer or is out of range. |
Source code in pact_methodology/product_footprint/version.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
__repr__()
Returns a string representation of the Version object.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string representation of the Version object. |
Source code in pact_methodology/product_footprint/version.py
42 43 44 45 46 47 48 49 |
|
get_latest_version(*versions)
classmethod
Returns the latest version from a list of versions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*versions
|
Version
|
The versions to compare. |
()
|
Returns:
Name | Type | Description |
---|---|---|
Version |
Version
|
The latest version. |
Raises:
Type | Description |
---|---|
ValueError
|
If any of the arguments are not instances of Version. |
Source code in pact_methodology/product_footprint/version.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|