From 450434c9b13ba1840b787d125b2fd7fb6ee41aa6 Mon Sep 17 00:00:00 2001 From: Alex Dewar Date: Tue, 28 May 2024 14:46:46 +0100 Subject: [PATCH] Use importlib to find package version --- myproject/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/myproject/__init__.py b/myproject/__init__.py index f8e068e..8a0eea9 100644 --- a/myproject/__init__.py +++ b/myproject/__init__.py @@ -1,3 +1,5 @@ """The main module for MyProject.""" -__version__ = "0.1.0" +from importlib.metadata import version + +__version__ = version(__name__)