From 4f32bc8bcd3bf260ccd7ebb487680f6df564eeb3 Mon Sep 17 00:00:00 2001 From: Arusekk Date: Fri, 28 Feb 2025 16:17:31 +0100 Subject: [PATCH] Use UV as a faster pip implementation --- .github/workflows/ci.yml | 42 ++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffb3b337e..853b4a86f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,15 +65,14 @@ jobs: gdb --batch --quiet --nx --nh --ex 'py import rpyc; print(rpyc.version.version)' - name: Set up Python ${{ matrix.python_version }} - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python_version }} - cache: 'pip' - cache-dependency-path: | + enable-cache: true + cache-dependency-glob: | **/pyproject.toml **/requirements*.txt - - name: Verify tag against version if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') env: @@ -122,16 +121,13 @@ jobs: - name: Install dependencies run: | - pip install --upgrade pip - pip install --upgrade wheel build - pip install --upgrade flake8 appdirs - pip install --upgrade --editable . + uv pip install --upgrade --editable . - name: Sanity checks run: PWNLIB_NOTERM=1 python -bb -c 'from pwn import *; print(pwnlib.term.term_mode)' - name: Install documentation dependencies - run: pip install -r docs/requirements.txt + run: uv pip install -r docs/requirements.txt - name: Disable yama ptrace_scope run: | @@ -219,7 +215,7 @@ jobs: - name: Build source and wheel distributions run: | - python -m build + uv build - uses: actions/upload-artifact@v4 if: matrix.python_version == '3.10' @@ -248,11 +244,11 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python 3.12 - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v5 with: python-version: '3.12' - cache: 'pip' - cache-dependency-path: | + enable-cache: true + cache-dependency-glob: | **/pyproject.toml **/requirements*.txt @@ -288,21 +284,18 @@ jobs: - name: Install dependencies run: | - pip install --upgrade pip - pip install --upgrade wheel build - pip install --upgrade flake8 appdirs - pip install --upgrade --editable . + uv pip install --upgrade --editable . - name: Sanity checks run: PWNLIB_NOTERM=1 python -c 'from pwn import *; print(pwnlib.term.term_mode)' - name: Install documentation dependencies - run: pip install -r docs/requirements.txt + run: uv pip install -r docs/requirements.txt - name: Coverage Doctests (Android Only) run: | source .android.env - PWNLIB_NOTERM=1 coverage run -m sphinx -b doctest docs/source docs/build/doctest docs/source/adb.rst + PWNLIB_NOTERM=1 python -bb -m coverage run -m sphinx -b doctest docs/source docs/build/doctest docs/source/adb.rst - uses: actions/upload-artifact@v4 with: @@ -318,17 +311,20 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python 3.12 - uses: actions/setup-python@v5 + uses: astral-sh/setup-uv@v5 with: python-version: '3.12' + enable-cache: true + cache-dependency-glob: | + **/pyproject.toml + **/requirements*.txt - name: Install dependencies run: | - pip install --upgrade pip - pip install --upgrade --editable . + uv pip install --upgrade --editable . - name: Install documentation dependencies - run: pip install -r docs/requirements.txt + run: uv pip install -r docs/requirements.txt - name: Sanity checks run: |