Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fc1943s committed Jan 17, 2025
1 parent bc4b031 commit 9883a6e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
8 changes: 5 additions & 3 deletions apps/spiral/temp/cube/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 5 additions & 3 deletions apps/spiral/temp/cube/cube.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions lib/fsharp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

q: str = "\""

def _expr190() -> TypeInfo:
def _expr229() -> TypeInfo:
return union_type("Polyglot.Common.TraceLevel", [], TraceLevel, lambda: [[], [], [], [], []])


Expand All @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions scripts/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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(".")) {
Expand All @@ -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
}

Expand Down

0 comments on commit 9883a6e

Please sign in to comment.