From 3b8f51e8607f64b4b919df95807619533e0d504b Mon Sep 17 00:00:00 2001 From: Masaki Tagawa Date: Tue, 20 Jul 2021 21:45:05 +0900 Subject: [PATCH] Use `pyproject.toml` as the source of truth for version https://github.com/python-poetry/poetry/pull/2366?w=1#issuecomment-652418094 --- pyproject.toml | 1 + pysesame3/__init__.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8a0cee9..a7e209f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ packages = [ python = ">=3.6.1,<4.0" typing-extensions = { version = "^3.10.0.0", python = "<3.8" } +importlib-metadata = {version = "^1.0", python = "<3.8"} pycryptodome = { version = "^3.10.1" } requests = { version = "^2.25.1" } diff --git a/pysesame3/__init__.py b/pysesame3/__init__.py index 9324e5e..e54b252 100644 --- a/pysesame3/__init__.py +++ b/pysesame3/__init__.py @@ -1,4 +1,8 @@ """Top-level package for pysesame3.""" +try: + import importlib.metadata as importlib_metadata +except ModuleNotFoundError: + import importlib_metadata # type: ignore __author__ = """Masaki Tagawa""" -__version__ = "0.4.1" +__version__ = importlib_metadata.version(__name__)