47
47
express, and easier for a human to look at and understand, and finally
48
48
easier to manage. The oldest version with which the API for a python
49
49
object is compatible is obtained by looking up the ``api_minimum_version``
50
attribute on the python object handed to ``require_api``. The current
51
version of the API is obtained by looking for an ``api_current_version``
52
attribute, and if that is not found, an ``version_info`` attribute (of
53
which the first 3 elements are used). If no current version can be found,
54
the bzrlib ``version_info`` attribute is used to generate a current API
55
version. API versions are compared lexically to answer the question 'is
50
attribute on the python object handed to ``require_api``, and failing that
51
the bzrlib ``api_minimum_version`` is returned. The current version of the
52
API is obtained by looking for an ``api_current_version`` attribute, and
53
if that is not found, an ``version_info`` attribute (of which the first 3
54
elements are used). If no current version can be found, the bzrlib
55
``version_info`` attribute is used to generate a current API version.
56
This lookup sequence allows users with simple setups (and no python style
57
``version_info`` tuple) to still export an API version, and for new API's
58
to be managed more granularly later on with a smooth transition -
59
everything starts off in lockstep with bzrlib's master version.
61
API versions are compared lexically to answer the question 'is
56
62
the requested version X <= the current version, and >= the minimum