18
18
workflow_dispatch :
19
19
20
20
jobs :
21
- faildraft :
22
- name : fail draft
23
- if : github.event.pull_request.draft == true
24
- runs-on : ubuntu-latest
25
- steps :
26
- - name : fail draft
27
- run : |
28
- exit 1
29
21
30
22
testing :
31
23
name : ${{ matrix.os }} - ${{ matrix.python }}
@@ -36,11 +28,11 @@ jobs:
36
28
fail-fast : false
37
29
matrix :
38
30
os : [ubuntu-latest, macos-latest, windows-latest]
39
- python : ['3.10', '3.11', '3.12', " 3.13.0" ]
31
+ python : ['3.10', '3.11', '3.12', ' 3.13', '3.14' ]
40
32
include :
41
33
- python : ' 3.10'
42
34
run_lint : true
43
- - python : ' 3.13.0 '
35
+ - python : ' 3.13'
44
36
run_doc : true
45
37
run_lint : true
46
38
- os : macos-latest
@@ -54,75 +46,54 @@ jobs:
54
46
- name : Checkout repo from github
55
47
56
48
57
- - name : Set up Python ${{ matrix.python }}
58
- uses :
actions /setup-[email protected]
49
+ - name : Install uv
50
+ uses : astral-sh /setup-uv@v6
59
51
with :
60
52
python-version : ${{ matrix.python }}
53
+ allow-prereleases : true
54
+ enable-cache : true
61
55
62
- - name : Set venv path (NON Windows)
63
- if : matrix.os != 'windows-latest'
64
- run : |
65
- echo "VIRTUAL_ENV=${{ github.workspace }}/venv" >> $GITHUB_ENV
66
- echo ${{ github.workspace }}/venv/bin >> $GITHUB_PATH
67
-
68
- - name : Set venv path (Windows)
69
- if : matrix.os == 'windows-latest'
70
- run : |
71
- echo "VIRTUAL_ENV=${{ github.workspace }}\\venv" >> $Env:GITHUB_ENV
72
- echo "${{ github.workspace }}\\venv\\Scripts" >> $Env:GITHUB_PATH
73
-
74
- - name : Restore base Python virtual environment
75
- id : cache-venv
76
-
77
- with :
78
- path : ${{ env.VIRTUAL_ENV }}
79
- key : >-
80
- ${{ runner.os }}-${{ matrix.python }}-venv-${{
81
- hashFiles('pyproject.toml') }}
82
-
83
- - name : Create venv (NEW CACHE)
84
- if : steps.cache-venv.outputs.cache-hit != 'true'
56
+ - name : Create virtualenv and sync dependencies
85
57
run : |
86
- python -m venv ${{ env.VIRTUAL_ENV }}
87
- python -m pip install --upgrade pip
88
- pip install -e ".[all]"
58
+ uv sync --all-extras
89
59
90
60
- name : codespell
91
61
if : matrix.run_doc == true
92
62
run : |
93
- codespell
63
+ uv run codespell
94
64
95
- - name : dcoumentation
65
+ - name : documentation
96
66
if : matrix.run_doc == true
97
67
run : |
98
- cd doc; ./build_html
68
+ source .venv/bin/activate
69
+ cd doc
70
+ ./build_html
71
+ # this won't work on Windows, but we run_doc == False on Windows
99
72
100
73
- name : pylint
101
74
if : matrix.run_lint == true
102
75
run : |
103
- pylint --recursive=y examples pymodbus test
76
+ uv run pylint --recursive=y examples pymodbus test
104
77
105
78
- name : mypy
106
79
if : matrix.run_lint == true
107
80
run : |
108
- mypy pymodbus examples
81
+ uv run mypy pymodbus examples
109
82
110
83
- name : ruff
111
84
if : matrix.run_lint == true
112
85
run : |
113
- ruff check .
86
+ uv run ruff check .
114
87
115
88
- name : pytest
116
- if : ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.13 ') }}
89
+ if : ${{ (matrix.os != 'ubuntu-latest') || (matrix.python != '3.14.0 ') }}
117
90
run : |
118
- env
119
- pytest
91
+ uv run pytest
120
92
121
93
- name : pytest coverage
122
- if : ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.13') }}
94
+ if : ${{ (matrix.os == 'ubuntu-latest') && (matrix.python == '3.14.0') }}
123
95
run : |
124
- env
125
- pytest --cov
96
+ uv run pytest --cov
126
97
127
98
analyze :
128
99
name : Analyze Python
@@ -131,13 +102,9 @@ jobs:
131
102
timeout-minutes : 10
132
103
steps :
133
104
134
-
135
105
- uses : github/codeql-action/init@v3
136
106
with :
137
107
languages : python
138
-
139
- - uses : github/codeql-action/autobuild@v3
140
-
141
108
- uses : github/codeql-action/analyze@v3
142
109
143
110
ci_complete :
0 commit comments