From 942c764f4725de6c302c9d45bb3f656d32790e88 Mon Sep 17 00:00:00 2001 From: Joshua Charkow Date: Thu, 26 Mar 2026 15:04:37 -0400 Subject: [PATCH 1/2] add version number add version number to __init__ as __version__ variable. This allows for displaying the version in the interactive contexts e.g. jupyter notebook. --- pyprophet/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyprophet/__init__.py b/pyprophet/__init__.py index e69de29b..fb460ae5 100644 --- a/pyprophet/__init__.py +++ b/pyprophet/__init__.py @@ -0,0 +1 @@ +__version__='3.0.10' From 2c36659168da4b05bba672e32eb8edf8451eb3a5 Mon Sep 17 00:00:00 2001 From: Joshua Charkow Date: Thu, 26 Mar 2026 16:31:08 -0400 Subject: [PATCH 2/2] detect version automatically --- pyprophet/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pyprophet/__init__.py b/pyprophet/__init__.py index fb460ae5..acff3bb3 100644 --- a/pyprophet/__init__.py +++ b/pyprophet/__init__.py @@ -1 +1,10 @@ -__version__='3.0.10' +from importlib.metadata import PackageNotFoundError, version + +def _detect_version() -> str: + """Return the installed package version""" + try: + return version("pyprophet") + except PackageNotFoundError: + return "0+unknown" + +__version__ = _detect_version()