Skip to content

Commit fdcc5d9

Browse files
he0119yanyongyu
andauthored
🧑‍💻 Develop: 迁移使用 uv 管理项目依赖 (#43)
Co-authored-by: Ju4tCode <[email protected]>
1 parent 0b8ed9b commit fdcc5d9

File tree

8 files changed

+1119
-1325
lines changed

8 files changed

+1119
-1325
lines changed

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "Default Linux Universal",
3-
"image": "mcr.microsoft.com/devcontainers/universal:2-linux",
2+
"name": "Ubuntu",
3+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
44
"features": {
5-
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
5+
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {}
66
},
7-
"postCreateCommand": "poetry config virtualenvs.in-project true && poetry install && poetry run pre-commit install",
7+
"postCreateCommand": "uv sync && uv run pre-commit install",
88
"customizations": {
99
"vscode": {
1010
"settings": {

.github/actions/setup-python/action.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v5
1616

17-
- name: Setup Python environment
18-
uses: ./.github/actions/setup-python
17+
- name: Install the latest version of uv
18+
uses: astral-sh/setup-uv@v7
1919

2020
- name: Get Version
2121
id: version
2222
run: |
23-
echo "VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT
23+
echo "VERSION=$(uv version --short)" >> $GITHUB_OUTPUT
2424
echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
2525
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2626
@@ -29,11 +29,10 @@ jobs:
2929
run: exit 1
3030

3131
- name: Build Package
32-
run: |
33-
poetry build
32+
run: uv build
3433

3534
- name: Publish package to PyPI
36-
uses: pypa/gh-action-pypi-publish@release/v1
35+
run: uv publish
3736

3837
- name: Publish package to GitHub
3938
run: |

.github/workflows/ruff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
paths:
99
- "nonebot/**"
1010
- "codegen/**"
11-
- "poetry.lock"
11+
- "uv.lock"
1212
- "pyproject.toml"
1313

1414
jobs:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ _✨ GitHub 协议适配 ✨_
4545
## 安装
4646

4747
```bash
48-
poetry add nonebot-adapter-github
48+
uv add nonebot-adapter-github
4949
# 或者
5050
pip install nonebot-adapter-github
5151
```

poetry.lock

Lines changed: 0 additions & 1268 deletions
This file was deleted.

pyproject.toml

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
[tool.poetry]
1+
[project]
22
name = "nonebot-adapter-github"
33
version = "0.5.0"
44
description = "GitHub adapter for nonebot2"
5-
authors = ["yanyongyu <[email protected]>"]
6-
license = "MIT"
5+
authors = [{ name = "yanyongyu", email = "[email protected]" }]
6+
requires-python = ">=3.9, <4.0"
77
readme = "README.md"
8-
homepage = "https://github.com/nonebot/adapter-github"
9-
repository = "https://github.com/nonebot/adapter-github"
10-
documentation = "https://github.com/nonebot/adapter-github"
8+
license = "MIT"
119
keywords = ["bot", "github", "webhook"]
1210
classifiers = [
1311
"Development Status :: 5 - Production/Stable",
@@ -16,19 +14,32 @@ classifiers = [
1614
"Operating System :: OS Independent",
1715
"Programming Language :: Python :: 3",
1816
]
19-
packages = [{ include = "nonebot" }]
17+
dependencies = [
18+
"nonebot2>=2.2.0,<3",
19+
"pydantic>=1.10.0,<3.0.0,!=2.5.0,!=2.5.1",
20+
"githubkit[auth-app]>=0.12.2,<0.13.0",
21+
]
2022

21-
[tool.poetry.dependencies]
22-
python = "^3.9"
23-
nonebot2 = "^2.2.0"
24-
pydantic = ">=1.10.0,<3.0.0,!=2.5.0,!=2.5.1"
25-
githubkit = { version = ">=0.12.2,<0.13.0", extras = ["auth-app"] }
23+
[project.urls]
24+
Homepage = "https://github.com/nonebot/adapter-github"
25+
Repository = "https://github.com/nonebot/adapter-github"
26+
Documentation = "https://github.com/nonebot/adapter-github"
2627

27-
[tool.poetry.group.dev.dependencies]
28-
ruff = "^0.8.2"
29-
Jinja2 = "^3.1.2"
30-
nonemoji = "^0.1.2"
31-
pre-commit = "^3.1.0"
28+
[dependency-groups]
29+
dev = [
30+
"ruff>=0.8.2,<0.9",
31+
"Jinja2>=3.1.2,<4",
32+
"nonemoji>=0.1.2,<0.2",
33+
"pre-commit>=3.1.0,<4",
34+
]
35+
36+
[build-system]
37+
requires = ["uv_build>=0.9.1,<0.10.0"]
38+
build-backend = "uv_build"
39+
40+
[tool.uv.build-backend]
41+
module-name = "nonebot.adapters.github"
42+
module-root = ""
3243

3344
[tool.ruff]
3445
line-length = 88
@@ -92,7 +103,3 @@ typeCheckingMode = "standard"
92103
reportShadowedImports = false
93104
reportIncompatibleVariableOverride = false
94105
disableBytesTypePromotions = true
95-
96-
[build-system]
97-
requires = ["poetry-core>=1.0.0"]
98-
build-backend = "poetry.core.masonry.api"

uv.lock

Lines changed: 1080 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)