refactor: centralize versioning and stabilize PMA validation

This commit is contained in:
Miha Kralj
2026-03-01 14:07:14 -08:00
parent 19df6763a9
commit 07054ae20a
11 changed files with 42 additions and 80 deletions
-1
View File
@@ -1,6 +1,5 @@
<Project>
<PropertyGroup>
<GitVersionSkip>true</GitVersionSkip>
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
<RunAnalyzers>false</RunAnalyzers>
<ErrorReport>none</ErrorReport>
-1
View File
@@ -525,7 +525,6 @@ When pandas is not installed:
```xml
<Project>
<PropertyGroup>
<GitVersionSkip>true</GitVersionSkip>
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
<RunAnalyzers>false</RunAnalyzers>
<ErrorReport>none</ErrorReport>
+6 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "quantalib"
version = "0.1.0"
dynamic = ["version"]
description = "High-performance technical analysis wrappers over QuanTAlib NativeAOT"
readme = "README.md"
requires-python = ">=3.10"
@@ -23,6 +23,11 @@ filterwarnings = [
"ignore::pandas.errors.Pandas4Warning",
]
[tool.hatch.version]
source = "regex"
path = "../lib/VERSION"
pattern = "(?P<version>\\d+\\.\\d+\\.\\d+)"
[tool.hatch.build.targets.wheel]
packages = ["quantalib"]
+12 -1
View File
@@ -9,6 +9,8 @@ Usage::
"""
from __future__ import annotations
from pathlib import Path
from ._loader import load_native_library
from . import indicators
from .indicators import * # noqa: F401, F403 — re-export all indicator functions
@@ -32,4 +34,13 @@ __all__ = [
"QtlInvalidParamError",
"QtlInternalError",
]
__version__ = "0.1.0"
def _resolve_version() -> str:
version_file = Path(__file__).resolve().parents[2] / "lib" / "VERSION"
if version_file.exists():
version = version_file.read_text(encoding="utf-8").strip()
if version:
return version
return "0.0.0"
__version__ = _resolve_version()