Skip to content

Commit 1e9c983

Browse files
committed
Fix build of stdlib
1 parent 12a8199 commit 1e9c983

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

Build.fs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Target.create "Clean" (fun _ ->
2121

2222
Target.create "Build" (fun _ ->
2323
Shell.mkdir buildPath
24-
run dotnet $"run -c Release -p {cliPath} -- --lang Python --exclude Fable.Core --outDir {buildPath}/lib" srcPath
24+
run dotnet $"run -c Release -p {cliPath} -- --lang Python --exclude Fable.Core --outDir {buildPath}/stdlib" srcPath
2525
)
2626

2727
Target.create "Run" (fun _ ->
@@ -39,8 +39,13 @@ Target.create "Test" (fun _ ->
3939
run pytest $"{buildPath}/tests" ""
4040
)
4141

42+
Target.create "Pack" (fun _ ->
43+
run dotnet "pack" srcPath
44+
)
45+
4246
Target.create "Format" (fun _ ->
43-
run dotnet "fantomas . -r" "src"
47+
run dotnet "fantomas . -r" srcPath
48+
run dotnet "fantomas . -r" testsPath
4449
)
4550

4651
open Fake.Core.TargetOperators
@@ -54,6 +59,9 @@ let dependencies = [
5459

5560
"Build"
5661
==> "Test"
62+
63+
"Build"
64+
==> "Pack"
5765
]
5866

5967
[<EntryPoint>]

stdlib/Builtins.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ type IExports =
124124
let builtins: IExports = nativeOnly
125125

126126
[<Emit("__name__")>]
127-
let __name__ : string = nativeOnly
127+
let __name__: string = nativeOnly

stdlib/Os.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ open Fable.Core
55
// fsharplint:disable MemberNames
66

77
type IExports =
8-
abstract getenv: key:string -> string option
9-
abstract getenv: key:string * ``default``: string -> string
10-
abstract putenv: key:string * value: string -> unit
8+
abstract getenv : key: string -> string option
9+
abstract getenv : key: string * ``default``: string -> string
10+
abstract putenv : key: string * value: string -> unit
1111

1212

1313
[<ImportAll("os")>]
14-
let os : IExports = nativeOnly
14+
let os: IExports = nativeOnly

stdlib/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT"
88

99
[tool.poetry.dependencies]
1010
python = "^3.8"
11-
fable-library = "^0.0.1"
11+
fable-library = "^0.3.0"
1212

1313
[tool.poetry.dev-dependencies]
1414

test/TestBuiltins.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ let ``test print works`` () =
88
let result = builtins.print "Hello, world!"
99
result |> equal ()
1010

11-
let ``test __name__ works`` () =
12-
__name__ |> equal "tests.test_builtins"
11+
let ``test __name__ works`` () = __name__ |> equal "tests.test_builtins"

0 commit comments

Comments
 (0)