vscode-common-python-lsp 0.1.1__tar.gz → 0.2.1__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.
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/PKG-INFO +1 -1
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/pyproject.toml +1 -1
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/__init__.py +4 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/paths.py +21 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp.egg-info/PKG-INFO +1 -1
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/README.md +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/setup.cfg +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_code_actions.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_context.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_debug.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_diagnostics.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_formatting.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_jsonrpc.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_linting.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_notebook.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_package.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_paths.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_process_runner.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_runner.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_server.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_version.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/code_actions.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/context.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/debug.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/diagnostics.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/formatting.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/jsonrpc.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/linting.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/notebook.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/process_runner.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/runner.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/server.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/version.py +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp.egg-info/SOURCES.txt +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp.egg-info/dependency_links.txt +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp.egg-info/requires.txt +0 -0
- {vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp.egg-info/top_level.txt +0 -0
|
@@ -39,6 +39,7 @@ from .notebook import (
|
|
|
39
39
|
CellLike,
|
|
40
40
|
CellOffset,
|
|
41
41
|
SyntheticDocument,
|
|
42
|
+
TextDocumentLike,
|
|
42
43
|
build_notebook_source,
|
|
43
44
|
get_cell_for_line,
|
|
44
45
|
remap_diagnostics_to_cells,
|
|
@@ -56,6 +57,7 @@ from .paths import (
|
|
|
56
57
|
is_match,
|
|
57
58
|
is_same_path,
|
|
58
59
|
normalize_path,
|
|
60
|
+
reset_caches,
|
|
59
61
|
)
|
|
60
62
|
from .process_runner import run_message_loop, update_sys_path
|
|
61
63
|
from .runner import CustomIO, RunResult, run_api, run_module, run_path
|
|
@@ -76,6 +78,7 @@ __all__ = [
|
|
|
76
78
|
"classify_python_file",
|
|
77
79
|
"PythonFileKind",
|
|
78
80
|
"is_match",
|
|
81
|
+
"reset_caches",
|
|
79
82
|
# context
|
|
80
83
|
"substitute_attr",
|
|
81
84
|
"redirect_io",
|
|
@@ -123,6 +126,7 @@ __all__ = [
|
|
|
123
126
|
# notebook
|
|
124
127
|
"CellLike",
|
|
125
128
|
"SyntheticDocument",
|
|
129
|
+
"TextDocumentLike",
|
|
126
130
|
"CellOffset",
|
|
127
131
|
"MAGIC_LINE_RE",
|
|
128
132
|
"NOTEBOOK_SYNC_OPTIONS",
|
{vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/paths.py
RENAMED
|
@@ -186,6 +186,27 @@ def classify_python_file(file_path: str) -> PythonFileKind | None:
|
|
|
186
186
|
return None
|
|
187
187
|
|
|
188
188
|
|
|
189
|
+
def reset_caches() -> None:
|
|
190
|
+
"""Clear all ``lru_cache`` caches in this module.
|
|
191
|
+
|
|
192
|
+
Useful in tests that need to mock ``site.getusersitepackages()`` or
|
|
193
|
+
other underlying functions and have the change take effect immediately.
|
|
194
|
+
|
|
195
|
+
Example::
|
|
196
|
+
|
|
197
|
+
from vscode_common_python_lsp import reset_caches
|
|
198
|
+
|
|
199
|
+
reset_caches()
|
|
200
|
+
with patch.object(site, "getusersitepackages", return_value=None):
|
|
201
|
+
reset_caches()
|
|
202
|
+
assert classify_python_file("/some/path") is None
|
|
203
|
+
reset_caches() # restore real values
|
|
204
|
+
"""
|
|
205
|
+
_get_stdlib_roots.cache_clear()
|
|
206
|
+
_get_user_site_root.cache_clear()
|
|
207
|
+
_get_system_site_roots.cache_clear()
|
|
208
|
+
|
|
209
|
+
|
|
189
210
|
# ---------------------------------------------------------------------------
|
|
190
211
|
# Path comparison and normalization
|
|
191
212
|
# ---------------------------------------------------------------------------
|
|
File without changes
|
|
File without changes
|
{vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_code_actions.py
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
|
{vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/tests/test_process_runner.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/debug.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/runner.py
RENAMED
|
File without changes
|
{vscode_common_python_lsp-0.1.1 → vscode_common_python_lsp-0.2.1}/vscode_common_python_lsp/server.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|