Skip to content

Commit 1c9290a

Browse files
authored
feat: migrate from poetry to uv (#11)
* chore: add bandit and twine to make check * Fix ci error * chore: update make file * feat: migrate from poetry to uv * chore: add uv lock file * Fix ci error
1 parent b9202f1 commit 1c9290a

File tree

8 files changed

+1280
-646
lines changed

8 files changed

+1280
-646
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ jobs:
1313
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
1414
restore-keys: |
1515
${{ runner.os }}-pip-
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v5
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-python@v6
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020
allow-prereleases: true
21-
- name: Install and configure Poetry
22-
run: |
23-
pip install -U pip poetry
24-
poetry config virtualenvs.create false
21+
- uses: astral-sh/setup-uv@v6
22+
with:
23+
enable-cache: true
2524
- name: Run CI
26-
run: make ci
25+
run: uv run make ci

.github/workflows/pypi.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ jobs:
77
publish:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v4
11-
- uses: actions/setup-python@v5
10+
- uses: actions/checkout@v5
11+
- uses: actions/setup-python@v6
1212
with:
1313
python-version: '3.x'
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 dists
1916
run: make build
2017
- name: Pypi Publish
21-
uses: pypa/gh-action-pypi-publish@master
18+
uses: pypa/gh-action-pypi-publish@release/v1
2219
with:
2320
user: __token__
2421
password: ${{ secrets.pypi_password }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44

55
### 0.2.0
66

7+
- feat: migrate from poetry to uv
8+
- ci: activate ci workflow and add test for utils (#8)
79
- feat: generate schemas optionally ([#7])
810
- Use `asyncclick` instead of `click` ([#6])
911
- Only install tomlkit for Python version less than 3.11 ([#5])
1012
- Migrate lint tool from isort+black to ruff ([#5])
1113
- Drop support for Python3.8 ([#4])
1214

15+
[#8]: https://github.com/tortoise/tortoise-cli/pull/8
1316
[#7]: https://github.com/tortoise/tortoise-cli/pull/7
1417
[#6]: https://github.com/tortoise/tortoise-cli/pull/6
1518
[#5]: https://github.com/tortoise/tortoise-cli/pull/5

Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
checkfiles = tortoise_cli/ tests/ examples/ conftest.py
1+
src_dir = tortoise_cli
2+
checkfiles = $(src_dir) tests/ examples/ conftest.py
23
py_warn = PYTHONDEVMODE=1
4+
pytest_opts = -n auto --cov=$(src_dir) --cov-append --cov-branch --tb=native -q
35

46
up:
5-
@poetry update
7+
@uv lock --upgrade --verbose
68

79
deps:
8-
@poetry install --all-groups
10+
@uv sync --inexact --all-extras --all-groups $(options)
911

1012
style: deps _style
1113
_style:
1214
ruff format $(checkfiles)
1315
ruff check --fix $(checkfiles)
1416

15-
check: deps _check
17+
check: build _check
1618
_check:
1719
ruff format --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
1820
ruff check $(checkfiles)
1921
mypy $(checkfiles)
22+
bandit -c pyproject.toml -r $(checkfiles)
23+
twine check dist/*
2024

2125
test: deps _test
2226
_test:
23-
$(py_warn) pytest
27+
$(py_warn) pytest $(pytest_opts)
2428

2529
build: deps
26-
@poetry build
30+
rm -fR dist/
31+
uv build
2732

28-
ci: check _test
33+
ci: build _check _test

0 commit comments

Comments
 (0)