-
Notifications
You must be signed in to change notification settings - Fork 0
184 lines (160 loc) · 5.39 KB
/
Copy pathpython.yml
File metadata and controls
184 lines (160 loc) · 5.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
# This file is autogenerated by maturin v1.9.0
# To update, run
#
# maturin generate-ci github
#
name: Python
on:
push:
branches:
- main
tags:
- '*'
pull_request:
workflow_dispatch:
env:
FORCE_COLOR: 3
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: py
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install mise and tools
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
with:
install: true
install_args: rust uv
cache: true
- name: Run tests
run: uv run --python=$PYTHON_VERSION pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- name: Minimize uv cache
run: uv cache prune --ci
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
include:
- os: linux-intel
runs-on: ubuntu-latest
- os: linux-arm
runs-on: ubuntu-24.04-arm
- os: windows-intel
runs-on: windows-latest
# - os: windows-arm
# runs-on: windows-11-arm
# - os: macos-intel
# # macos-15-intel is the last x86_64 runner
# runs-on: macos-15-intel
- os: macos-arm
# macos-14+ (including latest) are ARM64 runners
runs-on: macos-latest
# - os: android-intel
# runs-on: ubuntu-latest
# platform: android
# - os: android-arm
# # GitHub Actions doesn’t currently support the Android emulator on any ARM
# # runner. So we build on a non-ARM runner, which will skip the tests.
# runs-on: ubuntu-latest
# platform: android
# archs: arm64_v8a
# - os: ios
# runs-on: macos-latest
# platform: ios
- os: pyodide
runs-on: ubuntu-latest
platform: pyodide
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install mise and tools
uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
with:
install: true
install_args: rust uv
cache: true
- name: Add i686-pc-windows-msvc target for windows
if: matrix.os == 'windows-intel'
run: rustup target add i686-pc-windows-msvc
- name: Build wheels
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
env:
CIBW_PLATFORM: ${{ matrix.platform || 'auto' }}
with:
package-dir: py
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Build sdist
run: pipx run build --sdist
working-directory: py
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: cibw-sdist
path: dist/*.tar.gz
check_dist:
name: Validate distribution artifacts
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Check metadata and wheel contents
run: |
pipx run twine check --strict dist/*
# W009/W010: auditwheel-repaired wheels vendor shared libs in standard_knowledge.libs/
pipx run check-wheel-contents --ignore W009,W010 dist/*.whl
- name: Smoke-test install
run: |
# let pip pick the wheel matching the runner's Python, only from dist/
python -m pip install --no-index --find-links dist standard_knowledge
python -c "import standard_knowledge"
upload_pypi:
name: Publish to PyPI
needs: [test, build_wheels, build_sdist, check_dist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # OIDC trusted-publishing token for PyPI
# if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0