Skip to content
Merged
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
35 changes: 15 additions & 20 deletions .github/workflows/pub-onert-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: github.repository_owner == 'Samsung'
strategy:
matrix:
python-version: [ 'python3.10', 'python3.11', 'python3.12' ]
python-version: [ '3.10', '3.11', '3.12' ]
arch: [ 'x86_64', 'aarch64' ]
include:
- arch: x86_64
Expand All @@ -36,7 +36,9 @@ jobs:
env:
BUILD_TYPE: release
OPTIONS: "-DENABLE_TEST=OFF -DBUILD_ARMCOMPUTE=OFF"
DEV_TAG: ""
# Set env to decide package name: refer runtime/infra/python/wheel_target_hook.py
PLATFORM: ${{ matrix.arch }}
GLIBC_VERSION: "2.28"

steps:
- name: Checkout
Expand All @@ -50,11 +52,11 @@ jobs:
restore-keys: |
external-onert-jammy-

- name: Install venv for python version
run: |
${{ matrix.python-version }} -m venv ./venv
source ./venv/bin/activate
pip3 install -U setuptools wheel
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.10"
python-version: "${{ matrix.python-version }}"

# For flatc build
- name: Install glibc-static
Expand All @@ -63,8 +65,7 @@ jobs:

- name: Build
run: |
source ./venv/bin/activate
make -f Makefile.template configure build install
uv run --python "${{ matrix.python-version }}" make -f Makefile.template configure build install

# Pre-release build
# 1) Release branch test build
Expand All @@ -73,23 +74,17 @@ jobs:
- name: Pre-release packaging
if: github.event.inputs.official == 'false' || github.event_name == 'pull_request' || github.ref_name == 'master'
run: |
source ./venv/bin/activate
cd runtime/infra/python
python3 setup.py bdist_wheel --plat-name manylinux_2_28_${{ matrix.arch }} egg_info --tag-build "dev$(date -u "+%y%m%d")"
uv version "$(uv version --short --project runtime)-dev$(date -u "+%y%m%d")" --project runtime --python "${{ matrix.python-version }}"

# Allow official release on release branch only
- name: Release packaging
if: github.event.inputs.official == 'true' && startsWith(github.ref_name, 'release/')
- name: Build package
run: |
source ./venv/bin/activate
cd runtime/infra/python
python3 setup.py bdist_wheel --plat-name manylinux_2_28_${{ matrix.arch }} egg_info
uv build --wheel --project runtime --python "${{ matrix.python-version }}"

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: onert-wheel-${{ matrix.python-version }}-${{ matrix.arch }}
path: runtime/infra/python/dist/*.whl
name: onert-wheel-python${{ matrix.python-version }}-${{ matrix.arch }}
path: runtime/dist/*.whl

publish-to-pypi:
needs: [ build ]
Expand Down
3 changes: 1 addition & 2 deletions runtime/infra/python/wheel_target_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def prepare_binaries(self):
self.copy_libraries(src_libs_base_dir, self.whl_binaries_target_dir, "nnfw")
self.copy_libraries(src_libs_base_dir, self.whl_binaries_target_dir,
"nnfw/backend")
self.copy_libraries(src_libs_base_dir, self.whl_binaries_target_dir, "nnfw/odc")

def get_libs_dir(self):
"""Retrieve the path of a directory where the required shared libraries are"""
Expand Down Expand Up @@ -156,7 +155,7 @@ def _validate_platform(self, value):
)
return supported_platforms[0]
elif value not in supported_platforms:
raise ValueError(f"""Unsupported platform detected: {value}.
raise ValueError(f"""Unsupported platform detected: {value}.
Please use one of the following values: {','.join(supported_platforms)}"""
)
else:
Expand Down