vith 0.9.0__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.
vith/__init__.py ADDED
@@ -0,0 +1,25 @@
1
+ """
2
+ vith: A pure-Python Vi clone with Thai & Lao script support.
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+ import re
8
+ from importlib.metadata import PackageNotFoundError, version
9
+ from pathlib import Path
10
+
11
+ # In a development checkout (e.g. repo root), read directly from pyproject.toml
12
+ # so editing the version requires touching only pyproject.toml:
13
+ _pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml"
14
+ if _pyproject.is_file():
15
+ _m = re.search(
16
+ r'(?m)^version\s*=\s*["\']([^"\']+)["\']', _pyproject.read_text(encoding="utf-8")
17
+ )
18
+ __version__ = _m.group(1) if _m else "0.9.0"
19
+ else:
20
+ try:
21
+ __version__ = version("vith")
22
+ except PackageNotFoundError:
23
+ __version__ = "0.9.0"
24
+
25
+ __all__ = ("__version__",)
vith/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ """
2
+ Make `python -m vith` an alias for running `vith`.
3
+ """
4
+
5
+ from .entry_points.run_vith import run
6
+
7
+ run()
File without changes