Skip to content

Commit 17214e8

Browse files
committed
feat(pypi): add support for Python 3.12, 3.13, and 3.14
Add build configuration for Python 3.12, 3.13, and 3.14 to the PyPI package. Update the BUILD file with new compatibility tags and config settings, extend pypi_build.sh to accept the new Python versions, and add build steps in the GitHub Actions workflow. BUG= Fixes: #3186
1 parent 95a4591 commit 17214e8

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.github/workflows/pypi_build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ jobs:
3838
- name: Build Wheel 3.11
3939
run: |
4040
python/tflite_micro/pypi_build.sh cp311
41+
- name: Build Wheel 3.12
42+
run: |
43+
python/tflite_micro/pypi_build.sh cp312
44+
- name: Build Wheel 3.13
45+
run: |
46+
python/tflite_micro/pypi_build.sh cp313
47+
- name: Build Wheel 3.14
48+
run: |
49+
python/tflite_micro/pypi_build.sh cp314
4150
- name: Check Directory Output
4251
run: |
4352
ls -l bazel-pypi-out

python/tflite_micro/BUILD

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ string_flag(
201201
values = [
202202
"cp310_cp310_manylinux_2_28_x86_64",
203203
"cp311_cp311_manylinux_2_28_x86_64",
204+
"cp312_cp312_manylinux_2_28_x86_64",
205+
"cp313_cp313_manylinux_2_28_x86_64",
206+
"cp314_cp314_manylinux_2_28_x86_64",
204207
"local",
205208
],
206209
)
@@ -219,6 +222,27 @@ config_setting(
219222
},
220223
)
221224

225+
config_setting(
226+
name = "cp312_cp312_manylinux_2_28_x86_64",
227+
flag_values = {
228+
":compatibility_tag": "cp312_cp312_manylinux_2_28_x86_64",
229+
},
230+
)
231+
232+
config_setting(
233+
name = "cp313_cp313_manylinux_2_28_x86_64",
234+
flag_values = {
235+
":compatibility_tag": "cp313_cp313_manylinux_2_28_x86_64",
236+
},
237+
)
238+
239+
config_setting(
240+
name = "cp314_cp314_manylinux_2_28_x86_64",
241+
flag_values = {
242+
":compatibility_tag": "cp314_cp314_manylinux_2_28_x86_64",
243+
},
244+
)
245+
222246
config_setting(
223247
name = "local",
224248
flag_values = {
@@ -235,18 +259,27 @@ py_wheel(
235259
abi = select({
236260
":cp310_cp310_manylinux_2_28_x86_64": "cp310",
237261
":cp311_cp311_manylinux_2_28_x86_64": "cp311",
262+
":cp312_cp312_manylinux_2_28_x86_64": "cp312",
263+
":cp313_cp313_manylinux_2_28_x86_64": "cp313",
264+
":cp314_cp314_manylinux_2_28_x86_64": "cp314",
238265
":local": "none",
239266
}),
240267
description_file = ":description_file",
241268
distribution = "tflite_micro",
242269
platform = select({
243270
":cp310_cp310_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
244271
":cp311_cp311_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
272+
":cp312_cp312_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
273+
":cp313_cp313_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
274+
":cp314_cp314_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
245275
":local": "any",
246276
}),
247277
python_tag = select({
248278
":cp310_cp310_manylinux_2_28_x86_64": "cp310",
249279
":cp311_cp311_manylinux_2_28_x86_64": "cp311",
280+
":cp312_cp312_manylinux_2_28_x86_64": "cp312",
281+
":cp313_cp313_manylinux_2_28_x86_64": "cp313",
282+
":cp314_cp314_manylinux_2_28_x86_64": "cp314",
250283
":local": "py3",
251284
}),
252285
requires = [

python/tflite_micro/pypi_build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ container. Uses bazel, but does not pollute the WORKSPACE's default cache.
2626
<python-tag> must be one of the supported interpreters:
2727
cp310
2828
cp311
29+
cp312
30+
cp313
31+
cp314
2932
3033
<output-directory> defaults to $OUT_DIR_DEFAULT.
3134
"
3235

3336
case "$1" in
34-
cp310|cp311)
37+
cp310|cp311|cp312|cp313|cp314)
3538
PY_TAG=$1
3639
OUTDIR=$(realpath ${2:-$OUT_DIR_DEFAULT})
3740
mkdir -p $OUTDIR

0 commit comments

Comments
 (0)