♻️ 将所有 poetry 替换为 uv

This commit is contained in:
suyiiyii 2024-12-22 21:15:32 +08:00
parent 6c8b37f085
commit 08c8bb955f
Signed by: suyiiyii
GPG Key ID: 044704CB29B8AD85
5 changed files with 21 additions and 17 deletions

View File

@ -6,6 +6,10 @@ inputs:
description: Python version
required: false
default: "3.10"
install-deps:
description: Install dependencies
required: false
default: false
runs:
using: "composite"
@ -20,3 +24,7 @@ runs:
with:
version: "latest"
enable-cache: true
- name: Install dependencies
if: ${{ inputs.install-deps == true }}
run: uv sync --frozen

View File

@ -11,7 +11,7 @@ on:
- nonebot_bison/**
- tests/**
- pyproject.toml
- poetry.lock
- uv.lock
- docker.env.prod
- .github/**
pull_request:
@ -21,7 +21,7 @@ on:
- nonebot_bison/**
- tests/**
- pyproject.toml
- poetry.lock
- uv.lock
- docker.env.prod
- .github/**
types:
@ -72,12 +72,10 @@ jobs:
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: poetry install
install-deps: "true"
- name: Run Pytest
run: poetry run pytest --cov-report xml --cov=./nonebot_bison -k 'not compare and not render' -n auto
run: uv run pytest --cov-report xml --cov=./nonebot_bison -k 'not compare and not render' -n auto
- name: Upload coverage report
uses: codecov/codecov-action@v5
@ -106,12 +104,10 @@ jobs:
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: poetry install
install-deps: true
- name: Run Pytest
run: poetry run pytest --cov-report xml --cov=./nonebot_bison -k 'not compare' -n auto
run: uv run pytest --cov-report xml --cov=./nonebot_bison -k 'not compare' -n auto
- name: Upload coverage report
uses: codecov/codecov-action@v5

View File

@ -11,7 +11,7 @@ on:
- nonebot_bison/**
- tests/**
- pyproject.toml
- poetry.lock
- uv.lock
- docker.env.prod
- .github/**
pull_request:
@ -21,7 +21,7 @@ on:
- nonebot_bison/**
- tests/**
- pyproject.toml
- poetry.lock
- uv.lock
- docker.env.prod
- .github/**
types:
@ -55,7 +55,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: poetry add pydantic@^1.10 && poetry install
run: uv add pydantic==1.10 && uv sync --frozen
- name: Run Pytest
run: poetry run pytest -k 'not compare and not render' -n auto
run: uv run pytest -k 'not compare and not render' -n auto

View File

@ -16,7 +16,7 @@ jobs:
- name: Setup Python environment
uses: ./.github/actions/setup-python
- run: echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV
- run: echo "TAG_NAME=v$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)" >> $GITHUB_ENV
- name: Archive Changelog
uses: docker://ghcr.io/nonebot/auto-changelog:master
@ -30,6 +30,6 @@ jobs:
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add .
git commit -m ":bookmark: Release $(poetry version -s)"
git commit -m ":bookmark: Release ${{ env.TAG_NAME }}"
git tag ${{ env.TAG_NAME }}
git push && git push --tags

View File

@ -54,7 +54,7 @@ jobs:
- name: Publish PyPI and Github
run: |
poetry publish --build -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} || echo "Already pushed to pypi"
uv publish --build -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} || echo "Already pushed to pypi"
gh release upload --clobber ${{ env.TAG_NAME }} dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}