|
9 | 9 | from sphinx.locale import _ |
10 | 10 | from sphinx.util import i18n as sphinx_i18n |
11 | 11 |
|
12 | | -from exasol.toolbox.version import VERSION |
| 12 | +from exasol.toolbox.release import Version as ExasolVersion |
| 13 | +from exasol.toolbox.version import VERSION as PLUGIN_VERSION |
13 | 14 |
|
14 | 15 | logger = logging.getLogger(__name__) |
15 | 16 |
|
|
42 | 43 | ) |
43 | 44 |
|
44 | 45 |
|
45 | | -class TagFormatError(Exception): |
46 | | - """ |
47 | | - Exception raised for errors in the tag format. |
48 | | -
|
49 | | - The exception is raised when a tag is found to be incorrectly formatted. |
50 | | - """ |
51 | | - |
52 | | - |
53 | | -class ExasolVersionTag: |
54 | | - |
55 | | - def __init__(self, version): |
56 | | - try: |
57 | | - v = version.name.strip() |
58 | | - parts = v.split(".") |
59 | | - major, minor, patch = map(int, parts) |
60 | | - except Exception as ex: |
61 | | - msg = f"Invalid tag format: '{version}', details: {ex}" |
62 | | - raise TagFormatError(msg) from ex |
63 | | - |
64 | | - self._version = version |
65 | | - self._version_tripple = (major, minor, patch) |
66 | | - |
67 | | - @property |
68 | | - def version(self): |
69 | | - return self._version |
70 | | - |
71 | | - @property |
72 | | - def version_triple(self): |
73 | | - return self._version_tripple |
74 | | - |
75 | | - |
76 | 46 | class VersionInfo: |
77 | 47 | def __init__(self, app, context, metadata, current_version_name): |
78 | 48 | self.app = app |
@@ -129,7 +99,7 @@ def in_development(self): |
129 | 99 | def __iter__(self): |
130 | 100 | yield from self.branches |
131 | 101 | yield from sorted( |
132 | | - self.tags, key=lambda t: ExasolVersionTag(t).version_triple, reverse=True |
| 102 | + self.tags, key=lambda t: ExasolVersion.from_string(t.name), reverse=True |
133 | 103 | ) |
134 | 104 |
|
135 | 105 | def __getitem__(self, name): |
@@ -283,7 +253,7 @@ def setup(app): |
283 | 253 | app.connect("config-inited", config_inited) |
284 | 254 |
|
285 | 255 | return { |
286 | | - "version": VERSION, |
| 256 | + "version": PLUGIN_VERSION, |
287 | 257 | "parallel_read_safe": True, |
288 | 258 | "parallel_write_safe": True, |
289 | 259 | } |
0 commit comments