From a29a48f45261ae4475bb9b55c9cd0daefe34d472 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sat, 26 Apr 2025 11:55:19 +0200 Subject: [PATCH] Swapping to python-uv for building and distribution (#3407) * Swapping to python-uv for building archinstall * Tweaked UV parameters to not use a venv * Tweaking uv to not resolve/install any dependencies during installation. * Added remaining dependencies to the build runner * Swapped to uv for publishing, using pypi 'trusted publisher' instead of token access * Installing uv and dependencies for publishing * Swapped to uv in the building of the test ISO --- .github/workflows/python-build.yml | 16 ++++++++-------- .github/workflows/python-publish.yml | 15 +++++++-------- build_iso.sh | 8 ++++---- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index a246e4aa..44dcfcb3 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -17,16 +17,16 @@ jobs: pacman-key --init pacman --noconfirm -Sy archlinux-keyring pacman --noconfirm -Syyu - pacman --noconfirm -Sy python-pip python-pydantic python-pyparted pkgconfig gcc - - name: Install build dependencies - run: | - python -m pip install --break-system-packages --upgrade pip - pip install --break-system-packages --upgrade build twine wheel setuptools installer - pip uninstall archinstall -y --break-system-packages + pacman --noconfirm -Sy python-uv python-setuptools python-pip + pacman --noconfirm -Sy python-pyparted python-pydantic + - name: Remove existing archinstall (if any) + run: + uv pip uninstall archinstall --break-system-packages --system - name: Build archinstall - run: python -m build --wheel --no-isolation + run: uv build --no-build-isolation --wheel - name: Install archinstall - run: python -m installer dist/*.whl + run: | + uv pip install dist/*.whl --break-system-packages --system --no-build --no-deps - name: Run archinstall run: | python -V diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d8cc423f..76ab0f8f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -18,16 +18,15 @@ jobs: uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5 with: python-version: '3.x' - - name: Install dependencies + - name: Prepare arch run: | - python -m pip install --upgrade pip - pip install build twine + pacman-key --init + pacman --noconfirm -Sy archlinux-keyring + pacman --noconfirm -Syyu + pacman --noconfirm -Sy python-uv python-setuptools python-pip - name: Build archinstall run: | - python -m build . --wheel + uv build --no-build-isolation --wheel - name: Publish archinstall to PyPi - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - twine upload dist/* + uv publish --trusted-publishing always diff --git a/build_iso.sh b/build_iso.sh index bd614455..f2533fec 100755 --- a/build_iso.sh +++ b/build_iso.sh @@ -11,10 +11,10 @@ packages=( pkgconfig python python-pip - python-build + python-uv python-setuptools - python-wheel python-pyparted + python-pydantic ) mkdir -p /tmp/archlive/airootfs/root/archinstall-git @@ -24,8 +24,8 @@ cat <<- _EOF_ | tee /tmp/archlive/airootfs/root/.zprofile cd archinstall-git rm -rf dist - python -m build --wheel --no-isolation - pip install dist/archinstall*.whl --break-system-packages + uv build --no-build-isolation --wheel + uv pip install dist/*.whl --break-system-packages --system --no-build --no-deps echo "This is an unofficial ISO for development and testing of archinstall. No support will be provided." echo "This ISO was built from Git SHA $GITHUB_SHA"