diff --git a/.github/actions/setup-python-env/action.yml b/.github/actions/setup-python-env/action.yml deleted file mode 100644 index baa100f8..00000000 --- a/.github/actions/setup-python-env/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: 'Setup Python Environment' -description: 'Set up Python environment for the given Python version' - -inputs: - python-version: - description: 'Python version for setup-python' - required: true - default: '3.12' - build-project: - description: 'Whether to build the project itself' - required: true - default: 'false' - -runs: - using: 'composite' - steps: - - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - - - name: Install uv - run: pipx install uv - env: - # renovate: datasource=pypi depName=uv - UV_VERSION: '0.4.7' - shell: bash - - - name: Install Python dependencies - run: uv sync --frozen ${{ inputs.build-project == 'false' && '--no-install-project' || '' }} - shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f50849c5..882339ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} +env: + PYTHON_VERSION: '3.12' + # renovate: datasource=pypi depName=uv + UV_VERSION: '0.4.9' + jobs: quality: runs-on: ubuntu-24.04 @@ -17,10 +22,18 @@ jobs: - name: Check out uses: actions/checkout@v4 - - name: Set up the environment - uses: ./.github/actions/setup-python-env + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + version: ${{ env.UV_VERSION }} + + - name: Install Python + uses: actions/setup-python@v5 with: - build-project: 'true' + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Python dependencies + run: uv sync --frozen --no-install-project - name: Setup Rust toolchain run: rustup component add clippy rustfmt @@ -52,11 +65,20 @@ jobs: - name: Check out uses: actions/checkout@v4 - - name: Set up the environment - uses: ./.github/actions/setup-python-env + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + version: ${{ env.UV_VERSION }} + enable-cache: 'true' + cache-suffix: ${{ matrix.python-version }} + + - name: Install Python + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - build-project: 'true' + + - name: Install Python dependencies + run: uv sync --frozen - name: Check typing run: uv run mypy @@ -80,8 +102,18 @@ jobs: - name: Check out uses: actions/checkout@v4 - - name: Set up the environment - uses: ./.github/actions/setup-python-env + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + version: ${{ env.UV_VERSION }} + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Python dependencies + run: uv sync --frozen --no-install-project - name: Check if documentation can be built # `--no-project` is a workaround to avoid the installation of deptry diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96ff659b..3ce3cc22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,11 @@ on: types: [published] workflow_dispatch: +env: + PYTHON_VERSION: '3.12' + # renovate: datasource=pypi depName=uv + UV_VERSION: '0.4.9' + jobs: set-version: runs-on: ubuntu-24.04 @@ -45,7 +50,8 @@ jobs: with: name: pyproject-toml - - uses: actions/setup-python@v5 + - name: Install Python + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} @@ -83,7 +89,8 @@ jobs: with: name: pyproject-toml - - uses: actions/setup-python@v5 + - name: Install Python + uses: actions/setup-python@v5 id: setup-python with: python-version: ${{ matrix.python }} @@ -117,7 +124,8 @@ jobs: with: name: pyproject-toml - - uses: actions/setup-python@v5 + - name: Install Python + uses: actions/setup-python@v5 id: setup-python with: python-version: ${{ matrix.python }} @@ -182,8 +190,18 @@ jobs: - name: Check out uses: actions/checkout@v4 - - name: Set up the environment - uses: ./.github/actions/setup-python-env + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + version: ${{ env.UV_VERSION }} + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Python dependencies + run: uv sync --frozen --no-install-project - name: Deploy documentation # `--no-project` is a workaround to avoid the installation of deptry