From 16655c32d17a3e2a8f0c4c32ca0bff27c82b380c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 30 Nov 2025 21:15:32 +0000 Subject: [PATCH] feat: Add inferspect package and version retrieval Co-authored-by: david.frazer --- pyproject.toml | 3 +++ src/inferspect/__init__.py | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/inferspect/__init__.py diff --git a/pyproject.toml b/pyproject.toml index b943880..2d166d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,9 @@ version = "0.1.0" description = "Automation scripts supporting the InferSpect workflows" authors = ["InferSpect Maintainers "] readme = "README.md" +packages = [ + { include = "inferspect", from = "src" } +] [tool.poetry.dependencies] python = "^3.11" diff --git a/src/inferspect/__init__.py b/src/inferspect/__init__.py new file mode 100644 index 0000000..f5860e0 --- /dev/null +++ b/src/inferspect/__init__.py @@ -0,0 +1,18 @@ +"""InferSpect automation helpers exposed as a Python package.""" + +from __future__ import annotations + +from importlib import metadata +from importlib.metadata import PackageNotFoundError + +__all__ = ("get_package_version",) + + +def get_package_version() -> str: + """Return the installed InferSpect distribution version.""" + try: + return metadata.version("inferspect") + except PackageNotFoundError as exc: + raise RuntimeError( + "InferSpect package metadata not found. Install via `poetry install`." + ) from exc