From 27cbf4d3f85b05a756e71495fa74d4e01b719b6b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 20 Jul 2026 21:13:20 +0000 Subject: [PATCH 1/2] ci: harden Ruff checks and package build Align Ruff target-version to py311, fail CI on format drift, build and smoke-test the wheel, and add Ruff to pre-commit. Closes #78. Co-authored-by: akae --- .github/workflows/python-ci.yml | 10 +++++++--- .pre-commit-config.yaml | 6 ++++++ pyproject.toml | 2 +- tests/test_cli_dependabot.py | 4 +--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index cb39c58..c632083 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -30,8 +30,8 @@ jobs: - name: Ruff lint run: ruff check . - - name: Ruff fmt - run: ruff format . + - name: Ruff format check + run: ruff format --check . test: name: Python tests @@ -70,7 +70,11 @@ jobs: - name: uv sync run: uv sync - - name: Get CLI version + - name: Build package + run: uv build + + - name: Install wheel and smoke test run: | source .venv/bin/activate + uv pip install dist/*.whl github-rest-cli --version diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 102255c..b9a5c21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,3 +6,9 @@ repos: - id: end-of-file-fixer - id: check-yaml - id: check-added-large-files +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.15.22 + hooks: + - id: ruff-check + args: [--fix] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index 13049b1..42592c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ allow-direct-references = true [tool.ruff] lint.extend-select = ["C4", "SIM", "TCH", "T20"] show-fixes = true -target-version = "py37" +target-version = "py311" [tool.ruff.lint.isort] case-sensitive = true diff --git a/tests/test_cli_dependabot.py b/tests/test_cli_dependabot.py index 969863c..6959a87 100644 --- a/tests/test_cli_dependabot.py +++ b/tests/test_cli_dependabot.py @@ -45,9 +45,7 @@ def test_dependabot_both_flags_error(capsys): parser = build_parser() with pytest.raises(SystemExit) as exc_info: - parser.parse_args( - ["dependabot", "--name", "my-repo", "--enable", "--disable"] - ) + parser.parse_args(["dependabot", "--name", "my-repo", "--enable", "--disable"]) assert exc_info.value.code == 2 err = capsys.readouterr().err From 1ee64cad4d4eacacb99a42d7360c85bc20343000 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 20 Jul 2026 21:20:38 +0000 Subject: [PATCH 2/2] ci: simplify Python CI to a lean high-level workflow Parallel lint and test with uv, then build. Drop just, smoke install, and unused PR closed triggers. Co-authored-by: akae --- .github/workflows/python-ci.yml | 85 +++++++++------------------------ 1 file changed, 23 insertions(+), 62 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index c632083..0bc0df0 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -1,80 +1,41 @@ name: Python CI -run-name: Python build and test + on: pull_request: - branches: - - main - types: - - opened - - synchronize - - closed + push: + branches: [main] + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read jobs: lint: - name: Ruff lint + name: Lint runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v7 - - - name: Set up Python - uses: actions/setup-python@v7 - with: - python-version: '3.11' - - - uses: astral-sh/ruff-action@v3 - with: - version: "latest" - - - name: Ruff lint - run: ruff check . - - - name: Ruff format check - run: ruff format --check . + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 + - run: uvx ruff check . + - run: uvx ruff format --check . test: - name: Python tests + name: Test runs-on: ubuntu-latest - needs: lint - steps: - - name: Checkout repository - uses: actions/checkout@v7 - - - name: Set up uv - uses: astral-sh/setup-uv@v7 - - - name: uv sync - run: uv sync - - - uses: extractions/setup-just@v4 - - - name: Run tests - run: | - source .venv/bin/activate - just test + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 + - run: uv sync + - run: uv run pytest -v build: name: Build runs-on: ubuntu-latest needs: [lint, test] - steps: - - name: Checkout repository - uses: actions/checkout@v7 - - - name: Set up uv - uses: astral-sh/setup-uv@v7 - - - name: uv sync - run: uv sync - - - name: Build package - run: uv build - - - name: Install wheel and smoke test - run: | - source .venv/bin/activate - uv pip install dist/*.whl - github-rest-cli --version + - uses: actions/checkout@v7 + - uses: astral-sh/setup-uv@v7 + - run: uv build