xconv2 0.1.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
xconv2/__init__.py ADDED
@@ -0,0 +1,24 @@
1
+ """xconv2 package."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ import tomllib
7
+
8
+
9
+ def _project_version() -> str:
10
+ """Read package version from pyproject.toml with a safe fallback."""
11
+ pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml"
12
+ try:
13
+ data = tomllib.loads(pyproject.read_text(encoding="utf-8"))
14
+ version = data.get("project", {}).get("version")
15
+ if isinstance(version, str) and version.strip():
16
+ return version.strip()
17
+ except OSError:
18
+ pass
19
+ except tomllib.TOMLDecodeError:
20
+ pass
21
+ return "0.0.0"
22
+
23
+
24
+ __version__ = f"alpha-{_project_version()}"
Binary file
Binary file