|
1 | | -########################################################################## |
2 | | -# rtlpy is a open-source utility library for RTL developers # |
3 | | -# Copyright (C) 2024, RISCY-Lib Contributors # |
4 | | -# # |
5 | | -# This program is free software: you can redistribute it and/or modify # |
6 | | -# it under the terms of the GNU General Public License as published by # |
7 | | -# the Free Software Foundation, either version 3 of the License, or # |
8 | | -# (at your option) any later version. # |
9 | | -# # |
10 | | -# This program is distributed in the hope that it will be useful, # |
11 | | -# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
12 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
13 | | -# GNU General Public License for more details. # |
14 | | -# # |
15 | | -# You should have received a copy of the GNU General Public License # |
16 | | -# along with this program. If not, see <https://www.gnu.org/licenses/>. # |
17 | | -########################################################################## |
18 | | - |
| 1 | +#################################################################################################### |
| 2 | +# rtlpy is a open-source utility library for RTL developers # |
| 3 | +# Copyright (C) 2022, RISCY-Lib Contributors # |
| 4 | +# # |
| 5 | +# This program is free software: you can redistribute it and/or modify # |
| 6 | +# it under the terms of the GNU General Public License as published by # |
| 7 | +# the Free Software Foundation, either version 3 of the License, or # |
| 8 | +# (at your option) any later version. # |
| 9 | +# # |
| 10 | +# This program is distributed in the hope that it will be useful, # |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 13 | +# GNU General Public License for more details. # |
| 14 | +# # |
| 15 | +# You should have received a copy of the GNU General Public License # |
| 16 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. # |
| 17 | +#################################################################################################### |
19 | 18 |
|
20 | 19 | from __future__ import annotations |
| 20 | +from typing import NamedTuple, Literal |
| 21 | + |
| 22 | + |
| 23 | +__all__ = [ |
| 24 | + "__version__", |
| 25 | + "__author__", |
| 26 | + "version_info", |
| 27 | +] |
| 28 | + |
| 29 | + |
| 30 | +class _VersionInfo(NamedTuple): |
| 31 | + |
| 32 | + major: int |
| 33 | + minor: int |
| 34 | + micro: int |
| 35 | + releaseLevel: Literal["alpha", "beta", "candidate", "final"] |
| 36 | + serial: int |
| 37 | + |
| 38 | + |
| 39 | +version_info: _VersionInfo = _VersionInfo( |
| 40 | + major=2, |
| 41 | + minor=0, |
| 42 | + micro=0, |
| 43 | + releaseLevel="beta", |
| 44 | + serial=1, |
| 45 | +) |
21 | 46 |
|
| 47 | +if version_info.releaseLevel == "final": |
| 48 | + __version__: str = f"{version_info.major}." + \ |
| 49 | + f"{version_info.minor}." + \ |
| 50 | + f"{version_info.micro}" |
| 51 | +else: |
| 52 | + __version__: str = f"{version_info.major}." + \ |
| 53 | + f"{version_info.minor}." + \ |
| 54 | + f"{version_info.micro}" + \ |
| 55 | + f"-{version_info.releaseLevel[0]}{version_info.serial}" |
22 | 56 |
|
23 | | -__version__: str = "2.0.0-b1" |
24 | | -__author__: str = "RISCY-Lib Contributors" |
| 57 | +__author__ = "RISCY-Lib Contributors" |
| 58 | +__license__ = "GPL-3.0-or-later" |
0 commit comments