opencode-db 0.8.2__tar.gz → 0.8.3__tar.gz
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.
- {opencode_db-0.8.2/opencode_db.egg-info → opencode_db-0.8.3}/PKG-INFO +2 -1
- {opencode_db-0.8.2 → opencode_db-0.8.3}/README.md +2 -1
- {opencode_db-0.8.2 → opencode_db-0.8.3}/docs/README_PYPI.md +1 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/cli.py +6 -0
- opencode_db-0.8.3/opencode_db/version.py +25 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3/opencode_db.egg-info}/PKG-INFO +2 -1
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db.egg-info/SOURCES.txt +3 -1
- {opencode_db-0.8.2 → opencode_db-0.8.3}/pyproject.toml +1 -1
- opencode_db-0.8.3/tests/test_version.py +22 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/LICENSE +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/__init__.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/__main__.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/__init__.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_costs.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_delete.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_directories.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_export.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_help.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_info.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_list.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_projects.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_prune.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_schema.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_search.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_stats.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_todos.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_tree.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_vacuum.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/commands/cmd_view.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/config.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/db.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/formatters.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/i18n.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/markdown_to_ansi.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/runtime.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/schema.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/schema_manifest.json +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/store/__init__.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/store/base.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/store/v1.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/store/v2.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db/utils.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db.egg-info/dependency_links.txt +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db.egg-info/entry_points.txt +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db.egg-info/requires.txt +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/opencode_db.egg-info/top_level.txt +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/setup.cfg +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_commands.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_db.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_formatters.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_i18n.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_runtime.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_schema.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_store_v2.py +0 -0
- {opencode_db-0.8.2 → opencode_db-0.8.3}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencode-db
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3
|
|
4
4
|
Summary: OpenCode database CLI manager — browse, export, analyze, clean up sessions
|
|
5
5
|
Project-URL: Homepage, https://github.com/VasilevNStas/opencode-db
|
|
6
6
|
Project-URL: Source, https://github.com/VasilevNStas/opencode-db
|
|
@@ -31,6 +31,7 @@ uv tool install opencode-db
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
+
opencode-db --version # installed version
|
|
34
35
|
opencode-db list # recent sessions
|
|
35
36
|
opencode-db directories # launch directories, including missing ones
|
|
36
37
|
opencode-db view # interactive session viewer (colored, scrollable)
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
> **Published on PyPI:** [opencode-db](https://pypi.org/project/opencode-db/) — install the ready-made package with `uv tool install opencode-db` or `pip install opencode-db`.
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
+
opencode-db --version # installed version
|
|
16
17
|
opencode-db help # full reference with examples
|
|
17
18
|
opencode-db list # list recent sessions
|
|
18
19
|
opencode-db stats # database summary
|
|
@@ -810,7 +811,7 @@ source .venv/bin/activate
|
|
|
810
811
|
uv pip install -e ".[rich]"
|
|
811
812
|
uv pip install pytest ruff==0.17.1
|
|
812
813
|
|
|
813
|
-
make check # check-python + ruff +
|
|
814
|
+
make check # check-python + ruff + 216 tests
|
|
814
815
|
```
|
|
815
816
|
|
|
816
817
|
`make check` fails fast with a clear message if the active interpreter is older than 3.12.
|
|
@@ -15,6 +15,7 @@ uv tool install opencode-db
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
+
opencode-db --version # installed version
|
|
18
19
|
opencode-db list # recent sessions
|
|
19
20
|
opencode-db directories # launch directories, including missing ones
|
|
20
21
|
opencode-db view # interactive session viewer (colored, scrollable)
|
|
@@ -21,6 +21,7 @@ require_python()
|
|
|
21
21
|
from . import commands # noqa: E402
|
|
22
22
|
from .db import get_db # noqa: E402
|
|
23
23
|
from .i18n import _, set_lang # noqa: E402
|
|
24
|
+
from .version import get_version # noqa: E402
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
def build_parser() -> argparse.ArgumentParser:
|
|
@@ -41,6 +42,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
41
42
|
default=None,
|
|
42
43
|
help="Path to opencode.db (default: ~/.local/share/opencode/opencode.db)",
|
|
43
44
|
)
|
|
45
|
+
parser.add_argument(
|
|
46
|
+
"--version",
|
|
47
|
+
action="version",
|
|
48
|
+
version=f"%(prog)s {get_version()}",
|
|
49
|
+
)
|
|
44
50
|
|
|
45
51
|
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
46
52
|
seen: set[str] = set()
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Version lookup for the installed package and source checkouts."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import tomllib
|
|
6
|
+
from functools import lru_cache
|
|
7
|
+
from importlib.metadata import PackageNotFoundError
|
|
8
|
+
from importlib.metadata import version as package_version
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@lru_cache(maxsize=1)
|
|
13
|
+
def get_version() -> str:
|
|
14
|
+
"""Return the installed package version, with a source-tree fallback."""
|
|
15
|
+
try:
|
|
16
|
+
return package_version("opencode-db")
|
|
17
|
+
except PackageNotFoundError:
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
pyproject = Path(__file__).resolve().parents[1] / "pyproject.toml"
|
|
21
|
+
try:
|
|
22
|
+
data = tomllib.loads(pyproject.read_text(encoding="utf-8"))
|
|
23
|
+
return str(data["project"]["version"])
|
|
24
|
+
except (OSError, KeyError, TypeError, tomllib.TOMLDecodeError):
|
|
25
|
+
return "unknown"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opencode-db
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3
|
|
4
4
|
Summary: OpenCode database CLI manager — browse, export, analyze, clean up sessions
|
|
5
5
|
Project-URL: Homepage, https://github.com/VasilevNStas/opencode-db
|
|
6
6
|
Project-URL: Source, https://github.com/VasilevNStas/opencode-db
|
|
@@ -31,6 +31,7 @@ uv tool install opencode-db
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
+
opencode-db --version # installed version
|
|
34
35
|
opencode-db list # recent sessions
|
|
35
36
|
opencode-db directories # launch directories, including missing ones
|
|
36
37
|
opencode-db view # interactive session viewer (colored, scrollable)
|
|
@@ -14,6 +14,7 @@ opencode_db/runtime.py
|
|
|
14
14
|
opencode_db/schema.py
|
|
15
15
|
opencode_db/schema_manifest.json
|
|
16
16
|
opencode_db/utils.py
|
|
17
|
+
opencode_db/version.py
|
|
17
18
|
opencode_db.egg-info/PKG-INFO
|
|
18
19
|
opencode_db.egg-info/SOURCES.txt
|
|
19
20
|
opencode_db.egg-info/dependency_links.txt
|
|
@@ -48,4 +49,5 @@ tests/test_i18n.py
|
|
|
48
49
|
tests/test_runtime.py
|
|
49
50
|
tests/test_schema.py
|
|
50
51
|
tests/test_store_v2.py
|
|
51
|
-
tests/test_utils.py
|
|
52
|
+
tests/test_utils.py
|
|
53
|
+
tests/test_version.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "opencode-db"
|
|
7
|
-
version = "0.8.
|
|
7
|
+
version = "0.8.3"
|
|
8
8
|
description = "OpenCode database CLI manager — browse, export, analyze, clean up sessions"
|
|
9
9
|
readme = "docs/README_PYPI.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from opencode_db.version import get_version
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_get_version_returns_a_version() -> None:
|
|
9
|
+
value = get_version()
|
|
10
|
+
assert value == "unknown" or re.fullmatch(r"\d+\.\d+\.\d+(?:[.\-+][0-9A-Za-z.\-+]+)?", value)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_version_flag_prints_version(capsys) -> None:
|
|
14
|
+
from opencode_db.cli import build_parser
|
|
15
|
+
|
|
16
|
+
parser = build_parser()
|
|
17
|
+
with pytest.raises(SystemExit) as exc:
|
|
18
|
+
parser.parse_args(["--version"])
|
|
19
|
+
|
|
20
|
+
assert exc.value.code == 0
|
|
21
|
+
output = capsys.readouterr().out.strip()
|
|
22
|
+
assert output == f"opencode-db {get_version()}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|