Skip to content

Commit b240ba0

Browse files
committed
chore(project): 更新项目配置以使用uv包管理器
- 将Python版本从3.8升级到3.14 - 移除pdm.lock文件并添加uv.lock文件 - 在publish.yml工作流中替换pdm为uv命令 - 在test.yml工作流中替换pdm为uv命令 - 新增lint.yml工作流用于代码检查 - 更新pyproject.toml中的依赖组配置 - 修改构建系统为uv_build - 更新IDE模块配置以使用uv - 添加ruff配置文件
1 parent dd0e481 commit b240ba0

8 files changed

Lines changed: 414 additions & 269 deletions

File tree

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- name: Install uv and set the Python version
15+
uses: astral-sh/setup-uv@v7
16+
- name: Set up Python
17+
run: uv python install
18+
- name: Install dependencies
19+
run: uv sync
20+
- name: Check code
21+
run: uv run ruff check
22+
- name: Check format
23+
run: uv run ruff format --check
24+

.github/workflows/publish.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ name: Publish Python Package
22

33
on:
44
release:
5-
types: [published]
5+
types: [ published ]
66

77
jobs:
88
pypi-publish:
9-
name: upload release to PyPI
9+
name: Publish to PyPI
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: read
1313
id-token: write
1414
environment: publish
1515
steps:
16-
- uses: actions/checkout@v4
17-
- name: Setup PDM
18-
uses: pdm-project/setup-pdm@v4
19-
with:
20-
python-version: 3.13
16+
- uses: actions/checkout@v6
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v7
19+
- name: Set up Python
20+
run: uv python install
21+
- name: Build package
22+
run: uv build
2123
- name: Publish package distributions to PyPI
22-
run: pdm publish
24+
run: uv publish

.github/workflows/test.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ jobs:
1313
matrix:
1414
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
1515
steps:
16-
- uses: actions/checkout@v4
17-
- name: Setup PDM with Python ${{ matrix.python-version }}
18-
uses: pdm-project/setup-pdm@v4
16+
- uses: actions/checkout@v6
17+
- name: Install uv and set the Python version
18+
uses: astral-sh/setup-uv@v7
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install dependencies
22-
run: |
23-
pdm use ${{ matrix.python-version }}
24-
pdm install -G:all
22+
run: uv sync
2523
- name: Test with pytest
26-
run: pdm run test
24+
run: uv run pytest
2725

.idea/TtkText.iml

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8
1+
3.14

pdm.lock

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

pyproject.toml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
name = "ttk-text"
33
version = "0.2.2"
44
description = "Themed Tkinter Text widget with modern styling support."
5-
authors = [
6-
{ name = "Jesse205", email = "jesse205@qq.com" },
7-
]
8-
maintainers = [
9-
{ name = "Jesse205", email = "jesse205@qq.com" },
10-
]
5+
authors = [{ name = "Jesse205", email = "jesse205@qq.com" }]
6+
maintainers = [{ name = "Jesse205", email = "jesse205@qq.com" }]
117
dependencies = []
128
requires-python = ">=3.8"
139
readme = "README_pypi.md"
@@ -30,34 +26,30 @@ classifiers = [
3026
"Operating System :: Microsoft :: Windows :: Windows 7",
3127
"Topic :: Software Development :: Libraries :: Python Modules",
3228
]
33-
keywords = [
34-
"ttk",
35-
"ttk-text",
36-
"tkinter",
37-
"tkinter-text",
38-
"tk",
39-
"tk-text",
40-
]
29+
keywords = ["ttk", "ttk-text", "tkinter", "tkinter-text", "tk", "tk-text"]
4130

4231
[project.urls]
4332
Repository = "https://github.com/HelloTool/ttk-text"
4433
Tracker = "https://github.com/HelloTool/ttk-text/issues"
4534
Changelog = "https://github.com/HelloTool/ttk-text/releases"
4635

4736
[dependency-groups]
48-
test = [
49-
"pytest>=8.3.4",
37+
dev = [
38+
{ include-group = "lint" },
39+
{ include-group = "test" },
40+
{ include-group = "example" },
5041
]
51-
example = [
52-
"sv-ttk>=2.6.0",
42+
test = ["pytest>=8.3.4"]
43+
example = ["sv-ttk>=2.6.0"]
44+
lint = [
45+
"pyright>=1.1.407",
46+
"ruff>=0.14.10",
5347
]
5448

55-
[tool.pdm]
56-
distribution = true
57-
58-
[tool.pdm.scripts]
59-
test = "pytest tests/ -v"
49+
[tool.ruff]
50+
line-length = 120
51+
extend-exclude = ["external-themes/**"]
6052

6153
[build-system]
62-
requires = ["pdm-backend"]
63-
build-backend = "pdm.backend"
54+
requires = ["uv_build>=0.9.22,<0.10.0"]
55+
build-backend = "uv_build"

0 commit comments

Comments
 (0)