Skip to content

Commit

Permalink
ci: install Python the same way everywhere
Browse files Browse the repository at this point in the history
For wheel builds, we shouldn't create a virtualenv, as it conflicts
with the check phase
  • Loading branch information
vlaci committed Feb 1, 2025
1 parent 36c8fa2 commit a690446
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
description: "Wether to install 3rd Party dependencies (for tests)"
required: false
default: "true" # unfortunately boolean variables are not supported
create-venv:
description: "Should a virtualenv be created"
required: false
default: "true"

name: "Setup dependencies"
description: "Install all required dependencies for worflows to run."
Expand All @@ -29,5 +33,11 @@ runs:
python-version: ${{ inputs.python-version }}

- name: Install the project
if: inputs.create-venv == 'true'
run: uv sync
shell: bash

- name: Setup pip # some tools need it, and uv virtualenvs doesn't contain it
if: inputs.create-venv == 'true'
run: uv pip install pip
shell: bash
15 changes: 8 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5

- name: Setup 3rd party dependencies
uses: ./.github/actions/setup-dependencies
with:
Expand Down Expand Up @@ -128,9 +125,11 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup 3rd party dependencies
uses: ./.github/actions/setup-dependencies
with:
python-version: 3.x
install-test-deps: "false"
create-venv: "false"

- name: Build wheels
uses: PyO3/maturin-action@v1
Expand Down Expand Up @@ -220,9 +219,11 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Setup 3rd party dependencies
uses: ./.github/actions/setup-dependencies
with:
python-version: 3.x
install-test-deps: "false"
create-venv: "false"

- name: Build wheels
uses: PyO3/maturin-action@v1
Expand Down

0 comments on commit a690446

Please sign in to comment.