diff options
| author | 2025-03-14 22:51:17 +0800 | |
|---|---|---|
| committer | 2025-03-14 22:51:17 +0800 | |
| commit | 1ddf2a5202e065a5df18dfa58a88faa5784a3f8c (patch) | |
| tree | 1baea0b98966dbb2d09ef3f05ccc8f404a56f842 /src | |
| parent | cb983cef66114056b7cc7988cd08039fc5b726b6 (diff) | |
| download | conventional_role_play-1ddf2a5202e065a5df18dfa58a88faa5784a3f8c.tar.gz conventional_role_play-1ddf2a5202e065a5df18dfa58a88faa5784a3f8c.zip | |
chore: bump version to 0.2.2 and update version retrieval method in __init__.pyv0.2.2
Diffstat (limited to 'src')
| -rw-r--r-- | src/conventionalrp/__init__.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/conventionalrp/__init__.py b/src/conventionalrp/__init__.py index 83ed8ce..bad6a58 100644 --- a/src/conventionalrp/__init__.py +++ b/src/conventionalrp/__init__.py @@ -1,5 +1,16 @@ from . import _core -from packaging.version import Version +__all__ = ["_core", "__version__"] -__version__ = Version('0.2.1') +from importlib.metadata import version +from pkg_resources import get_distribution + +try: + # For Python 3.8+ + __version__ = version("conventionalrp") +except ImportError: + try: + # For Python < 3.8 + __version__ = get_distribution("conventionalrp").version + except Exception: + raise ImportError("Failed to get version") |
