Skip to content

Commit 96d88c7

Browse files
committed
Use Import instead of ImportDefault
1 parent f80cb51 commit 96d88c7

File tree

7 files changed

+28
-10
lines changed

7 files changed

+28
-10
lines changed

src/Ast.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module rec Fable.Python.Ast
22

3-
open System.Collections.Generic
43
open Fable.Core
54

65
// fsharplint:disable MemberNames,InterfaceNames
@@ -121,5 +120,5 @@ type IExports =
121120
/// Return a formatted dump of the tree in node.
122121
abstract dump : node: AST * annotate_fields: bool * include_attributes: bool -> string
123122

124-
[<ImportDefault("ast")>]
123+
[<Import("ast")>]
125124
let ast: IExports = nativeOnly

src/Builtins.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ type IExports =
120120
file: _OpenFile * mode: OpenTextMode * buffering: int * encoding: string * errors: string * newline: string ->
121121
TextIOWrapper
122122

123-
[<ImportDefault("builtins")>]
123+
[<Import("builtins")>]
124124
let builtins: IExports = nativeOnly

src/Fable.Python.fsproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,25 @@
33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6+
<Author>Dag Brattli</Author>
7+
<Copyright>Dag Brattli</Copyright>
8+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
69
<WarnOn>3390;$(WarnOn)</WarnOn>
710
</PropertyGroup>
811
<ItemGroup>
12+
<Compile Include="Ast.fs" />
913
<Compile Include="Builtins.fs" />
1014
<Compile Include="Json.fs" />
11-
<Compile Include="Ast.fs" />
15+
<Compile Include="Os.fs" />
1216
</ItemGroup>
1317
<ItemGroup>
1418
<ProjectReference Include="../../Fable/src/Fable.Core/Fable.Core.fsproj" />
1519
</ItemGroup>
1620
<ItemGroup>
1721
<Content Include="pyproject.toml; *.fsproj; **\*.fs; **\*.fsi" PackagePath="fable\" />
1822
</ItemGroup>
23+
<ItemGroup>
24+
<None Include="..\LICENSE" Pack="true" Visible="false" PackagePath=""/>
25+
</ItemGroup>
1926
<Import Project="..\.paket\Paket.Restore.targets" />
2027
</Project>

src/Json.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ type IExports =
88
abstract dumps : obj: obj -> string
99
abstract loads : string -> obj
1010

11-
[<ImportDefault("json")>]
11+
[<Import("json")>]
1212
let json: IExports = nativeOnly

src/Os.fs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Fable.Python.Os
2+
3+
open Fable.Core
4+
5+
// fsharplint:disable MemberNames,InterfaceNames
6+
7+
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
11+
12+
13+
[<Import("os")>]
14+
let os : IExports = nativeOnly

src/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ fable-library = "^0.0.1"
1212

1313
[tool.poetry.dev-dependencies]
1414

15+
[tool.fable]
16+
package-dir = "fable-python/fable_python"
17+
1518
[build-system]
1619
requires = ["poetry-core>=1.0.0"]
1720
build-backend = "poetry.core.masonry.api"

test/TestJson.fs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ module Fable.Python.Tests.Json
33
open Util.Testing
44
open Fable.Python.Json
55

6-
// type MyObject = {
7-
// Foo: int
8-
// Bar: string
9-
// }
10-
116
[<Fact>]
127
let ``test works`` () =
138
let result = true

0 commit comments

Comments
 (0)