Skip to content

Commit 69989b7

Browse files
committed
[infra] Update python packaging workflow
This commit updates python packaging workflow - Use uv for building wheels instead of setup.py bdist_wheel - Replace virtual environment setup with uv venv command - Set platform-specific environment variables (PLATFORM, GLIBC_VERSION) - Set dev version by using uv version command ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
1 parent 0e11e59 commit 69989b7

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

.github/workflows/pub-onert-pypi.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.repository_owner == 'Samsung'
2121
strategy:
2222
matrix:
23-
python-version: [ 'python3.10', 'python3.11', 'python3.12' ]
23+
python-version: [ '3.10', '3.11', '3.12' ]
2424
arch: [ 'x86_64', 'aarch64' ]
2525
include:
2626
- arch: x86_64
@@ -35,8 +35,10 @@ jobs:
3535
image: ${{ matrix.image }}
3636
env:
3737
BUILD_TYPE: release
38-
OPTIONS: "-DENABLE_TEST=OFF -DBUILD_ARMCOMPUTE=OFF"
39-
DEV_TAG: ""
38+
OPTIONS: "-DBUILD_ARMCOMPUTE=OFF"
39+
# Set env to decide package name: refer runtime/infra/python/wheel_target_hook.py
40+
PLATFORM: ${{ matrix.arch }}
41+
GLIBC_VERSION: "2.28"
4042

4143
steps:
4244
- name: Checkout
@@ -50,11 +52,11 @@ jobs:
5052
restore-keys: |
5153
external-onert-jammy-
5254
53-
- name: Install venv for python version
54-
run: |
55-
${{ matrix.python-version }} -m venv ./venv
56-
source ./venv/bin/activate
57-
pip3 install -U setuptools wheel
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v7
57+
with:
58+
version: "0.9.10"
59+
python-version: "${{ matrix.python-version }}"
5860

5961
# For flatc build
6062
- name: Install glibc-static
@@ -63,7 +65,8 @@ jobs:
6365
6466
- name: Build
6567
run: |
66-
source ./venv/bin/activate
68+
uv venv --seed --python "${{ matrix.python-version }}"
69+
source .venv/bin/activate
6770
make -f Makefile.template configure build install
6871
6972
# Pre-release build
@@ -73,23 +76,17 @@ jobs:
7376
- name: Pre-release packaging
7477
if: github.event.inputs.official == 'false' || github.event_name == 'pull_request' || github.ref_name == 'master'
7578
run: |
76-
source ./venv/bin/activate
77-
cd runtime/infra/python
78-
python3 setup.py bdist_wheel --plat-name manylinux_2_28_${{ matrix.arch }} egg_info --tag-build "dev$(date -u "+%y%m%d")"
79+
uv version "$(uv version --short --project runtime)-dev$(date -u "+%y%m%d")" --project runtime --python "${{ matrix.python-version }}"
7980
80-
# Allow official release on release branch only
81-
- name: Release packaging
82-
if: github.event.inputs.official == 'true' && startsWith(github.ref_name, 'release/')
81+
- name: Build package
8382
run: |
84-
source ./venv/bin/activate
85-
cd runtime/infra/python
86-
python3 setup.py bdist_wheel --plat-name manylinux_2_28_${{ matrix.arch }} egg_info
83+
uv build --wheel --project runtime --python "${{ matrix.python-version }}"
8784
8885
- name: Upload artifacts
8986
uses: actions/upload-artifact@v4
9087
with:
91-
name: onert-wheel-${{ matrix.python-version }}-${{ matrix.arch }}
92-
path: runtime/infra/python/dist/*.whl
88+
name: onert-wheel-python${{ matrix.python-version }}-${{ matrix.arch }}
89+
path: runtime/dist/*.whl
9390

9491
publish-to-pypi:
9592
needs: [ build ]

0 commit comments

Comments
 (0)