-
Notifications
You must be signed in to change notification settings - Fork 7
195 lines (187 loc) · 6.39 KB
/
Copy pathci.yml
File metadata and controls
195 lines (187 loc) · 6.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: ci
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v5
- name: Setup Python
id: setup-python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Set up PDM by uv
run: |
uv tool install --python 3.11 pdm --with msgpack
pdm config check_update false
pdm config use_uv true
- name: Install dependencies
run: uv sync
env:
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
- uses: astral-sh/ruff-action@v3
- name: Check code style and Type Hint
run: pdm run fast check
- name: Verify pip conf script
run: |
./pip_conf.py
./pip_conf.py --tool=pip
- name: Verify python upgrade script
run: |
./upgrade_py.py --list
./upgrade_py.py --dry --no-input
./upgrade_py.py 3 --dry --no-input
./upgrade_py.py 313 --dry --no-input
./upgrade_py.py 3.13 --dry --no-input
./upgrade_py.py 3.13.2 --dry --no-input
./upgrade_py.py --version=313 --dry --no-input
ConfPip:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version: [3.9, 3.13, 3.14]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Verify pip conf script
run: python pip_conf.py --tool=pip
- name: Verify python upgrade script
run: python upgrade_py.py --dry --no-input
conf_pip_py36:
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version: [3.11]
container: python:3.6-slim
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- uses: astral-sh/setup-uv@v7
- name: Set up PDM by uv
run: |
uv tool install --python 3.11 pdm --with msgpack
pdm config check_update false
pdm config use_uv true
- name: setup poetry
run: |
uv python install 3.10 --preview
uv tool install --python python3.10 poetry
- name: Verify pip conf script
run: |
python3.6 pip_conf.py --tool=pip
python3.6 upgrade_py.py --dry --no-input
python3.6 -V
- name: Check mirror setting for uv/pdm/poetry
run: |
python3.6 pip_conf.py --pdm
python3.6 pip_conf.py --poetry
python3.6 pip_conf.py --uv
- name: Verify pdm mirror work
run: pdm add pytz --frozen
- name: Add poetry section
run: |
python3.10 -c "version='0.1.0';from pathlib import Path;p=Path('pyproject.toml');s=p.read_text();python='>=2.7,<3.0||>=3.5';a=f'\n[tool.poetry]\nversion={version!r}\n[tool.poetry.dependencies]\npython={python!r}\n';a in s or p.write_text(s+a)"
- name: Prepare poetry environment
run: poetry env use python3.10
- name: Verify poetry mirror work
run: poetry add six
- name: Verify uv mirror work
run: uv add packaging --frozen
- name: Verify python upgrade script
run: python3.10 upgrade_py.py --dry --no-input
conf_pip_py27:
runs-on: ubuntu-latest
needs: lint
container: python:2.7
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
with:
python-version: '3.13'
- name: Set up PDM by uv
run: |
uv tool install --python 3.13 pdm --with msgpack
pdm config check_update false
- name: setup poetry by uv
run: |
uv tool install --python 3.13 poetry
- name: Verify pip conf script
run: |
python2.7 pip_conf.py --tool=pip
python2.7 upgrade_py.py --dry --no-input
python2.7 -V
- name: Check mirror setting for uv/pdm/poetry
run: |
python2.7 pip_conf.py --pdm
python2.7 pip_conf.py --poetry
python2.7 pip_conf.py --uv
- name: Verify pdm mirror work
run: pdm add "pytz; python_version>='3.13'" --no-lock
- name: Verify poetry mirror work
run: |
python3.13 -c "version='0.1.0';from pathlib import Path;p=Path('pyproject.toml');s=p.read_text();python='>=2.7,<3.0||>=3.5';a=f'\n[tool.poetry]\n{version=}\n[tool.poetry.dependencies]\n{python=}\n';a in s or p.write_text(s+a)"
poetry add six
- name: Verify uv mirror work
run: uv add packaging --frozen
set_pip_mirror:
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: astral-sh/setup-uv@v7
- name: Set up PDM by uv
run: |
uv tool install pdm --with msgpack
pdm config check_update false
pdm config use_uv true
- name: Setup poetry by pipx
run: |
pip install --upgrade pip pipx
pipx install poetry
- name: Verify mirror setting
run: |
python pip_conf.py --tool=pip
pip install six
- name: Check mirror setting for uv/pdm/poetry
run: |
./pip_conf.py --pdm
./pip_conf.py --tool=pdm
./pip_conf.py --poetry
./pip_conf.py --tool=poetry
./pip_conf.py --uv
./pip_conf.py --tool=uv
- name: Verify mirror work
run: |
pdm add pytz
python -c "version='0.1.0';from pathlib import Path;p=Path('pyproject.toml');s=p.read_text();python='>=2.7,<3.0||>=3.5';a=f'\n[tool.poetry]\n{version=}\n[tool.poetry.dependencies]\n{python=}\n';a in s or p.write_text(s+a)"
poetry add six
uv add tomli --frozen
uv pip install tomlkit