Skip to content

Commit 2d93fdb

Browse files
committed
migrate from poetry to uv
1 parent 7823054 commit 2d93fdb

File tree

5 files changed

+54
-15
lines changed

5 files changed

+54
-15
lines changed

.github/workflows/poetry.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,29 @@ jobs:
77
steps:
88
- uses: actions/checkout@main
99
- run: ./poetry/admin.ps1 Install-Poetry
10-
- run: |
11-
& "$env:APPDATA\Python\Scripts\poetry" install --extras poetry
12-
- run: |
13-
& "$env:APPDATA\Python\Scripts\poetry" run python tests/poetry/test_.py
10+
- uses: astral-sh/setup-uv@main
11+
with:
12+
version: 'latest'
13+
- run: uv sync --extra poetry
14+
- run: uv run python tests/poetry/test_.py
1415

1516
ubuntu:
1617
runs-on: ubuntu-latest
1718
steps:
1819
- uses: actions/checkout@main
1920
- run: ./poetry/admin.sh install
20-
- run: poetry install --extras poetry
21-
- run: poetry run python tests/poetry/test_.py
21+
- uses: astral-sh/setup-uv@main
22+
with:
23+
version: 'latest'
24+
- run: uv sync --extra poetry
25+
- run: uv run python tests/poetry/test_.py
2226
mac:
2327
runs-on: macos-latest
2428
steps:
2529
- uses: actions/checkout@main
30+
- uses: astral-sh/setup-uv@main
31+
with:
32+
version: 'latest'
2633
- run: curl -sSL https://install.python-poetry.org | python3 -
27-
- run: poetry install --extras poetry
28-
- run: poetry run python tests/poetry/test_.py
34+
- run: uv sync --extra poetry
35+
- run: uv run python tests/poetry/test_.py

.github/workflows/publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@main
10-
- uses: snok/install-poetry@main
11-
- run: poetry build
12-
- run: poetry config http-basic.pypi __token__ ${{secrets.PYPI_TOKEN}}
13-
- run: poetry publish --skip-existing
10+
- uses: astral-sh/setup-uv@main
11+
with:
12+
version: 'latest'
13+
- run: uv build
14+
- run: uv publish --token ${{secrets.PYPI_TOKEN}}
1415
poetry-util:
1516
runs-on: windows-latest
1617
steps:

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-latest]
11-
version: ['3.9', '3.x']
11+
version: ['3.10', '3.x']
1212
runs-on: ${{matrix.os}}
1313
steps:
1414
- uses: actions/checkout@main
15-
- uses: davidkhala/poetry-buildpack@main
15+
- uses: davidkhala/uv-buildpack@main
1616
with:
1717
test-entry-point: pytest --ignore=tests/poetry
1818
version: ${{matrix.version}}

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ clean-poetry = "poetry:clean"
1919
[dependency-groups]
2020
dev = [
2121
"pytest",
22-
"python-dotenv",
2322
]
2423

2524
[tool.hatch.build.targets.sdist]

uv/admin.ps1

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
$ErrorActionPreference = "Stop"
2+
function Install
3+
{
4+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
5+
}
6+
function WinGet-Install
7+
{
8+
winget install --id=astral-sh.uv -e
9+
}
10+
function Uninstall
11+
{
12+
uv cache clean
13+
$python_dir = uv python dir
14+
if (Test-Path $python_dir)
15+
{
16+
Remove-Item $python_dir -Recurse -Force
17+
}
18+
19+
$tool_dir = uv tool dir
20+
if (Test-Path $tool_dir)
21+
{
22+
Remove-Item $tool_dir -Recurse -Force
23+
}
24+
25+
rm $HOME\.local\bin\uv.exe
26+
rm $HOME\.local\bin\uvx.exe
27+
}
28+
29+
if ($args.Count -gt 0)
30+
{
31+
Invoke-Expression ($args -join " ")
32+
}

0 commit comments

Comments
 (0)