sqlmesh 0.189.3.dev22__py3-none-any.whl → 0.189.3.dev24__py3-none-any.whl
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.
- sqlmesh/_version.py +2 -2
- sqlmesh/cli/main.py +5 -2
- sqlmesh/lsp/main.py +34 -43
- {sqlmesh-0.189.3.dev22.dist-info → sqlmesh-0.189.3.dev24.dist-info}/METADATA +1 -1
- {sqlmesh-0.189.3.dev22.dist-info → sqlmesh-0.189.3.dev24.dist-info}/RECORD +9 -9
- {sqlmesh-0.189.3.dev22.dist-info → sqlmesh-0.189.3.dev24.dist-info}/WHEEL +0 -0
- {sqlmesh-0.189.3.dev22.dist-info → sqlmesh-0.189.3.dev24.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.189.3.dev22.dist-info → sqlmesh-0.189.3.dev24.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.189.3.dev22.dist-info → sqlmesh-0.189.3.dev24.dist-info}/top_level.txt +0 -0
sqlmesh/_version.py
CHANGED
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.189.3.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 189, 3, '
|
|
20
|
+
__version__ = version = '0.189.3.dev24'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 189, 3, 'dev24')
|
sqlmesh/cli/main.py
CHANGED
|
@@ -23,12 +23,15 @@ from pathlib import Path
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
24
24
|
|
|
25
25
|
SKIP_LOAD_COMMANDS = (
|
|
26
|
+
"clean",
|
|
26
27
|
"create_external_models",
|
|
28
|
+
"destroy",
|
|
29
|
+
"environments",
|
|
30
|
+
"invalidate",
|
|
31
|
+
"janitor",
|
|
27
32
|
"migrate",
|
|
28
33
|
"rollback",
|
|
29
34
|
"run",
|
|
30
|
-
"environments",
|
|
31
|
-
"invalidate",
|
|
32
35
|
"table_name",
|
|
33
36
|
)
|
|
34
37
|
SKIP_CONTEXT_COMMANDS = ("init", "ui")
|
sqlmesh/lsp/main.py
CHANGED
|
@@ -85,6 +85,22 @@ class SQLMeshLanguageServer:
|
|
|
85
85
|
# Register LSP features (e.g., formatting, hover, etc.)
|
|
86
86
|
self._register_features()
|
|
87
87
|
|
|
88
|
+
def _create_lsp_context(self, paths: t.List[Path]) -> t.Optional[LSPContext]:
|
|
89
|
+
"""Create a new LSPContext instance using the configured context class.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
paths: List of paths to pass to the context constructor
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
A new LSPContext instance wrapping the created context, or None if creation fails
|
|
96
|
+
"""
|
|
97
|
+
try:
|
|
98
|
+
context = self.context_class(paths=paths)
|
|
99
|
+
return LSPContext(context)
|
|
100
|
+
except Exception as e:
|
|
101
|
+
self.server.log_trace(f"Error creating context: {e}")
|
|
102
|
+
return None
|
|
103
|
+
|
|
88
104
|
def _register_features(self) -> None:
|
|
89
105
|
"""Register LSP features on the internal LanguageServer instance."""
|
|
90
106
|
|
|
@@ -116,16 +132,11 @@ class SQLMeshLanguageServer:
|
|
|
116
132
|
for ext in ("py", "yml", "yaml"):
|
|
117
133
|
config_path = folder_path / f"config.{ext}"
|
|
118
134
|
if config_path.exists():
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
self.lsp_context = LSPContext(created_context)
|
|
135
|
+
lsp_context = self._create_lsp_context([folder_path])
|
|
136
|
+
if lsp_context:
|
|
137
|
+
self.lsp_context = lsp_context
|
|
123
138
|
loaded_sqlmesh_message(ls, folder_path)
|
|
124
139
|
return # Exit after successfully loading any config
|
|
125
|
-
except Exception as e:
|
|
126
|
-
ls.log_trace(
|
|
127
|
-
f"Error loading context from {config_path}: {e}",
|
|
128
|
-
)
|
|
129
140
|
except Exception as e:
|
|
130
141
|
ls.log_trace(
|
|
131
142
|
f"Error initializing SQLMesh context: {e}",
|
|
@@ -288,13 +299,10 @@ class SQLMeshLanguageServer:
|
|
|
288
299
|
|
|
289
300
|
# Reload the entire context and create a new LSPContext
|
|
290
301
|
if self.lsp_context is not None:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
self.lsp_context = new_full_context
|
|
302
|
+
new_lsp_context = self._create_lsp_context(list(self.lsp_context.context.configs))
|
|
303
|
+
if new_lsp_context:
|
|
304
|
+
self.lsp_context = new_lsp_context
|
|
295
305
|
return
|
|
296
|
-
except Exception as e:
|
|
297
|
-
pass
|
|
298
306
|
|
|
299
307
|
context = self._context_get_or_load(uri)
|
|
300
308
|
models = context.map[uri.to_path()]
|
|
@@ -664,29 +672,22 @@ class SQLMeshLanguageServer:
|
|
|
664
672
|
for ext in ("py", "yml", "yaml"):
|
|
665
673
|
config_path = folder_uri / f"config.{ext}"
|
|
666
674
|
if config_path.exists():
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
self.lsp_context =
|
|
675
|
+
lsp_context = self._create_lsp_context([folder_uri])
|
|
676
|
+
if lsp_context:
|
|
677
|
+
self.lsp_context = lsp_context
|
|
670
678
|
loaded_sqlmesh_message(self.server, folder_uri)
|
|
671
679
|
return
|
|
672
|
-
except Exception as e:
|
|
673
|
-
self.server.show_message(f"Error loading context: {e}", types.MessageType.Error)
|
|
674
680
|
|
|
675
681
|
# If not found in the provided folder, search through all workspace folders
|
|
676
682
|
for workspace_folder in self.workspace_folders:
|
|
677
683
|
for ext in ("py", "yml", "yaml"):
|
|
678
684
|
config_path = workspace_folder / f"config.{ext}"
|
|
679
685
|
if config_path.exists():
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
self.lsp_context =
|
|
686
|
+
lsp_context = self._create_lsp_context([workspace_folder])
|
|
687
|
+
if lsp_context:
|
|
688
|
+
self.lsp_context = lsp_context
|
|
683
689
|
loaded_sqlmesh_message(self.server, workspace_folder)
|
|
684
690
|
return
|
|
685
|
-
except Exception as e:
|
|
686
|
-
self.server.show_message(
|
|
687
|
-
f"Error loading context from {config_path}: {e}",
|
|
688
|
-
types.MessageType.Warning,
|
|
689
|
-
)
|
|
690
691
|
|
|
691
692
|
def _ensure_context_for_document(
|
|
692
693
|
self,
|
|
@@ -713,17 +714,12 @@ class SQLMeshLanguageServer:
|
|
|
713
714
|
for ext in ("py", "yml", "yaml"):
|
|
714
715
|
config_path = path / f"config.{ext}"
|
|
715
716
|
if config_path.exists():
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
self.lsp_context = LSPContext(created_context)
|
|
717
|
+
lsp_context = self._create_lsp_context([path])
|
|
718
|
+
if lsp_context:
|
|
719
|
+
self.lsp_context = lsp_context
|
|
720
720
|
loaded = True
|
|
721
721
|
# Re-check context for the document now that it's loaded
|
|
722
722
|
return self._ensure_context_for_document(document_uri)
|
|
723
|
-
except Exception as e:
|
|
724
|
-
self.server.show_message(
|
|
725
|
-
f"Error loading context: {e}", types.MessageType.Error
|
|
726
|
-
)
|
|
727
723
|
path = path.parent
|
|
728
724
|
|
|
729
725
|
# If still no context found, try the workspace folders
|
|
@@ -732,16 +728,11 @@ class SQLMeshLanguageServer:
|
|
|
732
728
|
for ext in ("py", "yml", "yaml"):
|
|
733
729
|
config_path = workspace_folder / f"config.{ext}"
|
|
734
730
|
if config_path.exists():
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
self.lsp_context =
|
|
731
|
+
lsp_context = self._create_lsp_context([workspace_folder])
|
|
732
|
+
if lsp_context:
|
|
733
|
+
self.lsp_context = lsp_context
|
|
738
734
|
loaded_sqlmesh_message(self.server, workspace_folder)
|
|
739
735
|
return
|
|
740
|
-
except Exception as e:
|
|
741
|
-
self.server.show_message(
|
|
742
|
-
f"Error loading context from {config_path}: {e}",
|
|
743
|
-
types.MessageType.Warning,
|
|
744
|
-
)
|
|
745
736
|
|
|
746
737
|
return
|
|
747
738
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=UVSc5rHw9Ijtrxery7cxNfYMoA7Ntm8dKrodV0E-RaI,530
|
|
3
3
|
sqlmesh/magics.py,sha256=gjzoxREb1XT8Yho_PQMlMqhhkLq_sEfBM8S3PTgxvWE,40337
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -7,7 +7,7 @@ sqlmesh/cicd/bot.py,sha256=2zlbn-DXkqQzr3lA0__IGU4XaIfXBXBKLWXNI2DRJX8,759
|
|
|
7
7
|
sqlmesh/cicd/config.py,sha256=mpgkisSBBovlNrNZir2unT8Wes6b38RW2UsU_o4e8vY,109
|
|
8
8
|
sqlmesh/cli/__init__.py,sha256=MAXAyO7isbyM-PaSdFjkJNcjn32WjOl0XzxT5gvp_vo,1690
|
|
9
9
|
sqlmesh/cli/example_project.py,sha256=QAFQbw_kzqn30GLTthqsuWXbFDBpX8W6RsCgQ-jx65M,9308
|
|
10
|
-
sqlmesh/cli/main.py,sha256=
|
|
10
|
+
sqlmesh/cli/main.py,sha256=61T2vCc9WIEJNtFZMhPh41tZmP55CYjS2qyBeDtBCVg,32781
|
|
11
11
|
sqlmesh/cli/options.py,sha256=aC_L5WnMScKzMU55BD1Y-8R-QzqCkPSYrlCI-payHRA,1333
|
|
12
12
|
sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
sqlmesh/core/_typing.py,sha256=e1f7xO2aZCy38M_3VoDy-XI3shyd99-IFctgIFSgXWM,497
|
|
@@ -165,7 +165,7 @@ sqlmesh/lsp/custom.py,sha256=40ekRrcsJ-lsF4-uPs4mo8CFegTWK_zKzi4am_NO9oo,2196
|
|
|
165
165
|
sqlmesh/lsp/description.py,sha256=4QIGC9ix8IzmWF6DVUNhY4m1Crk3sNQA6hZ1RbyqU78,827
|
|
166
166
|
sqlmesh/lsp/helpers.py,sha256=igzUgeYAO3LUZFr3qN4l9hzztOy66lRubX93KtCMduY,654
|
|
167
167
|
sqlmesh/lsp/hints.py,sha256=j-blccBUil94yRoDjWfkSM0HqMmsKD6hP2TaWdWWVk4,3734
|
|
168
|
-
sqlmesh/lsp/main.py,sha256=
|
|
168
|
+
sqlmesh/lsp/main.py,sha256=klOs4Gn0pLF161jWJaosXdN3a9GcPSrEZHmJkrsO7k4,35538
|
|
169
169
|
sqlmesh/lsp/reference.py,sha256=2rAYfwrKRfxlYA3psTDLacxYWvuFaouMyS7plOSYHiQ,23883
|
|
170
170
|
sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
|
|
171
171
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -275,7 +275,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
275
275
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
276
276
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
277
277
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
278
|
-
sqlmesh-0.189.3.
|
|
278
|
+
sqlmesh-0.189.3.dev24.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
279
279
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
280
280
|
web/client/dist/index.html,sha256=k5bAEoPDJ0BhYQ4hBcKWObITCxIgqOUC28nGXvEDrt0,5472
|
|
281
281
|
web/client/dist/assets/Audits-Pgs8N6IE.js,sha256=BQuc9kiznZSqTnzNrJSDNqAAdOTGjNQJt32M1sHZFok,1041
|
|
@@ -393,8 +393,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
393
393
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
394
394
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
395
395
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
396
|
-
sqlmesh-0.189.3.
|
|
397
|
-
sqlmesh-0.189.3.
|
|
398
|
-
sqlmesh-0.189.3.
|
|
399
|
-
sqlmesh-0.189.3.
|
|
400
|
-
sqlmesh-0.189.3.
|
|
396
|
+
sqlmesh-0.189.3.dev24.dist-info/METADATA,sha256=0PizIioIzUPUhpgbzjlzI6iNfv1y0tG8ikX1qh8MFf0,26541
|
|
397
|
+
sqlmesh-0.189.3.dev24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
398
|
+
sqlmesh-0.189.3.dev24.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
399
|
+
sqlmesh-0.189.3.dev24.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
400
|
+
sqlmesh-0.189.3.dev24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|