From 6054d5c5215ab1fd7391729d28278e2c93a5aacc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Morin Date: Sat, 28 Oct 2023 10:59:01 -0400 Subject: [PATCH] Improve docs Signed-off-by: Jean-Christophe Morin --- src/rez/version/__init__.py | 5 ++++- src/rez/version/_version.py | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/rez/version/__init__.py b/src/rez/version/__init__.py index dafa532d8..af11036e9 100644 --- a/src/rez/version/__init__.py +++ b/src/rez/version/__init__.py @@ -3,7 +3,7 @@ """ -Implements a well defined versioning schema. +Implements everything needed to manipulate versions and requirements. There are three class types: :class:`VersionToken`, :class:`Version` and :class:`VersionRange`. A :class:`Version` is a set of zero or more :class:`VersionToken`\\s, separate by ``.``\\s or ``-``\\s (eg ``1.2-3``). @@ -19,6 +19,9 @@ The empty version ``''``, and empty version range ``''``, are also handled. The empty version is used to denote unversioned objects. The empty version range, also known as the 'any' range, is used to refer to any version of an object. + +Requirements and list of requirements are represented by :class:`Requirement` and +:class:`RequirementList` respectively. """ from rez.version._requirement import Requirement, RequirementList, VersionedObject diff --git a/src/rez/version/_version.py b/src/rez/version/_version.py index bcacd7a34..8658980a2 100644 --- a/src/rez/version/_version.py +++ b/src/rez/version/_version.py @@ -1158,15 +1158,14 @@ def iter_intersect_test(self, iterable, key=None, descending=False): Args: iterable: An ordered sequence of versioned objects. If the list is not sorted by version, behaviour is undefined. - key (callable): Function that returns a :class:`Version` given an object + key (typing.Callable[typing.Any]): Function that returns a :class:`Version` given an object from ``iterable``. If None, the identity function is used. descending (bool): Set to True if ``iterable`` is in descending version order. Returns: ~collections.abc.Iterator[tuple[bool, typing.Any]]: An iterator that returns (bool, object) tuples, - where 'object' is - the original object in ``iterable``, and the bool indicates whether + where 'object' is the original object in ``iterable``, and the bool indicates whether that version is contained in this range. """ return _ContainsVersionIterator(self, iterable, key, descending)