diff --git a/glances/__init__.py b/glances/__init__.py index 2683afd1..7b7b2908 100644 --- a/glances/__init__.py +++ b/glances/__init__.py @@ -15,15 +15,11 @@ import platform import signal import sys import tracemalloc -from importlib import metadata # Global name # Version should start and end with a numerical char # See https://packaging.python.org/specifications/core-metadata/#version -try: - __version__ = metadata.version("glances") -except metadata.PackageNotFoundError: - __version__ = "0.0.0+unknown" +__version__ = "4.3.0_dev02" __apiversion__ = '4' __author__ = 'Nicolas Hennion ' __license__ = 'LGPLv3' diff --git a/pyproject.toml b/pyproject.toml index 31b1f757..09a99fe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,13 +29,13 @@ dependencies = [ "requests; platform_system == 'Windows'", ] description = "A cross-platform curses-based monitoring tool" +dynamic = ["version"] keywords = ["cli", "curses", "monitoring", "system"] license = {text = "LGPLv3"} name = "Glances" readme = "README.rst" requires-python = ">=3.8" urls.Homepage = "https://github.com/nicolargo/glances" -version = "4.3.0_dev02" [project.optional-dependencies] action = ["chevron"] @@ -86,6 +86,9 @@ glances = "glances:main" ] "share/man/man1" = ["docs/man/glances.1"] +[tool.setuptools.dynamic] +version = { attr = "glances.__version__" } + [tool.setuptools.packages.find] include = ["glances*"]