Skip to content

Commit dc8042c

Browse files
authored
feat: migrate from poetry to uv (#1987)
1 parent cbd1fb5 commit dc8042c

File tree

12 files changed

+3636
-4445
lines changed

12 files changed

+3636
-4445
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,27 @@ jobs:
5050
- uses: actions/cache@v4
5151
with:
5252
path: ~/.cache/pip
53-
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
53+
key: ${{ runner.os }}-pip-${{ hashFiles('**/uv.lock') }}
5454
restore-keys: |
5555
${{ runner.os }}-pip-
5656
- uses: actions/checkout@v4
5757
- uses: actions/setup-python@v5
5858
with:
5959
python-version: ${{ matrix.python-version }}
60-
- name: Install and configure Poetry
61-
run: |
62-
pip install -U pip poetry
63-
poetry config virtualenvs.create false
60+
- uses: astral-sh/setup-uv@v6
6461
- name: Install ODBC driver
6562
run: |
6663
curl -sSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb
6764
sudo dpkg -i packages-microsoft-prod.deb
6865
sudo apt-get update
6966
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
7067
- name: Run ci
71-
run: make ci
68+
run: uv run make ci
7269
- name: Test FastAPI/Blacksheep Example
7370
run: |
74-
PYTHONPATH=$DEST_FASTAPI pytest $PYTEST_ARGS $DEST_FASTAPI/_tests.py
75-
PYTHONPATH=$DEST_BLACKSHEEP pytest $PYTEST_ARGS $DEST_BLACKSHEEP/_tests.py
76-
PYTHONPATH=$DEST_SANIC pytest $PYTEST_ARGS $DEST_SANIC/_tests.py
71+
PYTHONPATH=$DEST_FASTAPI uv run pytest $PYTEST_ARGS $DEST_FASTAPI/_tests.py
72+
PYTHONPATH=$DEST_BLACKSHEEP uv run pytest $PYTEST_ARGS $DEST_BLACKSHEEP/_tests.py
73+
PYTHONPATH=$DEST_SANIC uv run pytest $PYTEST_ARGS $DEST_SANIC/_tests.py
7774
env:
7875
DEST_FASTAPI: examples/fastapi
7976
DEST_BLACKSHEEP: examples/blacksheep

.github/workflows/codspeed.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-python@v5
1919
with:
20-
# 3.12 is the minimum reqquired version for profiling enabled
20+
# 3.12 is the minimum required version for profiling enabled
2121
python-version: "3.12"
2222

23-
- name: Install and configure Poetry
24-
run: |
25-
pip install -U pip poetry
26-
poetry config virtualenvs.create false
23+
- uses: astral-sh/setup-uv@v6
2724

28-
- name: Install dependencies
25+
- name: Build dists
2926
run: make build
3027

3128
- name: Run benchmarks
3229
uses: CodSpeedHQ/action@v3
3330
with:
3431
token: ${{ secrets.CODSPEED_TOKEN }}
35-
run: pytest tests/benchmarks --codspeed
32+
run: uv run pytest tests/benchmarks --codspeed

.github/workflows/gh-pages-release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ jobs:
1111
- uses: actions/setup-python@v5
1212
with:
1313
python-version: "3.9"
14-
- name: Install and configure Poetry
15-
run: |
16-
pip install -U pip poetry
17-
poetry config virtualenvs.create false
14+
- uses: astral-sh/setup-uv@v6
1815
- name: Build docs
19-
run: make docs
16+
run: uv run make docs
2017
- name: Deploy release docs
2118
uses: peaceiris/actions-gh-pages@v3
2219
with:

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ jobs:
1212
- uses: actions/setup-python@v5
1313
with:
1414
python-version: "3.9"
15-
- name: Install and configure Poetry
16-
run: |
17-
pip install -U pip poetry
18-
poetry config virtualenvs.create false
15+
- uses: astral-sh/setup-uv@v6
1916
- name: Build docs
20-
run: make docs
17+
run: uv run make docs
2118
- name: Deploy latest docs
2219
uses: peaceiris/actions-gh-pages@v3
2320
with:

.github/workflows/pypi.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ jobs:
1111
- uses: actions/setup-python@v5
1212
with:
1313
python-version: '3.9'
14-
- name: Install and configure Poetry
15-
run: |
16-
pip install -U pip poetry
17-
poetry config virtualenvs.create false
18-
- name: Install requirements
19-
run: make deps
14+
- uses: astral-sh/setup-uv@v6
2015
- name: Build dists
2116
run: make build
2217
- name: Pypi Publish

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,6 @@ ENV/
110110

111111
# macos
112112
.DS_Store
113+
114+
# pdm
115+
.pdm-python

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ help:
2121
@echo " lint Auto-formats the code and check type hints"
2222

2323
up:
24-
@poetry update
24+
@uv lock --upgrade
2525

2626
deps:
27-
@poetry install --all-groups -E asyncpg -E accel -E psycopg -E asyncodbc -E aiomysql
27+
@uv sync --all-groups --extra asyncpg --extra accel --extra psycopg --extra asyncodbc --extra aiomysql $(options)
2828

2929
deps_with_asyncmy:
30-
@poetry install --all-groups -E asyncpg -E accel -E psycopg -E asyncodbc -E asyncmy
30+
@uv sync --all-groups --extra asyncpg --extra accel --extra psycopg --extra asyncodbc --extra asyncmy $(options)
3131

3232
check: build _check
3333
_check:
@@ -99,7 +99,7 @@ docs: deps
9999

100100
build: deps
101101
rm -fR dist/
102-
poetry build
102+
uv build
103103

104104
publish: deps _build
105105
twine upload dist/*

0 commit comments

Comments
 (0)