sob.version
Version
Version(
version_string: str | None = None,
specification: str = "",
compatible_with: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
equals: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
exactly_equals: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
not_equals: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
less_than: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
less_than_or_equal_to: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
greater_than: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
greater_than_or_equal_to: (
collections.abc.Sequence[
str | int | float | decimal.Decimal
]
| None
) = None,
)
Instances of this class represent specification version compatibility.
An instance of sob.Version
can be initialized from a version string
formatted similarly to python package dependency specifiers as
documented in PEP-440, but
instead of representing package version compatibility, it represents
compatibility with a specification version.
Attributes:
-
specification
–A specification name/identifier. This can be any string, so long as the same string is used when representing versions in property metadata as when applying the version using
sob.version_model
. -
compatible_with
–A sequence of version numbers for which comparisons should be evaluated as described for
~=
in PEP-440. -
equals
–A sequence of version numbers for which comparisons should be evaluated as described for
==
in PEP-440. -
exactly_equals
–A sequence of version numbers for which comparisons should be evaluated as described for
===
in PEP-440. -
not_equals
–A sequence of version numbers for which comparisons should be evaluated as described for
!=
in PEP-440. -
less_than
–A sequence of version numbers for which comparisons should be evaluated as described for
<
in PEP-440. -
less_than_or_equal_to
–A sequence of version numbers for which comparisons should be evaluated as described for
<=
in PEP-440. -
greater_than
–A sequence of version numbers for which comparisons should be evaluated as described for
>
in PEP-440. -
greater_than_or_equal_to
–A sequence of version numbers for which comparisons should be evaluated as described for
>=
in PEP-440.
Parameters:
-
version_string
(str | None
, default:None
) –A version string formatted similarly to python package dependency specifiers as documented in PEP-440.
-
specification
(str
, default:''
) –A specification name/identifier. This can be any string, so long as the same string is used when representing versions in property metadata as when applying the version using
sob.version_model
. -
compatible_with
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
~=
in PEP-440. -
equals
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
==
in PEP-440. -
exactly_equals
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
===
in PEP-440. -
not_equals
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
!=
in PEP-440. -
less_than
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
<
in PEP-440. -
less_than_or_equal_to
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
<=
in PEP-440. -
greater_than
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
>
in PEP-440. -
greater_than_or_equal_to
(collections.abc.Sequence[str | int | float | decimal.Decimal] | None
, default:None
) –A sequence of version numbers for which comparisons should be evaluated as described for
>=
in PEP-440.
Source code in src/sob/version.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|