10
10
bzrlib has a rich API which is used both internally, and externally by
11
plugins_ and scripts. To allow the API to change, specifically to allow
11
plugins and scripts. To allow the API to change, specifically to allow
12
12
support for features and methods to be removed, without causing hard to
13
13
diagnose bugs in the clients of the API, bzrlib provides explicit API
14
14
compatibility data, and a compact API to allow scripts and plugins to
50
47
express, and easier for a human to look at and understand, and finally
51
48
easier to manage. The oldest version with which the API for a python
52
49
object is compatible is obtained by looking up the ``api_minimum_version``
53
attribute on the python object handed to ``require_api``, and failing that
54
the bzrlib ``api_minimum_version`` is returned. The current version of the
55
API is obtained by looking for an ``api_current_version`` attribute, and
56
if that is not found, an ``version_info`` attribute (of which the first 3
57
elements are used). If no current version can be found, the bzrlib
58
``version_info`` attribute is used to generate a current API version.
59
This lookup sequence allows users with simple setups (and no python style
60
``version_info`` tuple) to still export an API version, and for new API's
61
to be managed more granularly later on with a smooth transition -
62
everything starts off in lockstep with bzrlib's master version.
64
API versions are compared lexically to answer the question 'is
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
65
56
the requested version X <= the current version, and >= the minimum
86
77
with ``(0, 18, 0)``.
88
79
+------------+---------------+
90
+============+===============+
81
+============+===============+
91
82
| bzrlib | All of bzrlib |
92
83
+------------+---------------+