dirsql 0.3.13__tar.gz → 0.3.15__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.
- {dirsql-0.3.13 → dirsql-0.3.15}/Cargo.lock +1 -1
- {dirsql-0.3.13 → dirsql-0.3.15}/PKG-INFO +1 -1
- {dirsql-0.3.13/dirsql/_cli → dirsql-0.3.15/dirsql/cli}/__init__.py +1 -1
- {dirsql-0.3.13/dirsql/_cli → dirsql-0.3.15/dirsql/cli}/binary_path.py +1 -1
- dirsql-0.3.15/dirsql/cli/binary_path_test.py +51 -0
- dirsql-0.3.15/dirsql/cli/is_windows.py +9 -0
- dirsql-0.3.15/dirsql/cli/is_windows_test.py +20 -0
- {dirsql-0.3.13/dirsql/_cli → dirsql-0.3.15/dirsql/cli}/main.py +3 -3
- dirsql-0.3.15/dirsql/cli/main_test.py +87 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/Cargo.toml +1 -1
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/conftest.py +1 -1
- {dirsql-0.3.13 → dirsql-0.3.15}/pyproject.toml +3 -11
- dirsql-0.3.13/dirsql/_cli/is_windows.py +0 -10
- {dirsql-0.3.13 → dirsql-0.3.15}/Cargo.toml +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/README.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/dirsql/__init__.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/dirsql/_async.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/dirsql/resolve_config.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/dirsql/resolve_config_test.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/dirsql/test_async.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/.vitepress/config.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/AGENTS.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/api/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/cli/config.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/cli/http-api.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/cli/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/cli/init.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/cli/server.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/getting-started.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/guide/async.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/guide/crdt.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/guide/persistence.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/guide/querying.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/guide/tables.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/guide/watching.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/migrations.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/package.json +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/playwright.config.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/docs/vitest.config.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/README.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/.vitepress/config.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/AGENTS.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/api/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/cli/config.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/cli/http-api.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/cli/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/cli/init.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/cli/server.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/getting-started.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/guide/async.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/guide/crdt.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/guide/persistence.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/guide/querying.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/guide/tables.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/guide/watching.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/migrations.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/package.json +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/playwright.config.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/vitest.config.ts +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/src/lib.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/__init__.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/conftest.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/e2e/__init__.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/__init__.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_async_dirsql.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_binding.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_dirsql.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_docs_examples.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_docs_gaps.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_from_config.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_persist.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/python/tests/integration/test_serialization.py +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/Cargo.toml +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/README.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/benches/db_bench.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/benches/differ_bench.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/benches/matcher_bench.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/benches/scanner_bench.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/api/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/cli/config.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/cli/http-api.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/cli/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/cli/init.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/cli/server.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/getting-started.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/guide/async.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/guide/crdt.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/guide/persistence.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/guide/querying.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/guide/tables.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/guide/watching.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/index.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/docs/migrations.md +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/bin/dirsql.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/cli/init.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/cli/mod.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/cli/router.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/cli/serialize.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/cli/server.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/config.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/db.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/differ.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/lib.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/matcher.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/persist.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/scanner.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/src/watcher.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/async_sdk.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/cli_e2e.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/cli_integration.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/docs_examples.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/docs_gaps.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/from_config.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/init_e2e.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/init_integration.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/persist.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/readonly_query.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/sdk.rs +0 -0
- {dirsql-0.3.13 → dirsql-0.3.15}/packages/rust/tests/serialization.rs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""CLI launcher package.
|
|
2
2
|
|
|
3
3
|
The ``dirsql`` console-script entry resolves to
|
|
4
|
-
``dirsql.
|
|
4
|
+
``dirsql.cli.main:main``. See each submodule for the individual
|
|
5
5
|
functions: :mod:`is_windows`, :mod:`binary_path`, :mod:`main`.
|
|
6
6
|
"""
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Unit tests for `binary_path`."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from unittest.mock import patch
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
8
|
+
from dirsql.cli import binary_path as bp_module
|
|
9
|
+
from dirsql.cli.binary_path import binary_path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _stage_binary(root: Path, name: str) -> Path:
|
|
13
|
+
binary_dir = root / "_binary"
|
|
14
|
+
binary_dir.mkdir()
|
|
15
|
+
target = binary_dir / name
|
|
16
|
+
target.write_text("")
|
|
17
|
+
return target
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def describe_binary_path():
|
|
21
|
+
def it_returns_the_dirsql_path_on_posix(tmp_path: Path):
|
|
22
|
+
target = _stage_binary(tmp_path, "dirsql")
|
|
23
|
+
with (
|
|
24
|
+
patch.object(bp_module, "is_windows", return_value=False),
|
|
25
|
+
patch.object(bp_module, "files", return_value=tmp_path),
|
|
26
|
+
):
|
|
27
|
+
assert binary_path() == str(target)
|
|
28
|
+
|
|
29
|
+
def it_returns_the_dirsql_exe_path_on_windows(tmp_path: Path):
|
|
30
|
+
target = _stage_binary(tmp_path, "dirsql.exe")
|
|
31
|
+
with (
|
|
32
|
+
patch.object(bp_module, "is_windows", return_value=True),
|
|
33
|
+
patch.object(bp_module, "files", return_value=tmp_path),
|
|
34
|
+
):
|
|
35
|
+
assert binary_path() == str(target)
|
|
36
|
+
|
|
37
|
+
def it_raises_file_not_found_when_the_posix_binary_is_missing(tmp_path: Path):
|
|
38
|
+
with (
|
|
39
|
+
patch.object(bp_module, "is_windows", return_value=False),
|
|
40
|
+
patch.object(bp_module, "files", return_value=tmp_path),
|
|
41
|
+
pytest.raises(FileNotFoundError, match="bundled `dirsql` not found"),
|
|
42
|
+
):
|
|
43
|
+
binary_path()
|
|
44
|
+
|
|
45
|
+
def it_raises_file_not_found_when_the_windows_binary_is_missing(tmp_path: Path):
|
|
46
|
+
with (
|
|
47
|
+
patch.object(bp_module, "is_windows", return_value=True),
|
|
48
|
+
patch.object(bp_module, "files", return_value=tmp_path),
|
|
49
|
+
pytest.raises(FileNotFoundError, match="bundled `dirsql.exe` not found"),
|
|
50
|
+
):
|
|
51
|
+
binary_path()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Unit tests for `is_windows`."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from unittest.mock import patch
|
|
5
|
+
|
|
6
|
+
from dirsql.cli.is_windows import is_windows
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def describe_is_windows():
|
|
10
|
+
def it_returns_true_when_os_name_is_nt():
|
|
11
|
+
with patch.object(os, "name", "nt"):
|
|
12
|
+
assert is_windows() is True
|
|
13
|
+
|
|
14
|
+
def it_returns_false_when_os_name_is_posix():
|
|
15
|
+
with patch.object(os, "name", "posix"):
|
|
16
|
+
assert is_windows() is False
|
|
17
|
+
|
|
18
|
+
def it_returns_false_when_os_name_is_anything_else():
|
|
19
|
+
with patch.object(os, "name", "java"):
|
|
20
|
+
assert is_windows() is False
|
|
@@ -7,8 +7,8 @@ import os
|
|
|
7
7
|
import subprocess
|
|
8
8
|
import sys
|
|
9
9
|
|
|
10
|
-
from dirsql.
|
|
11
|
-
from dirsql.
|
|
10
|
+
from dirsql.cli.binary_path import binary_path
|
|
11
|
+
from dirsql.cli.is_windows import is_windows
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def main(argv: list[str] | None = None) -> int:
|
|
@@ -24,4 +24,4 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
24
24
|
completed = subprocess.run([binary, *argv])
|
|
25
25
|
return completed.returncode
|
|
26
26
|
os.execv(binary, [binary, *argv])
|
|
27
|
-
return 0
|
|
27
|
+
return 0
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""Unit tests for the launcher's `main`."""
|
|
2
|
+
|
|
3
|
+
import io
|
|
4
|
+
import os
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
from unittest.mock import patch
|
|
8
|
+
|
|
9
|
+
from dirsql.cli import main as main_module
|
|
10
|
+
from dirsql.cli.main import main
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class _Completed:
|
|
14
|
+
def __init__(self, returncode: int):
|
|
15
|
+
self.returncode = returncode
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def describe_main():
|
|
19
|
+
def describe_when_binary_path_raises_file_not_found():
|
|
20
|
+
def it_returns_1_and_writes_a_dirsql_prefixed_message_to_stderr():
|
|
21
|
+
fake_stderr = io.StringIO()
|
|
22
|
+
with (
|
|
23
|
+
patch.object(
|
|
24
|
+
main_module,
|
|
25
|
+
"binary_path",
|
|
26
|
+
side_effect=FileNotFoundError("bundled `dirsql` missing"),
|
|
27
|
+
),
|
|
28
|
+
patch.object(sys, "stderr", fake_stderr),
|
|
29
|
+
):
|
|
30
|
+
assert main([]) == 1
|
|
31
|
+
assert fake_stderr.getvalue() == "dirsql: bundled `dirsql` missing\n"
|
|
32
|
+
|
|
33
|
+
def describe_on_windows():
|
|
34
|
+
def it_runs_the_binary_via_subprocess_and_returns_its_returncode():
|
|
35
|
+
with (
|
|
36
|
+
patch.object(main_module, "binary_path", return_value="C:/dirsql.exe"),
|
|
37
|
+
patch.object(main_module, "is_windows", return_value=True),
|
|
38
|
+
patch.object(subprocess, "run", return_value=_Completed(7)) as run,
|
|
39
|
+
):
|
|
40
|
+
assert main(["--version"]) == 7
|
|
41
|
+
run.assert_called_once_with(["C:/dirsql.exe", "--version"])
|
|
42
|
+
|
|
43
|
+
def it_does_not_invoke_execv():
|
|
44
|
+
with (
|
|
45
|
+
patch.object(main_module, "binary_path", return_value="C:/dirsql.exe"),
|
|
46
|
+
patch.object(main_module, "is_windows", return_value=True),
|
|
47
|
+
patch.object(subprocess, "run", return_value=_Completed(0)),
|
|
48
|
+
patch.object(os, "execv") as execv,
|
|
49
|
+
):
|
|
50
|
+
main([])
|
|
51
|
+
execv.assert_not_called()
|
|
52
|
+
|
|
53
|
+
def describe_on_posix():
|
|
54
|
+
def it_hands_off_to_execv_with_the_binary_argv_pair():
|
|
55
|
+
with (
|
|
56
|
+
patch.object(
|
|
57
|
+
main_module, "binary_path", return_value="/usr/local/bin/dirsql"
|
|
58
|
+
),
|
|
59
|
+
patch.object(main_module, "is_windows", return_value=False),
|
|
60
|
+
patch.object(os, "execv") as execv,
|
|
61
|
+
):
|
|
62
|
+
main(["query", "select 1"])
|
|
63
|
+
execv.assert_called_once_with(
|
|
64
|
+
"/usr/local/bin/dirsql",
|
|
65
|
+
["/usr/local/bin/dirsql", "query", "select 1"],
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def it_returns_0_when_execv_returns():
|
|
69
|
+
# In production `os.execv` never returns. The mock returns,
|
|
70
|
+
# so `main` falls through to `return 0`.
|
|
71
|
+
with (
|
|
72
|
+
patch.object(main_module, "binary_path", return_value="/bin/dirsql"),
|
|
73
|
+
patch.object(main_module, "is_windows", return_value=False),
|
|
74
|
+
patch.object(os, "execv"),
|
|
75
|
+
):
|
|
76
|
+
assert main([]) == 0
|
|
77
|
+
|
|
78
|
+
def describe_when_argv_is_none():
|
|
79
|
+
def it_pulls_from_sys_argv_skipping_the_program_name():
|
|
80
|
+
with (
|
|
81
|
+
patch.object(sys, "argv", ["dirsql", "--help"]),
|
|
82
|
+
patch.object(main_module, "binary_path", return_value="C:/dirsql.exe"),
|
|
83
|
+
patch.object(main_module, "is_windows", return_value=True),
|
|
84
|
+
patch.object(subprocess, "run", return_value=_Completed(0)) as run,
|
|
85
|
+
):
|
|
86
|
+
main(argv=None)
|
|
87
|
+
run.assert_called_once_with(["C:/dirsql.exe", "--help"])
|
|
@@ -4,7 +4,7 @@ name = "dirsql-py-ext"
|
|
|
4
4
|
# pypi/maturin handler can rewrite it via `write-version` before
|
|
5
5
|
# `maturin build`. `pyproject.toml` declares `dynamic = ["version"]`
|
|
6
6
|
# and maturin reads this field. Mirrors `packages/rust/Cargo.toml`.
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.15"
|
|
8
8
|
edition.workspace = true
|
|
9
9
|
publish = false
|
|
10
10
|
readme = "README.md"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Stub the compiled `_dirsql` extension for unit tests that don't need it.
|
|
2
2
|
|
|
3
|
-
`
|
|
3
|
+
`cli_test.py` exercises the pure-Python launcher; it must be runnable
|
|
4
4
|
without `maturin develop` having built the PyO3 extension. We stub the
|
|
5
5
|
missing module here (rather than in the test file) so the stub is in
|
|
6
6
|
place before pytest imports `dirsql.__init__`, which transitively
|
|
@@ -30,7 +30,7 @@ dev = [
|
|
|
30
30
|
]
|
|
31
31
|
|
|
32
32
|
[project.scripts]
|
|
33
|
-
dirsql = "dirsql.
|
|
33
|
+
dirsql = "dirsql.cli.main:main"
|
|
34
34
|
|
|
35
35
|
[tool.maturin]
|
|
36
36
|
features = ["extension-module"]
|
|
@@ -57,22 +57,14 @@ include = [
|
|
|
57
57
|
]
|
|
58
58
|
manifest-path = "packages/python/Cargo.toml"
|
|
59
59
|
|
|
60
|
-
# CLI launcher shims (`_cli/main.py`, `_cli/binary_path.py`,
|
|
61
|
-
# `_cli/is_windows.py`) that locate and exec the bundled Rust binary --
|
|
62
|
-
# the Python analogue of the excluded `src/bin/` Rust launcher. The
|
|
63
|
-
# AGENTS.md test-boundary rules forbid monkeypatch unit tests on
|
|
64
|
-
# production module attributes (`os.execv`, `binary_path`, etc.) -- the
|
|
65
|
-
# load-bearing line is the `os.execv` hand-off, whose only meaningful
|
|
66
|
-
# coverage is end-to-end (real wheel install + `dirsql --version`),
|
|
67
|
-
# verified by putitoutthere's wheel-content guard post-build. Omitting
|
|
68
|
-
# these files keeps the 100% coverage floor honest about library code.
|
|
69
60
|
[tool.coverage.run]
|
|
70
61
|
omit = [
|
|
71
|
-
"dirsql/_cli/*",
|
|
72
62
|
# Colocated unit tests live alongside the package source; instrumenting
|
|
73
63
|
# them lets a test double's own branches pad the metric (e.g. a fake's
|
|
74
64
|
# empty-list return). Exclude test files so the floor reflects only
|
|
75
65
|
# library code.
|
|
76
66
|
"dirsql/test_*.py",
|
|
77
67
|
"dirsql/*_test.py",
|
|
68
|
+
"dirsql/cli/test_*.py",
|
|
69
|
+
"dirsql/cli/*_test.py",
|
|
78
70
|
]
|
|
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
|
|
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
|
{dirsql-0.3.13 → dirsql-0.3.15}/packages/python/docs/tests/integration/language-flag.spec.ts
RENAMED
|
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
|
|
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
|