Skip to content

Commit fd8283d

Browse files
authored
Migrate to uv (#136)
* Migrate to uv * More uv fixes * Fix test build
1 parent 7874444 commit fd8283d

21 files changed

+3224
-3969
lines changed

.config/dotnet-tools.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@
33
"isRoot": true,
44
"tools": {
55
"paket": {
6-
"version": "8.0.3",
6+
"version": "9.0.2",
77
"commands": [
88
"paket"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"fable": {
12-
"version": "4.9.0",
13+
"version": "4.24.0",
1314
"commands": [
1415
"fable"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"fantomas": {
1820
"version": "6.2.3",
1921
"commands": [
2022
"fantomas"
21-
]
23+
],
24+
"rollForward": false
2225
}
2326
}
2427
}

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12-
- package-ecosystem: "poetry" # See documentation for possible values
12+
- package-ecosystem: "uv" # See documentation for possible values
1313
directory: "/" # Location of package manifests
1414
schedule:
1515
interval: "weekly"

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
dotnet-version: |
2323
6.x
2424
8.x
25+
9.x
2526
2627
- name: Setup dotnet tools
2728
run: dotnet tool restore
@@ -33,7 +34,7 @@ jobs:
3334
run: dotnet restore test
3435

3536
- name: Install pytest runner
36-
run: pip install pytest
37+
run: pipx install pytest
3738

3839
- name: Install build dependencies
3940
run: dotnet restore Build.fsproj
@@ -46,8 +47,8 @@ jobs:
4647

4748
- name: Install dependencies
4849
run: |
49-
pip install poetry
50-
poetry install
50+
pipx install uv
51+
uv sync
5152
5253
- name: Test
5354
run: dotnet run Test

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
dotnet-version: |
2020
6.x
2121
8.x
22+
9.x
2223
2324
- name: Setup tools
2425
run: dotnet tool restore

.paket/Paket.Restore.targets

Lines changed: 505 additions & 497 deletions
Large diffs are not rendered by default.

Build.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Target.create "Build" (fun _ ->
2323
)
2424

2525
Target.create "Docs" (fun _ ->
26-
run poetry $"run jb build docs-src --path-output {buildPath}/docs" "."
26+
run uv $"run jb build docs-src --path-output {buildPath}/docs" "."
2727
Fake.IO.Shell.copyDir "docs" $"{buildPath}/docs/_build/html" (fun _ -> true)
2828
)
2929

@@ -37,7 +37,7 @@ Target.create "Test" (fun _ ->
3737
"python", dotnet $"fable --lang Python --outDir {buildPath}/tests" testsPath
3838
]
3939
|> runParallel
40-
run poetry $"run pytest {buildPath}/tests" ""
40+
run uv $"run pytest {buildPath}/tests" ""
4141
)
4242

4343
Target.create "Pack" (fun _ ->

Helpers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ let dotnet = createProcess "dotnet"
7575

7676

7777
let pytest = createProcess "pytest"
78-
let poetry = createProcess "poetry"
78+
let uv = createProcess "uv"
7979
let jupyterBook = createProcess "jb"
8080

8181
let npm =

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ It contains example code for using Fable Python with:
8484
- [Typed-BNF](https://github.com/thautwarm/Typed-BNF#readme)
8585
- [Zanaptak.TypedCssClasses](https://github.com/zanaptak/TypedCssClasses)
8686

87-
## Poetry
87+
## Uv
8888

89-
Fable.Python uses [Poetry](https://python-poetry.org/) for package and
89+
Fable.Python uses [Uv](https://docs.astral.sh/uv/) for package and
9090
dependency management. To handle dependencies when adding Fable Python
9191
compatible NuGet packages, you should use
9292
[Femto](https://github.com/Zaid-Ajaj/Femto).
@@ -110,8 +110,8 @@ libraries as long as:
110110
There's not much Python specific documentation yet, but the process of
111111
adding type bindings for Python is similar to JS:
112112

113-
- https://fable.io/docs/communicate/js-from-fable.html
114-
- https://medium.com/@zaid.naom/f-interop-with-javascript-in-fable-the-complete-guide-ccc5b896a59f
113+
- <https://fable.io/docs/communicate/js-from-fable.html>
114+
- <https://medium.com/@zaid.naom/f-interop-with-javascript-in-fable-the-complete-guide-ccc5b896a59f>
115115

116116
## Differences from JS
117117

@@ -145,6 +145,6 @@ Current plan:
145145

146146
- Compile Fable.Library as a published library (done)
147147

148-
- Use poetry for Python references to Fable modules (done)
148+
- Use uv for Python references to Fable modules (done)
149149

150150
- Update docs

examples/timeflies/poetry.lock

Lines changed: 0 additions & 134 deletions
This file was deleted.

examples/timeflies/pyproject.toml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11

2-
[tool.poetry]
2+
[project]
33
name = "timeflies"
44
version = "0.1.0"
55
description = "Fable Timeflies Demo"
6-
authors = ["Dag Brattli <[email protected]>"]
6+
authors = [{ name = "Dag Brattli", email = "[email protected]" }]
77
license = "MIT"
8+
requires-python = ">=3.11"
9+
dependencies = [
10+
"fable-library>=0.8.0",
11+
#"fable-python",
12+
#"fsharp-control-async-rx",
13+
]
814

9-
[tool.poetry.dependencies]
10-
python = "^3.11"
11-
fable-library = ">=0.8.0"
12-
#fable-python = "*"
13-
#fsharp-control-async-rx = "*"
14-
15-
[tool.poetry.dev-dependencies]
16-
#fable-python = {path = "./fable_modules/fable-python", develop = true}
17-
#fsharp-control-async-rx = {path = "./fable_modules/fsharp-control-async-rx", develop = true}
18-
19-
[tool.poetry.group.dev.dependencies]
20-
black = "^24.3.0"
21-
22-
[build-system]
23-
requires = ["poetry-core>=1.0.0"]
24-
build-backend = "poetry.core.masonry.api"
15+
[dependency-groups]
16+
dev = [
17+
"black>=24.3.0",
18+
#"fable-python",
19+
#"fsharp-control-async-rx",
20+
]

0 commit comments

Comments
 (0)