libcontext 0.7.4__tar.gz → 0.7.5__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.
- {libcontext-0.7.4 → libcontext-0.7.5}/PKG-INFO +1 -1
- {libcontext-0.7.4 → libcontext-0.7.5}/pyproject.toml +1 -1
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/_envsetup.py +9 -3
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_envsetup.py +26 -3
- {libcontext-0.7.4 → libcontext-0.7.5}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/.github/workflows/ci.yml +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/.github/workflows/release.yml +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/.gitignore +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/CHANGELOG.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/CONTRIBUTING.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/DEPENDENCIES.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/LICENSE +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/README.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/SECURITY.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/docs/adr/001-progressive-disclosure-over-always-on-context.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/docs/adr/002-skill-plus-cli-as-primary-integration.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/docs/adr/004-ast-only-inspection.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/docs/adr/README.md +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/__init__.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/_security.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/cache.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/cli.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/collector.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/config.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/diff.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/exceptions.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/inspector.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/mcp_server.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/models.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/py.typed +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/src/libcontext/renderer.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/__init__.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_cache.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_cli.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_cli_mcp_parity.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_collector.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_config.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_diff.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_inspector.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_mcp_server.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_models.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_renderer.py +0 -0
- {libcontext-0.7.4 → libcontext-0.7.5}/tests/test_security.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libcontext
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.5
|
|
4
4
|
Summary: Generate optimized LLM context from Python library APIs — CLI, skill, and MCP server
|
|
5
5
|
Project-URL: Homepage, https://github.com/Syclaw/libcontext
|
|
6
6
|
Project-URL: Repository, https://github.com/Syclaw/libcontext
|
|
@@ -317,11 +317,17 @@ def resolve_python_executable(python_arg: str) -> Path:
|
|
|
317
317
|
in the standard locations (``Scripts/python.exe`` on Windows,
|
|
318
318
|
``bin/python`` on Unix).
|
|
319
319
|
|
|
320
|
+
Returns an absolute path **without following symlinks**. This is
|
|
321
|
+
critical for venv interpreters: Python discovers ``pyvenv.cfg``
|
|
322
|
+
relative to the symlink location, not the symlink target. Following
|
|
323
|
+
the symlink would resolve to a global interpreter that lacks the
|
|
324
|
+
venv's ``site-packages``.
|
|
325
|
+
|
|
320
326
|
Args:
|
|
321
327
|
python_arg: Path to a Python interpreter or venv directory.
|
|
322
328
|
|
|
323
329
|
Returns:
|
|
324
|
-
|
|
330
|
+
Absolute path to the Python executable (symlinks preserved).
|
|
325
331
|
|
|
326
332
|
Raises:
|
|
327
333
|
EnvironmentSetupError: If the path does not exist or no
|
|
@@ -337,7 +343,7 @@ def resolve_python_executable(python_arg: str) -> Path:
|
|
|
337
343
|
|
|
338
344
|
# Direct path to an executable
|
|
339
345
|
if path.is_file():
|
|
340
|
-
return path.
|
|
346
|
+
return path.absolute()
|
|
341
347
|
|
|
342
348
|
# Directory — probe for interpreter
|
|
343
349
|
if path.is_dir():
|
|
@@ -348,7 +354,7 @@ def resolve_python_executable(python_arg: str) -> Path:
|
|
|
348
354
|
python_arg,
|
|
349
355
|
candidate,
|
|
350
356
|
)
|
|
351
|
-
return candidate.
|
|
357
|
+
return candidate.absolute()
|
|
352
358
|
|
|
353
359
|
raise EnvironmentSetupError(
|
|
354
360
|
python_arg,
|
|
@@ -22,9 +22,9 @@ from libcontext.exceptions import EnvironmentSetupError
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def test_resolve_direct_interpreter():
|
|
25
|
-
"""Passing the current interpreter returns
|
|
25
|
+
"""Passing the current interpreter returns an absolute path."""
|
|
26
26
|
result = resolve_python_executable(sys.executable)
|
|
27
|
-
assert result == Path(sys.executable).
|
|
27
|
+
assert result == Path(sys.executable).absolute()
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
def test_resolve_venv_directory(tmp_path):
|
|
@@ -40,7 +40,30 @@ def test_resolve_venv_directory(tmp_path):
|
|
|
40
40
|
|
|
41
41
|
exe.write_text("fake", encoding="utf-8")
|
|
42
42
|
result = resolve_python_executable(str(tmp_path))
|
|
43
|
-
assert result == exe.
|
|
43
|
+
assert result == exe.absolute()
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def test_resolve_preserves_symlink(tmp_path):
|
|
47
|
+
"""Symlinked interpreter must not be resolved to the target."""
|
|
48
|
+
if sys.platform == "win32":
|
|
49
|
+
scripts = tmp_path / "Scripts"
|
|
50
|
+
scripts.mkdir()
|
|
51
|
+
link = scripts / "python.exe"
|
|
52
|
+
else:
|
|
53
|
+
bin_dir = tmp_path / "bin"
|
|
54
|
+
bin_dir.mkdir()
|
|
55
|
+
link = bin_dir / "python"
|
|
56
|
+
|
|
57
|
+
real_exe = Path(sys.executable)
|
|
58
|
+
try:
|
|
59
|
+
link.symlink_to(real_exe)
|
|
60
|
+
except OSError:
|
|
61
|
+
pytest.skip("Cannot create symlink")
|
|
62
|
+
|
|
63
|
+
result = resolve_python_executable(str(link))
|
|
64
|
+
# Must return the symlink path, not the resolved target
|
|
65
|
+
assert result == link.absolute()
|
|
66
|
+
assert result != real_exe.resolve()
|
|
44
67
|
|
|
45
68
|
|
|
46
69
|
def test_resolve_nonexistent_raises():
|
|
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
|
{libcontext-0.7.4 → libcontext-0.7.5}/docs/adr/001-progressive-disclosure-over-always-on-context.md
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
|