avrae-ls 0.6.3__tar.gz → 0.6.4__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.
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/PKG-INFO +1 -1
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/pyproject.toml +1 -1
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/__main__.py +16 -4
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/config.py +1 -5
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/context.py +3 -2
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/.gitignore +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/LICENSE +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/README.md +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/__init__.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/alias_preview.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/alias_tests.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/api.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/argparser.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/argument_parsing.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/code_actions.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/codes.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/completions.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/cvars.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/diagnostics.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/dice.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/parser.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/runtime.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/server.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/signature_help.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/avrae_ls/symbols.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/LICENSE +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/__init__.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/exceptions.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/helpers.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/interpreter.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/string.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/types.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/utils.py +0 -0
- {avrae_ls-0.6.3 → avrae_ls-0.6.4}/src/draconic/versions.py +0 -0
|
@@ -42,6 +42,8 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
42
42
|
const=".",
|
|
43
43
|
help="Run alias tests in PATH (defaults to current directory)",
|
|
44
44
|
)
|
|
45
|
+
parser.add_argument("--token", help="Avrae API token (overrides config)")
|
|
46
|
+
parser.add_argument("--base-url", help="Avrae API base URL (overrides config)")
|
|
45
47
|
parser.add_argument("--version", action="store_true", help="Print version and exit")
|
|
46
48
|
args = parser.parse_args(argv)
|
|
47
49
|
|
|
@@ -56,12 +58,12 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
56
58
|
parser.error("--run-tests cannot be combined with --tcp")
|
|
57
59
|
if args.analyze:
|
|
58
60
|
parser.error("--run-tests cannot be combined with --analyze")
|
|
59
|
-
sys.exit(_run_alias_tests(Path(args.run_tests)))
|
|
61
|
+
sys.exit(_run_alias_tests(Path(args.run_tests), token_override=args.token, base_url_override=args.base_url))
|
|
60
62
|
|
|
61
63
|
if args.analyze:
|
|
62
64
|
if args.tcp:
|
|
63
65
|
parser.error("--analyze cannot be combined with --tcp")
|
|
64
|
-
sys.exit(_run_analysis(Path(args.analyze)))
|
|
66
|
+
sys.exit(_run_analysis(Path(args.analyze), token_override=args.token, base_url_override=args.base_url))
|
|
65
67
|
|
|
66
68
|
server = create_server()
|
|
67
69
|
if args.tcp:
|
|
@@ -80,7 +82,7 @@ def _configure_logging(level: str) -> None:
|
|
|
80
82
|
)
|
|
81
83
|
|
|
82
84
|
|
|
83
|
-
def _run_analysis(path: Path) -> int:
|
|
85
|
+
def _run_analysis(path: Path, *, token_override: str | None = None, base_url_override: str | None = None) -> int:
|
|
84
86
|
if not path.exists():
|
|
85
87
|
print(f"File not found: {path}", file=sys.stderr)
|
|
86
88
|
return 2
|
|
@@ -90,6 +92,10 @@ def _run_analysis(path: Path) -> int:
|
|
|
90
92
|
log.info("Analyzing %s (workspace root: %s)", path, workspace_root)
|
|
91
93
|
|
|
92
94
|
config, warnings = load_config(workspace_root, default_enable_gvar_fetch=True)
|
|
95
|
+
if token_override:
|
|
96
|
+
config.service.token = token_override
|
|
97
|
+
if base_url_override:
|
|
98
|
+
config.service.base_url = base_url_override
|
|
93
99
|
for warning in warnings:
|
|
94
100
|
log.warning(warning)
|
|
95
101
|
|
|
@@ -104,7 +110,9 @@ def _run_analysis(path: Path) -> int:
|
|
|
104
110
|
return 1 if results else 0
|
|
105
111
|
|
|
106
112
|
|
|
107
|
-
def _run_alias_tests(
|
|
113
|
+
def _run_alias_tests(
|
|
114
|
+
target: Path, *, token_override: str | None = None, base_url_override: str | None = None
|
|
115
|
+
) -> int:
|
|
108
116
|
if not target.exists():
|
|
109
117
|
print(f"Test path not found: {target}", file=sys.stderr)
|
|
110
118
|
return 2
|
|
@@ -114,6 +122,10 @@ def _run_alias_tests(target: Path) -> int:
|
|
|
114
122
|
log.info("Running alias tests in %s (workspace root: %s)", target, workspace_root)
|
|
115
123
|
|
|
116
124
|
config, warnings = load_config(workspace_root, default_enable_gvar_fetch=True)
|
|
125
|
+
if token_override:
|
|
126
|
+
config.service.token = token_override
|
|
127
|
+
if base_url_override:
|
|
128
|
+
config.service.base_url = base_url_override
|
|
117
129
|
for warning in warnings:
|
|
118
130
|
log.warning(warning)
|
|
119
131
|
|
|
@@ -393,9 +393,6 @@ def load_config(workspace_root: Path, *, default_enable_gvar_fetch: bool = False
|
|
|
393
393
|
if not path.exists():
|
|
394
394
|
cfg = AvraeLSConfig.default(workspace_root)
|
|
395
395
|
cfg.enable_gvar_fetch = default_enable_gvar_fetch
|
|
396
|
-
env_token = _coerce_optional_str(os.environ.get("AVRAE_TOKEN"))
|
|
397
|
-
if env_token:
|
|
398
|
-
cfg.service.token = env_token
|
|
399
396
|
return cfg, []
|
|
400
397
|
|
|
401
398
|
try:
|
|
@@ -419,10 +416,9 @@ def load_config(workspace_root: Path, *, default_enable_gvar_fetch: bool = False
|
|
|
419
416
|
enable_gvar_fetch = bool(raw.get("enableGvarFetch", default_enable_gvar_fetch))
|
|
420
417
|
|
|
421
418
|
service_cfg = raw.get("avraeService") or {}
|
|
422
|
-
env_token = _coerce_optional_str(env.get("AVRAE_TOKEN"))
|
|
423
419
|
service = AvraeServiceConfig(
|
|
424
420
|
base_url=str(service_cfg.get("baseUrl") or AvraeServiceConfig.base_url),
|
|
425
|
-
token=_coerce_optional_str(service_cfg.get("token"))
|
|
421
|
+
token=_coerce_optional_str(service_cfg.get("token")),
|
|
426
422
|
)
|
|
427
423
|
|
|
428
424
|
diag_cfg = raw.get("diagnostics") or {}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import json
|
|
4
|
-
import logging
|
|
5
3
|
import asyncio
|
|
6
4
|
import copy
|
|
5
|
+
import json
|
|
6
|
+
import logging
|
|
7
7
|
from dataclasses import dataclass, field
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from typing import Any, Dict, Iterable
|
|
@@ -320,6 +320,7 @@ class GVarResolver:
|
|
|
320
320
|
return True
|
|
321
321
|
|
|
322
322
|
|
|
323
|
+
|
|
323
324
|
def _read_json_file(path: Path) -> Dict[str, Any] | None:
|
|
324
325
|
try:
|
|
325
326
|
text = path.read_text()
|
|
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
|