Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"isRoot": true,
"tools": {
"paket": {
"version": "9.0.2",
"version": "10.0.0-alpha011",
"commands": [
"paket"
],
"rollForward": false
},
"fable": {
"version": "4.24.0",
"version": "5.0.0-alpha.17",
"commands": [
"fable"
],
"rollForward": false
},
"fantomas": {
"version": "6.2.3",
"version": "7.0.3",
"commands": [
"fantomas"
],
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ jobs:
uses: actions/checkout@v4

- name: Setup .NET Core
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.x
8.x
9.x
10.x

- name: Setup tools
run: dotnet tool restore
Expand Down
8 changes: 1 addition & 7 deletions Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ Target.create "Build" (fun _ ->
run dotnet $"fable --lang Python --outDir {buildPath}" srcPath
)

Target.create "Docs" (fun _ ->
run uv $"run jb build docs-src --path-output {buildPath}/docs" "."
Fake.IO.Shell.copyDir "docs" $"{buildPath}/docs/_build/html" (fun _ -> true)
)
// Docs target removed - documentation is maintained centrally at https://fable.io/docs/

Target.create "Run" (fun _ ->
run dotnet "build" srcPath
Expand Down Expand Up @@ -61,9 +58,6 @@ let dependencies = [
"Build"
==> "Test"

"Build"
==> "Docs"

"Build"
==> "Pack"
]
Expand Down
4 changes: 2 additions & 2 deletions examples/timeflies/TimeFlies.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<WarnOn>3390;$(WarnOn)</WarnOn>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Python" Version="4.*" />
<PackageReference Include="Fable.Core" Version="4.*" />
<PackageReference Include="Fable.Core" Version="5.0.0-beta.2" />
<PackageReference Include="FSharp.Control.AsyncRx" Version="1.6.5" />
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions examples/timeflies/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ authors = [{ name = "Dag Brattli", email = "dag@brattli.net" }]
license = "MIT"
requires-python = ">=3.11"
dependencies = [
"fable-library>=0.8.0",
#"fable-python",
#"fsharp-control-async-rx",
"fable-library==5.0.0a17",
]

[dependency-groups]
Expand Down
165 changes: 109 additions & 56 deletions examples/timeflies/uv.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

source https://api.nuget.org/v3/index.json
storage: none
framework: netstandard2.0, netstandard2.1, net6.0, net8.0, net9.0
framework: netstandard2.0, netstandard2.1, net6.0, net8.0, net9.0, net10.0

nuget FSharp.Core >= 4.7.2 lowest_matching: true
nuget Fable.Core ~> 4.1
nuget Fable.Core 5.0.0-beta.2

group Test
source https://api.nuget.org/v3/index.json
storage: none
framework: net9.0

nuget FSharp.Core
nuget Fable.Core ~> 4.1
nuget Fable.Core 5.0.0-beta.2
nuget Microsoft.NET.Test.Sdk ~> 16
nuget xunit ~> 2
nuget xunit.runner.visualstudio ~> 2
Expand Down
102 changes: 53 additions & 49 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -1,86 +1,90 @@
STORAGE: NONE
RESTRICTION: || (== net6.0) (== net8.0) (== net9.0) (== netstandard2.0) (== netstandard2.1)
RESTRICTION: || (== net10.0) (== net6.0) (== net8.0) (== net9.0) (== netstandard2.0) (== netstandard2.1)
NUGET
remote: https://api.nuget.org/v3/index.json
Fable.Core (4.5)
Fable.Core (5.0.0-beta.2)
FSharp.Core (>= 4.7.2)
FSharp.Core (4.7.2)

GROUP Build
STORAGE: NONE
RESTRICTION: == net8.0
NUGET
remote: https://api.nuget.org/v3/index.json
Fake.Core.CommandLineParsing (6.1.3)
Fake.Core.CommandLineParsing (6.1.4)
FParsec (>= 1.1.1)
FSharp.Core (>= 8.0.301)
Fake.Core.Context (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Environment (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.FakeVar (6.1.3)
Fake.Core.Context (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Process (6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.FakeVar (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.IO.FileSystem (>= 6.1.3)
FSharp.Core (>= 8.0.301)
FSharp.Core (>= 8.0.400)
Fake.Core.Context (6.1.4)
FSharp.Core (>= 8.0.400)
Fake.Core.Environment (6.1.4)
FSharp.Core (>= 8.0.400)
Fake.Core.FakeVar (6.1.4)
Fake.Core.Context (>= 6.1.4)
FSharp.Core (>= 8.0.400)
Fake.Core.Process (6.1.4)
Fake.Core.Environment (>= 6.1.4)
Fake.Core.FakeVar (>= 6.1.4)
Fake.Core.String (>= 6.1.4)
Fake.Core.Trace (>= 6.1.4)
Fake.IO.FileSystem (>= 6.1.4)
FSharp.Core (>= 8.0.400)
System.Collections.Immutable (>= 8.0)
Fake.Core.String (6.1.3)
FSharp.Core (>= 8.0.301)
Fake.Core.Target (6.1.3)
Fake.Core.CommandLineParsing (>= 6.1.3)
Fake.Core.Context (>= 6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.FakeVar (>= 6.1.3)
Fake.Core.Process (>= 6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
Fake.Core.String (6.1.4)
FSharp.Core (>= 8.0.400)
Fake.Core.Target (6.1.4)
Fake.Core.CommandLineParsing (>= 6.1.4)
Fake.Core.Context (>= 6.1.4)
Fake.Core.Environment (>= 6.1.4)
Fake.Core.FakeVar (>= 6.1.4)
Fake.Core.Process (>= 6.1.4)
Fake.Core.String (>= 6.1.4)
Fake.Core.Trace (>= 6.1.4)
FSharp.Control.Reactive (>= 5.0.2)
FSharp.Core (>= 8.0.301)
Fake.Core.Trace (6.1.3)
Fake.Core.Environment (>= 6.1.3)
Fake.Core.FakeVar (>= 6.1.3)
FSharp.Core (>= 8.0.301)
Fake.IO.FileSystem (6.1.3)
Fake.Core.String (>= 6.1.3)
Fake.Core.Trace (>= 6.1.3)
FSharp.Core (>= 8.0.301)
FSharp.Core (>= 8.0.400)
Fake.Core.Trace (6.1.4)
Fake.Core.Environment (>= 6.1.4)
Fake.Core.FakeVar (>= 6.1.4)
FSharp.Core (>= 8.0.400)
Fake.IO.FileSystem (6.1.4)
Fake.Core.String (>= 6.1.4)
Fake.Core.Trace (>= 6.1.4)
FSharp.Core (>= 8.0.400)
FParsec (1.1.1)
FSharp.Core (>= 4.3.4)
FSharp.Control.Reactive (6.1.2)
FSharp.Core (>= 6.0.7)
System.Reactive (>= 6.0.1)
FSharp.Core (9.0.300)
System.Collections.Immutable (9.0.6)
System.Reactive (6.0.1)
FSharp.Core (10.0.100)
System.Collections.Immutable (10.0)
System.Reactive (6.1)

GROUP Test
STORAGE: NONE
RESTRICTION: == net9.0
NUGET
remote: https://api.nuget.org/v3/index.json
Fable.Core (4.5)
FSharp.Core (9.0.300)
Microsoft.CodeCoverage (17.14.1)
Fable.Core (5.0.0-beta.2)
FSharp.Core (>= 4.7.2)
FSharp.Core (10.0.100)
Microsoft.CodeCoverage (18.0.1)
Microsoft.NET.Test.Sdk (16.11)
Microsoft.CodeCoverage (>= 16.11)
Microsoft.TestPlatform.TestHost (>= 16.11)
Microsoft.TestPlatform.ObjectModel (17.14.1)
Microsoft.TestPlatform.ObjectModel (18.0.1)
System.Reflection.Metadata (>= 8.0)
Microsoft.TestPlatform.TestHost (17.14.1)
Microsoft.TestPlatform.ObjectModel (>= 17.14.1)
Microsoft.TestPlatform.TestHost (18.0.1)
Microsoft.TestPlatform.ObjectModel (>= 18.0.1)
Newtonsoft.Json (>= 13.0.3)
Newtonsoft.Json (13.0.3)
System.Reflection.Metadata (9.0.6)
Newtonsoft.Json (13.0.4)
System.Collections.Immutable (10.0)
System.Reflection.Metadata (10.0)
System.Collections.Immutable (>= 10.0)
xunit (2.9.3)
xunit.analyzers (>= 1.18)
xunit.assert (>= 2.9.3)
xunit.core (2.9.3)
xunit.abstractions (2.0.3)
xunit.analyzers (1.22)
xunit.analyzers (1.26)
xunit.assert (2.9.3)
xunit.core (2.9.3)
xunit.extensibility.core (2.9.3)
Expand Down
34 changes: 30 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,46 @@ name = "Fable.Python"
version = "4.4.0"
description = "Fable"
authors = [{ name = "Dag Brattli", email = "dag@brattli.net" }]
requires-python = ">= 3.10, < 4.0"
requires-python = ">= 3.12, < 4"
readme = "README.md"
license = "MIT"
dependencies = [
"fable-library==5.0.0a17",
]

[project.urls]
Homepage = "https://fable.io"

[dependency-groups]
dev = [
"pytest>=6.2.4,<7",
"black>=24.3.0,<25",
"jupyter-book>=0.13.1,<0.14",
"ruff>=0.14.0",
]

[tool.ruff]
target-version = "py312"
line-length = 100

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"C4", # flake8-comprehensions
]
ignore = [
"E501", # line too long (handled by formatter)
]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"

[tool.pyright]
reportMissingTypeStubs = false
reportMissingImports = false
Expand All @@ -33,5 +59,5 @@ reportConstantRedefinition = true
reportOverlappingOverload = true
reportInconsistentConstructor = true
reportImplicitStringConcatenation = true
pythonVersion = "3.10"
pythonVersion = "3.12"
typeCheckingMode = "basic"
2 changes: 1 addition & 1 deletion src/Fable.Python.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Author>Dag Brattli</Author>
<Copyright>Dag Brattli</Copyright>
Expand Down
23 changes: 22 additions & 1 deletion src/flask/Flask.fs
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
/// Type bindings for Flask web framework: https://flask.palletsprojects.com/
module Fable.Python.Flask

open Fable.Core

// fsharplint:disable MemberNames

/// Base interface for Flask request objects
type RequestBase =
/// The URL of the current request
abstract url: string

/// Flask request object containing information about the current HTTP request
type Request =
inherit RequestBase

/// Flask application object
type Flask =
/// Decorator to register a view function for a given URL rule
abstract route: rule: string -> ((unit -> string) -> Flask)
/// Decorator to register a view function for a given URL rule with specific HTTP methods
abstract route: rule: string * methods: string array -> ((unit -> string) -> Flask)

/// Static constructor interface for Flask application
type FlaskStatic =
/// Create a Flask application with a static URL path
[<Emit("$0($1, static_url_path=$2)")>]
abstract Create: name: string * static_url_path: string -> Flask

/// Flask application constructor
[<Import("Flask", "flask")>]
let Flask: FlaskStatic = nativeOnly

[<Erase>]
type IExports =
/// Render a template by name
/// See https://flask.palletsprojects.com/api/#flask.render_template
abstract render_template: template_name_or_list: string -> string
/// Render a template from a sequence of names (tries each until one succeeds)
/// See https://flask.palletsprojects.com/api/#flask.render_template
abstract render_template: template_name_or_list: string seq -> string
/// The current request object
/// See https://flask.palletsprojects.com/api/#flask.request
abstract request: Request

/// Generate a URL for the given endpoint with the given filename
/// See https://flask.palletsprojects.com/api/#flask.url_for
[<Emit("flask.url_for($0, filename=$1)")>]
abstract url_for: route: string * filename: string -> string
abstract url_for: endpoint: string * filename: string -> string

/// Flask web framework module
[<ImportAll("flask")>]
let flask: IExports = nativeOnly
2 changes: 1 addition & 1 deletion src/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "fable-python"
version = "0.19.0"
description = "Python bindings for Fable"
authors = [{ name = "Dag Brattli", email = "dag@brattli.net" }]
requires-python = ">= 3.10, < 4.0"
requires-python = ">= 3.12, < 4.0"
license = "MIT"
dependencies = ["fable-library>=0.8.0"]

Expand Down
Loading