mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-05 19:46:47 +00:00
🧑💻 Dev: 迁移使用 uv 管理项目依赖 (#3607)
This commit is contained in:
8
.github/workflows/codecov.yml
vendored
8
.github/workflows/codecov.yml
vendored
@ -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
|
||||
|
7
.github/workflows/pyright.yml
vendored
7
.github/workflows/pyright.yml
vendored
@ -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
|
||||
|
18
.github/workflows/release-drafter.yml
vendored
18
.github/workflows/release-drafter.yml
vendored
@ -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: |
|
||||
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@ -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
|
||||
|
2
.github/workflows/ruff.yml
vendored
2
.github/workflows/ruff.yml
vendored
@ -13,7 +13,7 @@ on:
|
||||
- ".github/actions/setup-python/**"
|
||||
- ".github/workflows/ruff.yml"
|
||||
- "pyproject.toml"
|
||||
- "poetry.lock"
|
||||
- "uv.lock"
|
||||
|
||||
jobs:
|
||||
ruff:
|
||||
|
Reference in New Issue
Block a user