Skip to content

fix(ci): unblock pycairo build + clear ruff backlog#23

Merged
kkmookhey merged 2 commits into
mainfrom
fix/ci-pycairo-and-ruff
May 15, 2026
Merged

fix(ci): unblock pycairo build + clear ruff backlog#23
kkmookhey merged 2 commits into
mainfrom
fix/ci-pycairo-and-ruff

Conversation

@kkmookhey

Copy link
Copy Markdown
Collaborator

Summary

  • chore(ci) — workflow installs libcairo2-dev+pkg-config+python3-dev before pip install so pycairo can build, and installs [dev,azure,gcp,voice] extras so Azure/GCP/voice tests can be collected and run.
  • styleruff check --fix --unsafe-fixes + ruff format across pre-existing code, plus 8 manual renames for N806/N803/E741 cases the linter can't auto-resolve. E501 is moved to ignore so the formatter owns line-length policy (it leaves long string literals intact by design — flagging them is just noise).

Why

The integrity workflow has been red since at least May 6 (PR #20 merged red, PR #22 merged red). Two root causes:

  1. pycairo metadata fails on the runner — no libcairo2-dev available — so every install-time step explodes before any test runs.
  2. Lint flags 1,327 violations on pre-existing code, almost all E501 against intentional long-string literals that ruff format correctly leaves alone.

Both are fixable mechanically and have been delayed long enough that they hide real CI regressions.

What this is not

This PR does not touch the GCP detection layer or any check logic. The renames are all function-local variables (REQUIRED, FULL_SCOPE, etc.) and one list-comprehension variable. The ruff check --fix --unsafe-fixes pass removed truly unused locals (F841) and reorganized imports (I001); no logic change.

Test plan

  • ruff check src/ tests/ — clean
  • ruff format --check src/ tests/ — 196 files already formatted
  • pytest -q --ignore=tests/integration --ignore=tests/test_rainier851 passed
  • CI integrity workflow on this PR (will be the first green run in a while)

🤖 Generated with Claude Code

kkmookhey and others added 2 commits May 15, 2026 07:44
The integrity + full-suite jobs have been failing since at least May 6
because `pip install -e ".[dev]"` builds pycairo from source, and the
runner doesn't have the cairo headers installed. The lint job has been
failing on 1,000+ E501 line-too-long warnings against long string
literals that `ruff format` deliberately doesn't break.

- workflow: install libcairo2-dev + pkg-config + python3-dev before pip
  install on both Python jobs so pycairo can build
- workflow: install [dev,azure,gcp,voice] extras (not just [dev]) so
  Azure/GCP/voice tests can import their SDKs during pytest collection
- ruff: ignore E501 in lint; `ruff format` already enforces line length
  where it can, and flagging long strings the formatter chose to keep
  intact just produces noise

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Applies `ruff check --fix --unsafe-fixes` and `ruff format` to clear the
backlog of style violations that have accumulated in src/shasta/aws/ and
src/shasta/azure/. Plus 8 small manual fixes the linter can't auto-resolve:

- N806: rename function-local UPPER_CASE vars to lowercase
  (REQUIRED, FULL_SCOPE, DEFAULT_SA_SUFFIX, IMPERSONATION_ROLES,
  MIN_RETENTION_DAYS) — they aren't module constants and PEP 8 wants
  lowercase for function-scoped values
- E741: rename ambiguous `l` to `listener` in the AWS pentest LB loop
- N803: keep `keyTypes` parameter on two GCP-IAM mock side-effects (the
  name has to match the GCP API kwarg) and silence with `# noqa: N803`

All 851 tests still pass locally after the auto-fix pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kkmookhey kkmookhey merged commit a6fc109 into main May 15, 2026
3 checks passed
@kkmookhey kkmookhey deleted the fix/ci-pycairo-and-ruff branch May 15, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant