🧑‍💻 Dev: 迁移使用 uv 管理项目依赖 (#3607)

This commit is contained in:
Ju4tCode
2025-07-31 21:52:24 +08:00
committed by GitHub
parent c45f956c3d
commit d6bc43057e
28 changed files with 3433 additions and 9944 deletions

View File

@ -13,7 +13,7 @@ on:
- ".github/actions/setup-python/**"
- ".github/workflows/codecov.yml"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
jobs:
test:
@ -40,13 +40,11 @@ jobs:
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
env-dir: ./envs/${{ matrix.env }}
no-root: true
env-group: ${{ matrix.env }}
- name: Run Pytest
run: |
cd ./envs/${{ matrix.env }}
poetry run bash "../../scripts/run-tests.sh"
uv run --no-sync bash ./scripts/run-tests.sh
- name: Upload test results
uses: codecov/test-results-action@v1

View File

@ -13,7 +13,7 @@ on:
- ".github/actions/setup-python/**"
- ".github/workflows/pyright.yml"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
jobs:
pyright:
@ -33,11 +33,10 @@ jobs:
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
env-dir: ./envs/${{ matrix.env }}
no-root: true
env-group: ${{ matrix.env }}
- run: |
(cd ./envs/${{ matrix.env }} && echo "$(poetry env info --path)/bin" >> $GITHUB_PATH)
echo "$(dirname $(uv python find))" >> $GITHUB_PATH
if [ "${{ matrix.env }}" = "pydantic-v1" ]; then
sed -i 's/PYDANTIC_V2 = true/PYDANTIC_V2 = false/g' ./pyproject.toml
fi

View File

@ -84,7 +84,7 @@ jobs:
- name: Get Version
id: version
run: |
echo "VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT
echo "VERSION=$(uv version --short)" >> $GITHUB_OUTPUT
echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
@ -102,10 +102,8 @@ jobs:
- name: Build Package
run: |
poetry build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uv build
uv publish
- name: Publish package to GitHub
run: |
@ -117,13 +115,9 @@ jobs:
run: |
yarn build:plugin --out-dir ../packages/nonebot-plugin-docs/nonebot_plugin_docs/dist
cd packages/nonebot-plugin-docs/
poetry version ${{ steps.version.outputs.VERSION }}
poetry build
- name: Publish Doc Package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: packages/nonebot-plugin-docs/dist/
uv version ${{ steps.version.outputs.VERSION }}
uv build
uv publish
- name: Publish Doc Package to GitHub
run: |

View File

@ -27,7 +27,7 @@ jobs:
- name: Build API Doc
uses: ./.github/actions/build-api-doc
- run: echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV
- run: echo "TAG_NAME=v$(uv version --short)" >> $GITHUB_ENV
- name: Archive Changelog
uses: docker://ghcr.io/nonebot/auto-changelog:master
@ -39,7 +39,7 @@ jobs:
- name: Archive Files
run: |
yarn archive $(poetry version -s)
yarn archive $(uv version --short)
yarn prettier
- name: Push Tag
@ -47,6 +47,6 @@ jobs:
git config user.name noneflow[bot]
git config user.email 129742071+noneflow[bot]@users.noreply.github.com
git add .
git commit -m ":bookmark: Release $(poetry version -s)"
git commit -m ":bookmark: Release $(uv version --short)"
git tag ${{ env.TAG_NAME }}
git push && git push --tags

View File

@ -13,7 +13,7 @@ on:
- ".github/actions/setup-python/**"
- ".github/workflows/ruff.yml"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
jobs:
ruff: