Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/pypi_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
- name: Build Wheel 3.11
run: |
python/tflite_micro/pypi_build.sh cp311
- name: Build Wheel 3.12
run: |
python/tflite_micro/pypi_build.sh cp312
- name: Build Wheel 3.13
run: |
python/tflite_micro/pypi_build.sh cp313
- name: Check Directory Output
run: |
ls -l bazel-pypi-out
Expand Down
22 changes: 22 additions & 0 deletions python/tflite_micro/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ string_flag(
values = [
"cp310_cp310_manylinux_2_28_x86_64",
"cp311_cp311_manylinux_2_28_x86_64",
"cp312_cp312_manylinux_2_28_x86_64",
"cp313_cp313_manylinux_2_28_x86_64",
"local",
],
)
Expand All @@ -219,6 +221,20 @@ config_setting(
},
)

config_setting(
name = "cp312_cp312_manylinux_2_28_x86_64",
flag_values = {
":compatibility_tag": "cp312_cp312_manylinux_2_28_x86_64",
},
)

config_setting(
name = "cp313_cp313_manylinux_2_28_x86_64",
flag_values = {
":compatibility_tag": "cp313_cp313_manylinux_2_28_x86_64",
},
)

config_setting(
name = "local",
flag_values = {
Expand All @@ -235,18 +251,24 @@ py_wheel(
abi = select({
":cp310_cp310_manylinux_2_28_x86_64": "cp310",
":cp311_cp311_manylinux_2_28_x86_64": "cp311",
":cp312_cp312_manylinux_2_28_x86_64": "cp312",
":cp313_cp313_manylinux_2_28_x86_64": "cp313",
":local": "none",
}),
description_file = ":description_file",
distribution = "tflite_micro",
platform = select({
":cp310_cp310_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
":cp311_cp311_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
":cp312_cp312_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
":cp313_cp313_manylinux_2_28_x86_64": "manylinux_2_28_x86_64",
":local": "any",
}),
python_tag = select({
":cp310_cp310_manylinux_2_28_x86_64": "cp310",
":cp311_cp311_manylinux_2_28_x86_64": "cp311",
":cp312_cp312_manylinux_2_28_x86_64": "cp312",
":cp313_cp313_manylinux_2_28_x86_64": "cp313",
":local": "py3",
}),
requires = [
Expand Down
4 changes: 3 additions & 1 deletion python/tflite_micro/pypi_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ container. Uses bazel, but does not pollute the WORKSPACE's default cache.
<python-tag> must be one of the supported interpreters:
cp310
cp311
cp312
cp313

<output-directory> defaults to $OUT_DIR_DEFAULT.
"

case "$1" in
cp310|cp311)
cp310|cp311|cp312|cp313)
PY_TAG=$1
OUTDIR=$(realpath ${2:-$OUT_DIR_DEFAULT})
mkdir -p $OUTDIR
Expand Down
13 changes: 13 additions & 0 deletions python/tflite_micro/whl_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ set -e

WHL="${1}"

# Rename wheel if it has unstamped variables in the filename. The py_wheel rule
# creates two outputs: the base :whl target with literal stamp variables in the
# filename (for Bazel caching), and :whl.dist with expanded variables. This test
# uses :whl as its data dependency because :whl.dist isn't a proper Bazel target
# that can be referenced in deps. Pip 25.x in Python 3.12+ strictly validates
# wheel filenames and rejects literal stamp variables like _BUILD_EMBED_LABEL_.
# Replace with a valid placeholder version for testing purposes.
if echo "${WHL}" | grep -q '_BUILD_EMBED_LABEL_'; then
RENAMED_WHL=$(echo "${WHL}" | sed 's/_BUILD_EMBED_LABEL_\.dev_STABLE_GIT_COMMIT_TIME_/0.0.0/')
cp "${WHL}" "${RENAMED_WHL}"
WHL="${RENAMED_WHL}"
fi

# Create venv for this test.
python3 -m venv pyenv
. pyenv/bin/activate
Expand Down
Loading