Skip to content

Bump minor version to v7.17.0 #4290

Bump minor version to v7.17.0

Bump minor version to v7.17.0 #4290

Workflow file for this run

---
name: 🔬 Tests
"on":
workflow_dispatch:
push:
branches:
- main
paths:
- click_extra/**
- tests/**
- pyproject.toml
- uv.lock
- .github/workflows/tests.yaml
pull_request:
branches-ignore:
- prepare-release
paths:
- click_extra/**
- tests/**
- pyproject.toml
- uv.lock
- .github/workflows/tests.yaml
schedule:
# Run tests monthly to catch regressions from dependency or environment changes.
- cron: "17 9 1 * *"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !startsWith(github.event.head_commit.message, '[changelog] Release') }}
jobs:
metadata:
name: 🧬 Project metadata
runs-on: ubuntu-slim
outputs:
metadata: ${{ steps.metadata.outputs.metadata }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
- name: Run repomatic metadata
id: metadata
run: >
uvx --no-progress 'repomatic==6.14.0' metadata
--format github-json --output "$GITHUB_OUTPUT"
test_matrix test_matrix_pr
once-tests:
name: 🔂 Once tests
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
- name: Install Python
run: uv --no-progress venv --python 3.14
- name: Run stable CLI
run: |
uvx click-extra --version
uv run --with click-extra -- click-extra --version
uv run --with click-extra -m click_extra --version
uv run --with click-extra python -m click_extra --version
- name: Run dev CLI
run: |
uvx --from git+https://github.com/kdeldycke/click-extra -- click-extra --version
uv run --with git+https://github.com/kdeldycke/click-extra -- click-extra --version
uv run --with git+https://github.com/kdeldycke/click-extra -m click_extra --version
uv run --with git+https://github.com/kdeldycke/click-extra python -m click_extra --version
- name: Run stable CLI via uv tool
run: |
uv --no-progress tool install click-extra
click-extra --version
uv --no-progress tool uninstall click-extra
- name: Run dev CLI via uv tool
run: |
uv --no-progress tool install git+https://github.com/kdeldycke/click-extra
click-extra --version
uv --no-progress tool uninstall click-extra
- name: Run CLI via pipx
run: |
uv --no-progress tool install pipx
pipx run click-extra --version
pipx run --spec click-extra click-extra --version
pipx run --spec git+https://github.com/kdeldycke/click-extra click-extra --version
uv --no-progress tool uninstall pipx
- name: Run CLI via pip
run: |
pip install click-extra
click-extra --version
- name: Install project
run: uv --no-progress sync --frozen --all-extras --group test
- name: Test wrapper on Click CLIs
run: |
uv --no-progress run --frozen --with flask -- click-extra wrap flask --help
uv --no-progress run --frozen --with flask -- click-extra --no-color wrap flask --help
uv --no-progress run --frozen --with flask -- click-extra run flask --help
uv --no-progress run --frozen --with flask -- click-extra flask --help
uv --no-progress run --frozen --with quart -- click-extra wrap quart --help
uv --no-progress run --frozen --with quart -- click-extra quart --help
- name: Run once-only tests
run: >
uv --no-progress run --frozen --
pytest -m once
--cov
--cov-report=term
tests:
needs:
- metadata
strategy:
fail-fast: false
# Matrix is pre-computed by repomatic metadata. PRs get a reduced matrix
# (fewer OS variants and Python versions) to save CI minutes.
matrix: >-
${{ github.event_name != 'pull_request'
&& fromJSON(needs.metadata.outputs.metadata).test_matrix
|| fromJSON(needs.metadata.outputs.metadata).test_matrix_pr }}
name: |
${{ matrix.state == 'stable' && '✅' || '⁉️' }}
${{ matrix.os }} /
py${{ matrix.python-version }} /
Click ${{ matrix.click-version }} /
Cloup ${{ matrix.cloup-version }}
runs-on: ${{ matrix.os }}
# We keep going when a job flagged as not stable fails.
continue-on-error: ${{ matrix.state == 'unstable' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
- name: Force native ARM64 Python on Windows ARM64
# Workaround for https://github.com/astral-sh/uv/issues/12906: uv defaults to x86_64 Python on ARM64 Windows,
# relying on transparent emulation. Native extensions with Rust (e.g., test-results-parser from codecov-cli)
# fail to compile because the ARM64 Rust toolchain lacks the x86_64-pc-windows-msvc target. Setting UV_PYTHON
# to an architecture-qualified specifier forces uv (and uvx) to use native ARM64 Python for all steps.
if: runner.os == 'Windows' && runner.arch == 'ARM64'
shell: bash
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: echo "UV_PYTHON=cpython-${PYTHON_VERSION}-aarch64" >> "$GITHUB_ENV"
- name: Install Python ${{ matrix.python-version }}
# If UV cannot find the requested Python version, it exits with code 2, which let the job pass unnoticed on
# Windows. So we force the shell to bash, even on Windows, and "set -e" to ensure any error in the install
# process is caught and fails the job. It works because Windows runners too Git Bash available).
shell: bash
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
set -e
uv --no-progress venv --python "${UV_PYTHON:-${PYTHON_VERSION}}"
- name: Force UTF-8 encoding on Windows
# Workaround for https://github.com/pallets/click/issues/2121: Windows GitHub Actions runners
# redirect command output to files, which sets the encoding to the system default (cp1252).
# Python CLI frameworks like Click then raise UnicodeEncodeError on non-ASCII output.
if: runner.os == 'Windows'
shell: bash
run: echo "PYTHONIOENCODING=utf8" >> "$GITHUB_ENV"
- name: Install project
# Install all extras, so we can check any incompatibility.
run: >
uv --no-progress sync --frozen --all-extras --group test
- name: Run local CLI
shell: bash
run: |
uv run -- click-extra --version
uv run -m click_extra --version
uv run python -m click_extra --version
uv run --with flask --with quart -- click-extra run flask --help
uv run --with flask --with quart -- click-extra run quart --help
- name: Unittests
# Produce XML artifacts for Codecov integration (coverage + test analytics).
env:
CLICK_VERSION: ${{ matrix.click-version }}
CLOUP_VERSION: ${{ matrix.cloup-version }}
shell: bash
run: |
with_args=()
if [[ "${CLICK_VERSION}" != "released" ]]; then
with_args+=(--with "git+https://github.com/pallets/click.git@${CLICK_VERSION}")
fi
if [[ "${CLOUP_VERSION}" != "released" ]]; then
with_args+=(--with "git+https://github.com/janluke/cloup.git@${CLOUP_VERSION}")
fi
uv --no-progress run --frozen "${with_args[@]}" -- \
pytest -m "not once" \
--cov \
--cov-report=term \
--cov-report=xml \
--junitxml=junit.xml \
--override-ini=junit_family=legacy
- name: Upload coverage to Codecov
# Skip on prepare-release PRs (Codecov cannot create commits on protected
# branches), sync-repomatic PRs (data-only changes with no coverable
# lines), and fork PRs (secrets are not available).
if: >
github.head_ref != 'prepare-release'
&& github.head_ref != 'sync-repomatic'
&& env.CODECOV_TOKEN != ''
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: bash
run: >
uvx --no-progress 'codecov-cli==11.2.7'
--auto-load-params-from githubactions
upload-process
--git-service github
--report-type coverage
--token "${CODECOV_TOKEN}"
- name: Upload test results to Codecov
if: >
github.head_ref != 'prepare-release'
&& github.head_ref != 'sync-repomatic'
&& env.CODECOV_TOKEN != ''
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: bash
run: >
uvx --no-progress 'codecov-cli==11.2.7'
--auto-load-params-from githubactions
upload-process
--git-service github
--report-type test_results
--token "${CODECOV_TOKEN}"