From e9fbbe01fec1274513b00b311455553e3f72df5d Mon Sep 17 00:00:00 2001 From: Gaspar Rochette Date: Fri, 3 Apr 2026 15:53:15 +0000 Subject: [PATCH 1/2] ci: switch to pypi default and explicitely setting pythonanywhere and intel indices --- pyproject.toml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5b1eb704..94cb672d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,19 +64,21 @@ testpaths = [ [[tool.uv.index]] name = "pypi" -url = "https://pypi.org/simple" # regular PyPI +url = "https://pypi.org/simple" +default = true [[tool.uv.index]] name = "pruna_internal" -url = "https://prunaai.pythonanywhere.com/simple/" # Pruna Pythonanywhere -default = true # default = True makes this index the lowest prio +url = "https://prunaai.pythonanywhere.com/simple/" +explicit = true [[tool.uv.index]] name = "intel-pytorch-extension" url = "https://pytorch-extension.intel.com/release-whl/stable/cpu/cn/" +explicit = true [tool.uv] -index-strategy = "unsafe-best-match" +index-strategy = "first-index" conflicts = [ [ @@ -87,6 +89,14 @@ conflicts = [ { extra = "vllm" }, { extra = "vbench" }, ], + [ + { extra = "stable-fast-extraindex" }, + { extra = "stable-fast" }, + ], + [ + { extra = "stable-fast-extraindex" }, + { extra = "full" }, + ], ] [tool.uv.sources] @@ -94,6 +104,11 @@ gptqmodel = [ { index = "pruna_internal", marker = "sys_platform != 'darwin' or platform_machine != 'arm64'"}, { index = "pypi", marker = "sys_platform == 'darwin' and platform_machine == 'arm64'"}, ] +intel-extension-for-pytorch = { index = "intel-pytorch-extension" } +stable-fast-pruna = [ + { index = "pruna_internal", extra = "stable-fast-extraindex" }, + { index = "pypi", extra = "stable-fast" }, +] [project] name = "pruna" @@ -167,7 +182,13 @@ vllm = [ ] stable-fast = [ "xformers>=0.0.30", - "stable-fast-pruna==1.0.8", + "stable-fast-pruna>=1.0.8,<1.0.9", +] +# stable-fast-pruna from pythonanywhere (torch/CUDA line wheels); same version band as stable-fast, different index via [tool.uv.sources]. +# Linux x86_64 only where those wheels are published; mutually exclusive with stable-fast/full. +stable-fast-extraindex = [ + "xformers>=0.0.30", + "stable-fast-pruna>=1.0.8,<1.0.9; sys_platform == 'linux' and platform_machine == 'x86_64'", ] # dependencies are added here because the wheels aren't bundling them gptq = [ @@ -185,8 +206,7 @@ awq = [ "torch>=2.9.0" ] full = [ - "xformers>=0.0.30", - "stable-fast-pruna==1.0.8", + "pruna[stable-fast]", ] vbench = [ "vbench-pruna; sys_platform != 'darwin'", From 6f6069fdc800fd19948dbe5957457941d7b843a8 Mon Sep 17 00:00:00 2001 From: Gaspar Rochette Date: Fri, 3 Apr 2026 15:56:16 +0000 Subject: [PATCH 2/2] ci: set python version and install it through the setup-uv-project action --- .github/actions/setup-uv-project/action.yml | 9 ++++++++- .github/workflows/docs.yaml | 5 +---- .github/workflows/installation.yaml | 5 +---- .github/workflows/tests.yaml | 10 ++-------- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/actions/setup-uv-project/action.yml b/.github/actions/setup-uv-project/action.yml index 74f1ac9b..cd46fded 100644 --- a/.github/actions/setup-uv-project/action.yml +++ b/.github/actions/setup-uv-project/action.yml @@ -1,6 +1,12 @@ name: setup-uv-project description: Install uv and set up the project with its dependencies +inputs: + python-version: + description: 'Python version to use' + required: false + default: '3.11' + runs: using: composite steps: @@ -10,6 +16,7 @@ runs: activate-environment: true enable-cache: true github-token: ${{ github.token }} + python-version: ${{ inputs.python-version }} - shell: bash - run: uv sync --extra dev --extra lmharness --extra vllm + run: uv sync --extra dev --extra lmharness --extra vllm diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 021c6b66..628050d0 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -25,13 +25,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: ./.github/actions/setup-uv-project with: python-version: ${{ matrix.python-version }} - - uses: ./.github/actions/setup-uv-project - - name: Run generation script run: python docs/utils/gen_docs.py diff --git a/.github/workflows/installation.yaml b/.github/workflows/installation.yaml index ddc1dde3..d0622469 100644 --- a/.github/workflows/installation.yaml +++ b/.github/workflows/installation.yaml @@ -27,9 +27,6 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: ./.github/actions/setup-uv-project with: python-version: ${{ matrix.python-version }} - - - uses: ./.github/actions/setup-uv-project diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e3fac895..e16aa34f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,13 +30,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: ./.github/actions/setup-uv-project with: python-version: ${{ matrix.python-version }} - - uses: ./.github/actions/setup-uv-project - - name: Get changed Python files id: changed-files uses: tj-actions/changed-files@v47 @@ -80,13 +77,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: ./.github/actions/setup-uv-project with: python-version: ${{ matrix.python-version }} - - uses: ./.github/actions/setup-uv-project - - name: Cache Hugging Face datasets and models uses: actions/cache@v5 with: