diff --git a/apps/spiral/temp/cube/build.ps1 b/apps/spiral/temp/cube/build.ps1 index 2ec09dbb..17ea08d3 100644 --- a/apps/spiral/temp/cube/build.ps1 +++ b/apps/spiral/temp/cube/build.ps1 @@ -74,9 +74,11 @@ if (!$SkipPy -and !$SkipFable) { if (!(Test-Path $path)) { $path = "$targetDir/target/py/$projectName.py" } - (Get-Content $path) ` - -replace "import sys", "import sys`nsys.path.insert(0, f'{os.path.dirname(__file__)}/../../../../lib/python/fable')" ` - | Set-Content "$projectName.py" + $content = Get-Content $path + $content = $content -replace "import sys", "" + $content = $content -replace "import os", "" + $content = $content -replace "from abc import abstractmethod", "import sys`nimport os`nsys.path.insert(0, f'{os.path.dirname(__file__)}/../../../../lib/python/fable')`nfrom abc import abstractmethod" + $content | Set-Content "$projectName.py" } if ($env:CI) { diff --git a/apps/spiral/temp/cube/cube.py b/apps/spiral/temp/cube/cube.py index b5816d15..b1c371bc 100644 --- a/apps/spiral/temp/cube/cube.py +++ b/apps/spiral/temp/cube/cube.py @@ -1,4 +1,7 @@ from __future__ import annotations +import sys +import os +sys.path.insert(0, f'{os.path.dirname(__file__)}/../../../../lib/python/fable') from abc import abstractmethod from fable_modules.fable_library.array_ import fill from fable_modules.fable_library.async_ import (sleep, start_immediate) @@ -16,9 +19,8 @@ from collections.abc import Callable from dataclasses import dataclass from math import (sin, cos) -import os -import sys -sys.path.insert(0, f'{os.path.dirname(__file__)}/../../../../lib/python/fable') + + from typing import (Any, Protocol) class IOsEnviron(Protocol): diff --git a/lib/fsharp/common.py b/lib/fsharp/common.py index df4cfea9..4b87790c 100644 --- a/lib/fsharp/common.py +++ b/lib/fsharp/common.py @@ -10,7 +10,7 @@ q: str = "\"" -def _expr190() -> TypeInfo: +def _expr229() -> TypeInfo: return union_type("Polyglot.Common.TraceLevel", [], TraceLevel, lambda: [[], [], [], [], []]) @@ -25,7 +25,7 @@ def cases() -> list[str]: return ["Verbose", "Debug", "Info", "Warning", "Critical"] -TraceLevel_reflection = _expr190 +TraceLevel_reflection = _expr229 def to_trace_level(_arg: TraceLevel) -> US0: if _arg.tag == 1: diff --git a/scripts/core.ps1 b/scripts/core.ps1 index f0c54e8a..d26f3a13 100644 --- a/scripts/core.ps1 +++ b/scripts/core.ps1 @@ -157,14 +157,14 @@ function ResolveLink ( [string] $Path, [string] $End = '' ) { - # Write-Host "polyglot/scripts/core.ps1/ResolveLink / Path: $Path / End: $End" + Write-Host "polyglot/scripts/core.ps1/ResolveLink #1 / Path: $Path / End: $End" if (!$Path) { return $End } $parent = $Path | Split-Path if (!$parent) { - Write-Host "polyglot/scripts/core.ps1/ResolveLink / parent: $parent / Path: $Path / End: $End" + Write-Host "polyglot/scripts/core.ps1/ResolveLink #2 / parent: $parent / Path: $Path / End: $End" return Join-Path $Path $End } @@ -176,11 +176,11 @@ function ResolveLink ( if ($parent | Test-Path) { $parent_target = ($parent | Get-Item).Target - if ($path | Test-Path) { - $path_target = ($path | Get-Item).Target + if ($Path | Test-Path) { + $path_target = ($Path | Get-Item).Target } - # Write-Host ("polyglot/scripts/core.ps1/ResolveLink / " + ` - # "parent_target: $parent_target / path_target: $path_target / parent: $parent / End: $End") + Write-Host ("polyglot/scripts/core.ps1/ResolveLink #3 / " + ` + "parent_target: $parent_target / path_target: $path_target / parent: $parent / End: $End") if ($parent_target -and ($parent_target | Test-Path)) { if ($parent_target.StartsWith(".")) { @@ -190,11 +190,11 @@ function ResolveLink ( $parent = $parent_target } } elseif ($path_target) { - $parent = $path_target - $End = '' + return $path_target } } + Write-Host "polyglot/scripts/core.ps1/ResolveLink #4 / parent: $parent / Path: $Path / End: $End" return ResolveLink $parent $End }