solpython 0.1.1__tar.gz → 0.1.2__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.
- {solpython-0.1.1/solpython.egg-info → solpython-0.1.2}/PKG-INFO +1 -1
- {solpython-0.1.1 → solpython-0.1.2}/pyproject.toml +1 -1
- {solpython-0.1.1 → solpython-0.1.2}/pysol/__init__.py +1 -1
- {solpython-0.1.1 → solpython-0.1.2}/pysol/executor.py +12 -13
- {solpython-0.1.1 → solpython-0.1.2/solpython.egg-info}/PKG-INFO +1 -1
- {solpython-0.1.1 → solpython-0.1.2}/LICENSE +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/MANIFEST.in +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/README.md +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/pysol/build.py +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/pysol/cli/__init__.py +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/pysol/cli/main.py +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/pysol/contracts/__init__.py +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/pysol/contracts/artifacts/PythonCompiler.json +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/pysol/contracts/artifacts/VM.json +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/setup.cfg +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/solpython.egg-info/SOURCES.txt +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/solpython.egg-info/dependency_links.txt +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/solpython.egg-info/entry_points.txt +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/solpython.egg-info/requires.txt +0 -0
- {solpython-0.1.1 → solpython-0.1.2}/solpython.egg-info/top_level.txt +0 -0
|
@@ -111,23 +111,22 @@ def run(source: str, *, verbose: bool = False) -> str:
|
|
|
111
111
|
return _decode_output(w3, receipt)
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
def _resolve_imports(source: str, script_dir: Path) -> dict[str, str]:
|
|
115
|
-
"""Parse source for import statements and load module files from disk."""
|
|
114
|
+
def _resolve_imports(source: str, script_dir: Path, *, _seen: set[str] | None = None) -> dict[str, str]:
|
|
115
|
+
"""Parse source for import statements and load module files from disk (recursive)."""
|
|
116
|
+
if _seen is None:
|
|
117
|
+
_seen = set()
|
|
116
118
|
modules = {}
|
|
117
|
-
for match in re.finditer(r"^from\s+(\w+)\s+import\s+", source, re.MULTILINE):
|
|
118
|
-
mod_name = match.group(1)
|
|
119
|
-
if mod_name in
|
|
119
|
+
for match in re.finditer(r"^(?:from\s+(\w+)\s+import\s+|import\s+(\w+))", source, re.MULTILINE):
|
|
120
|
+
mod_name = match.group(1) or match.group(2)
|
|
121
|
+
if mod_name in _seen:
|
|
120
122
|
continue
|
|
123
|
+
_seen.add(mod_name)
|
|
121
124
|
mod_path = script_dir / f"{mod_name}.py"
|
|
122
125
|
if mod_path.exists():
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
continue
|
|
128
|
-
mod_path = script_dir / f"{mod_name}.py"
|
|
129
|
-
if mod_path.exists():
|
|
130
|
-
modules[mod_name] = mod_path.read_text()
|
|
126
|
+
mod_src = mod_path.read_text()
|
|
127
|
+
modules[mod_name] = mod_src
|
|
128
|
+
nested = _resolve_imports(mod_src, script_dir, _seen=_seen)
|
|
129
|
+
modules.update(nested)
|
|
131
130
|
return modules
|
|
132
131
|
|
|
133
132
|
|
|
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
|