glaip-sdk 0.7.28__py3-none-any.whl → 0.7.29__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.
- glaip_sdk/utils/import_resolver.py +38 -1
- {glaip_sdk-0.7.28.dist-info → glaip_sdk-0.7.29.dist-info}/METADATA +1 -1
- {glaip_sdk-0.7.28.dist-info → glaip_sdk-0.7.29.dist-info}/RECORD +6 -6
- {glaip_sdk-0.7.28.dist-info → glaip_sdk-0.7.29.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.7.28.dist-info → glaip_sdk-0.7.29.dist-info}/entry_points.txt +0 -0
- {glaip_sdk-0.7.28.dist-info → glaip_sdk-0.7.29.dist-info}/top_level.txt +0 -0
|
@@ -145,9 +145,31 @@ class ImportResolver:
|
|
|
145
145
|
return self._is_local_package_import(node.module)
|
|
146
146
|
|
|
147
147
|
# Handle simple module imports
|
|
148
|
+
# First, check if it's the package root (matched via project markers)
|
|
149
|
+
if self._is_package_root_import(node.module):
|
|
150
|
+
return True
|
|
151
|
+
|
|
152
|
+
# Then check for local file in tool_dir
|
|
148
153
|
potential_file = self.tool_dir / f"{node.module}.py"
|
|
149
154
|
return potential_file.exists()
|
|
150
155
|
|
|
156
|
+
def _is_package_root_import(self, module_name: str) -> bool:
|
|
157
|
+
"""Check if a simple module name is a package root in the ancestor chain.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
module_name: Simple module name (no dots).
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
True if the module name matches any parent directory that could be a package.
|
|
164
|
+
"""
|
|
165
|
+
# Check all ancestors for a matching directory name
|
|
166
|
+
current = self.tool_dir
|
|
167
|
+
while current != current.parent:
|
|
168
|
+
if module_name == current.name:
|
|
169
|
+
return True
|
|
170
|
+
current = current.parent
|
|
171
|
+
return False
|
|
172
|
+
|
|
151
173
|
def _is_local_relative_import(self, node: ast.ImportFrom) -> bool:
|
|
152
174
|
"""Check if a relative import is local.
|
|
153
175
|
|
|
@@ -366,7 +388,22 @@ class ImportResolver:
|
|
|
366
388
|
"""
|
|
367
389
|
if "." in module_name:
|
|
368
390
|
return self._resolve_dotted_module_path(module_name)
|
|
369
|
-
|
|
391
|
+
|
|
392
|
+
# For simple module names, check if it's a file in tool_dir or an ancestor package
|
|
393
|
+
potential_file = self.tool_dir / f"{module_name}.py"
|
|
394
|
+
if potential_file.exists():
|
|
395
|
+
return potential_file
|
|
396
|
+
|
|
397
|
+
# Check if it's an ancestor package (directory with __init__.py)
|
|
398
|
+
current = self.tool_dir
|
|
399
|
+
while current != current.parent:
|
|
400
|
+
potential_package_init = current / module_name / INIT_FILE
|
|
401
|
+
if potential_package_init.exists():
|
|
402
|
+
return potential_package_init
|
|
403
|
+
current = current.parent
|
|
404
|
+
|
|
405
|
+
# Fallback to the file path (will fail later if not found)
|
|
406
|
+
return potential_file
|
|
370
407
|
|
|
371
408
|
def resolve_relative_import_path(self, node: ast.ImportFrom) -> Path:
|
|
372
409
|
"""Resolve relative import to file path.
|
|
@@ -179,7 +179,7 @@ glaip_sdk/utils/display.py,sha256=zu3SYqxj9hPyEN8G1vIXv_yXBkV8jLLCXEg2rs8NlzM,44
|
|
|
179
179
|
glaip_sdk/utils/export.py,sha256=1NxxE3wGsA1auzecG5oJw5ELB4VmPljoeIkGhrGOh1I,5006
|
|
180
180
|
glaip_sdk/utils/general.py,sha256=3HSVIopUsIymPaim-kP2lqLX75TkkdIVLe6g3UKabZ0,1507
|
|
181
181
|
glaip_sdk/utils/import_export.py,sha256=RCvoydm_6_L7_J1igcE6IYDunqgS5mQUbWT4VGrytMw,5510
|
|
182
|
-
glaip_sdk/utils/import_resolver.py,sha256=
|
|
182
|
+
glaip_sdk/utils/import_resolver.py,sha256=Vwvg1FoODM15MiQ3A7d3fImSP13bYHOnD8WoxVL49L0,29131
|
|
183
183
|
glaip_sdk/utils/instructions.py,sha256=MTk93lsq3I8aRnvnRMSXXNMzcpnaIM_Pm3Aiiiq3GBc,2997
|
|
184
184
|
glaip_sdk/utils/resource_refs.py,sha256=vF34kyAtFBLnaKnQVrsr2st1JiSxVbIZ4yq0DelJvCI,5966
|
|
185
185
|
glaip_sdk/utils/run_renderer.py,sha256=d_VMI6LbvHPUUeRmGqh5wK_lHqDEIAcym2iqpbtDad0,1365
|
|
@@ -220,8 +220,8 @@ glaip_sdk/utils/rendering/steps/format.py,sha256=Chnq7OBaj8XMeBntSBxrX5zSmrYeGcO
|
|
|
220
220
|
glaip_sdk/utils/rendering/steps/manager.py,sha256=BiBmTeQMQhjRMykgICXsXNYh1hGsss-fH9BIGVMWFi0,13194
|
|
221
221
|
glaip_sdk/utils/rendering/viewer/__init__.py,sha256=XrxmE2cMAozqrzo1jtDFm8HqNtvDcYi2mAhXLXn5CjI,457
|
|
222
222
|
glaip_sdk/utils/rendering/viewer/presenter.py,sha256=mlLMTjnyeyPVtsyrAbz1BJu9lFGQSlS-voZ-_Cuugv0,5725
|
|
223
|
-
glaip_sdk-0.7.
|
|
224
|
-
glaip_sdk-0.7.
|
|
225
|
-
glaip_sdk-0.7.
|
|
226
|
-
glaip_sdk-0.7.
|
|
227
|
-
glaip_sdk-0.7.
|
|
223
|
+
glaip_sdk-0.7.29.dist-info/METADATA,sha256=2o46ltEDzkNONFYMdCfFR5x_qR1h77MiS3OJeuINYYY,8686
|
|
224
|
+
glaip_sdk-0.7.29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
225
|
+
glaip_sdk-0.7.29.dist-info/entry_points.txt,sha256=NkhO6FfgX9Zrjn63GuKphf-dLw7KNJvucAcXc7P3aMk,54
|
|
226
|
+
glaip_sdk-0.7.29.dist-info/top_level.txt,sha256=td7yXttiYX2s94-4wFhv-5KdT0rSZ-pnJRSire341hw,10
|
|
227
|
+
glaip_sdk-0.7.29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|