File tree Expand file tree Collapse file tree 4 files changed +34
-12
lines changed
repo_scaffold/templates/template-python/{{cookiecutter.project_slug}}/.github/workflows Expand file tree Collapse file tree 4 files changed +34
-12
lines changed Original file line number Diff line number Diff line change 34
34
with :
35
35
python-version : " 3.12"
36
36
37
+ - name : Install uv
38
+ uses : astral-sh/setup-uv@v5
39
+
37
40
- name : Run lint checks
38
41
id : lint
39
- run : uvx nox -s lint
42
+ run : uv tool run nox -s lint
40
43
continue-on-error : true
41
44
42
45
- name : Comment on PR
71
74
with :
72
75
python-version : " 3.12"
73
76
77
+ - name : Install uv
78
+ uses : astral-sh/setup-uv@v5
79
+
74
80
- name : Run tests on all Python versions
75
81
id : test
76
- run : uvx nox -s test_all
82
+ run : uv tool run nox -s test_all
77
83
continue-on-error : true
78
84
79
85
- name : Upload coverage reports
Original file line number Diff line number Diff line change 23
23
from pathlib import Path
24
24
25
25
# 支持的 Python 版本范围
26
- MIN_PYTHON = "3.10 "
26
+ MIN_PYTHON = "3.12 "
27
27
MAX_PYTHON = "3.12"
28
28
29
29
# 生成版本列表
30
- PYTHON_VERSIONS = [
31
- f"3.{ minor } "
32
- for minor in range (int (MIN_PYTHON .split ("." )[- 1 ]), int (MAX_PYTHON .split ("." )[- 1 ]) + 1 )
33
- ]
30
+ PYTHON_VERSIONS = [MIN_PYTHON ]
34
31
35
32
36
33
def install_with_uv (session : nox .Session , extras : list [str ] | None = None ) -> None :
Original file line number Diff line number Diff line change @@ -26,12 +26,20 @@ jobs:
26
26
needs : setup
27
27
runs-on : ubuntu-latest
28
28
steps :
29
- - name : Check Python version
30
- run : python --version
29
+ - name : Checkout code
30
+ uses : actions/checkout@v4
31
+
32
+ - name : Setup Python
33
+ uses : actions/setup-python@v5
34
+ with :
35
+ python-version : " {{cookiecutter.max_python_version}}"
36
+
37
+ - name : Install uv
38
+ uses : astral-sh/setup-uv@v5
31
39
32
40
- name : Run lint checks
33
41
id : lint
34
- run : uvx nox -s lint
42
+ run : uv tool run nox -s lint
35
43
continue-on-error : true
36
44
37
45
- name : Comment on PR
58
66
needs : setup
59
67
runs-on : ubuntu-latest
60
68
steps :
69
+ - name : Checkout code
70
+ uses : actions/checkout@v4
71
+
72
+ - name : Setup Python
73
+ uses : actions/setup-python@v5
74
+ with :
75
+ python-version : " {{cookiecutter.max_python_version}}"
76
+
77
+ - name : Install uv
78
+ uses : astral-sh/setup-uv@v5
79
+
61
80
- name : Run tests on all Python versions
62
81
id : test
63
- run : uvx nox -s test_all
82
+ run : uv tool run nox -s test_all
64
83
continue-on-error : true
65
84
66
85
- name : Upload coverage reports
Original file line number Diff line number Diff line change 6
6
python-version :
7
7
required : false
8
8
type : string
9
- default : " {{cookiecutter.max_python_version}}"
9
+ default : " {{cookiecutter.max_python_version}}" # 使用用户选择的最高 Python 版本
10
10
install-deps :
11
11
required : false
12
12
type : string
You can’t perform that action at this time.
0 commit comments