feat: switch CI pipeline from pypi.org to Forgejo PyPI #5

Merged
forgejo_admin merged 1 commit from 4-switch-ci-to-forgejo-pypi into main 2026-03-01 18:14:20 +00:00

Summary

Switch the gmail-sdk CI pipeline from publishing to public pypi.org to the private Forgejo PyPI registry. Replaces the old .woodpecker.yaml with a new .woodpecker.yml following the proven woodpecker-sdk template pattern. Adds standardized ruff configuration and applies formatting fixes.

Closes #4

Changes

  • Deleted .woodpecker.yaml -- old pipeline that published to pypi.org via tag events with a repo-level pypi_token secret
  • Created .woodpecker.yml -- new pipeline with three steps:
    • lint: ruff check + ruff format --check on src/ and tests/ (pinned ruff==0.15.2)
    • test: pip install -e ".[dev]" + pytest tests/ -v
    • publish: python -m build + twine upload to Forgejo PyPI using global secrets (forgejo_pypi_url, forgejo_publish_user, forgejo_publish_token), triggered only on push to main
  • Updated pyproject.toml -- added [tool.ruff] config (py310, line-length 120, E/F/W/I rules)
  • Formatted 6 source/test files with ruff (import sorting, line length, whitespace)

Test Plan

  • ruff check src/ tests/ passes with zero errors
  • ruff format --check src/ tests/ passes (all files formatted)
  • pytest tests/ -v -- 59/59 unit tests pass; 12 integration tests error due to missing OAuth credentials (expected, same as before this change)
  • Woodpecker pipeline runs lint + test steps on this PR
  • After merge, publish step uploads package to Forgejo PyPI registry

Review Checklist

  • Old .woodpecker.yaml deleted (prevents dual-config loading)
  • New .woodpecker.yml follows woodpecker-sdk template exactly
  • Publish step uses global secrets (no repo-level pypi_token)
  • Publish step restricted to event: push, branch: main
  • Ruff config matches platform standard (py310, 120 chars, E/F/W/I)
  • All ruff fixes are mechanical (import sorting, line length, whitespace)
  • plan-2026-03-01-forgejo-pypi-migration -- Phase 2, gmail-sdk repo
  • plan-2026-02-28-woodpecker-sdk-mcp -- Phase 2 established the pipeline template
  • Reference implementation: woodpecker-sdk/.woodpecker.yml
## Summary Switch the gmail-sdk CI pipeline from publishing to public pypi.org to the private Forgejo PyPI registry. Replaces the old `.woodpecker.yaml` with a new `.woodpecker.yml` following the proven woodpecker-sdk template pattern. Adds standardized ruff configuration and applies formatting fixes. Closes #4 ## Changes - **Deleted** `.woodpecker.yaml` -- old pipeline that published to pypi.org via tag events with a repo-level `pypi_token` secret - **Created** `.woodpecker.yml` -- new pipeline with three steps: - **lint**: `ruff check` + `ruff format --check` on `src/` and `tests/` (pinned `ruff==0.15.2`) - **test**: `pip install -e ".[dev]"` + `pytest tests/ -v` - **publish**: `python -m build` + `twine upload` to Forgejo PyPI using global secrets (`forgejo_pypi_url`, `forgejo_publish_user`, `forgejo_publish_token`), triggered only on push to main - **Updated** `pyproject.toml` -- added `[tool.ruff]` config (py310, line-length 120, E/F/W/I rules) - **Formatted** 6 source/test files with ruff (import sorting, line length, whitespace) ## Test Plan - [x] `ruff check src/ tests/` passes with zero errors - [x] `ruff format --check src/ tests/` passes (all files formatted) - [x] `pytest tests/ -v` -- 59/59 unit tests pass; 12 integration tests error due to missing OAuth credentials (expected, same as before this change) - [ ] Woodpecker pipeline runs lint + test steps on this PR - [ ] After merge, publish step uploads package to Forgejo PyPI registry ## Review Checklist - [x] Old `.woodpecker.yaml` deleted (prevents dual-config loading) - [x] New `.woodpecker.yml` follows woodpecker-sdk template exactly - [x] Publish step uses global secrets (no repo-level `pypi_token`) - [x] Publish step restricted to `event: push, branch: main` - [x] Ruff config matches platform standard (py310, 120 chars, E/F/W/I) - [x] All ruff fixes are mechanical (import sorting, line length, whitespace) ## Related Notes - `plan-2026-03-01-forgejo-pypi-migration` -- Phase 2, gmail-sdk repo - `plan-2026-02-28-woodpecker-sdk-mcp` -- Phase 2 established the pipeline template - Reference implementation: `woodpecker-sdk/.woodpecker.yml`
feat: switch CI pipeline from pypi.org to Forgejo PyPI
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
fae5afaa29
Replace old .woodpecker.yaml (pypi.org publish via tag events) with
.woodpecker.yml following the proven woodpecker-sdk template pattern:
- Lint step: ruff check + ruff format (pinned ruff==0.15.2)
- Test step: pip install -e ".[dev]" + pytest
- Publish step: build + twine to Forgejo PyPI (main push only)

Add [tool.ruff] config to pyproject.toml (py310, line-length 120,
E/F/W/I rules). Apply ruff --fix and ruff format to all source and
test files.

Closes #4

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

PR #5 Review

BLOCKERS

None.

NITS

None.

CODE REVIEW

Pipeline (.woodpecker.yml): Matches the woodpecker-sdk reference template exactly. All three steps (lint, test, publish) are correctly configured. The test step correctly omits the WOODPECKER_URL/WOODPECKER_TOKEN environment variables from the reference template since gmail-sdk does not need Woodpecker API access for its tests -- this is a correct per-repo adaptation as specified in the plan.

  • Top-level when: event: [push, pull_request] -- correct
  • Lint: ruff==0.15.2 pinned, checks src/ and tests/ -- correct
  • Test: pip install -e ".[dev]", pytest tests/ -v -- correct
  • Publish: uses $$FORGEJO_PYPI_URL, $$FORGEJO_PUBLISH_USER, $$FORGEJO_PUBLISH_TOKEN via from_secret globals -- correct
  • Publish gated to event: push, branch: main -- correct

Old pipeline (.woodpecker.yaml): Fully deleted. Prevents dual-config loading issue documented in Phase 1 lessons learned.

Ruff config (pyproject.toml): target-version = "py310", line-length = 120, select = ["E", "F", "W", "I"] -- matches platform standard.

Source changes (6 .py files in src/ and tests/): All changes are mechanical ruff formatting:

  • Import reordering to alphabetical (isort via I rule)
  • Multi-line expressions collapsed to single lines where they fit within 120 chars
  • Removal of extra blank lines

No logic changes detected. No behavioral impact.

No secrets, .env files, or credentials committed. All 12 changed files are pipeline config, pyproject.toml, and Python source/test files.

SOP COMPLIANCE

  • Branch named after issue (4-switch-ci-to-forgejo-pypi for issue #4)
  • PR body follows template-pr-body (Summary, Changes, Test Plan, Review Checklist, Related Notes)
  • Related Notes references the plan slug (plan-2026-03-01-forgejo-pypi-migration)
  • Tests exist and pass (59/59 unit tests, 12 integration tests skip due to missing OAuth -- expected)
  • No secrets, .env files, or credentials committed
  • No unnecessary file changes (all changes are in scope: pipeline swap + ruff config + ruff formatting)
  • Commit messages are descriptive

VERDICT: APPROVED

## PR #5 Review ### BLOCKERS None. ### NITS None. ### CODE REVIEW **Pipeline (.woodpecker.yml):** Matches the woodpecker-sdk reference template exactly. All three steps (lint, test, publish) are correctly configured. The test step correctly omits the `WOODPECKER_URL`/`WOODPECKER_TOKEN` environment variables from the reference template since gmail-sdk does not need Woodpecker API access for its tests -- this is a correct per-repo adaptation as specified in the plan. - Top-level `when: event: [push, pull_request]` -- correct - Lint: `ruff==0.15.2` pinned, checks `src/` and `tests/` -- correct - Test: `pip install -e ".[dev]"`, `pytest tests/ -v` -- correct - Publish: uses `$$FORGEJO_PYPI_URL`, `$$FORGEJO_PUBLISH_USER`, `$$FORGEJO_PUBLISH_TOKEN` via `from_secret` globals -- correct - Publish gated to `event: push, branch: main` -- correct **Old pipeline (.woodpecker.yaml):** Fully deleted. Prevents dual-config loading issue documented in Phase 1 lessons learned. **Ruff config (pyproject.toml):** `target-version = "py310"`, `line-length = 120`, `select = ["E", "F", "W", "I"]` -- matches platform standard. **Source changes (6 .py files in src/ and tests/):** All changes are mechanical ruff formatting: - Import reordering to alphabetical (isort via `I` rule) - Multi-line expressions collapsed to single lines where they fit within 120 chars - Removal of extra blank lines No logic changes detected. No behavioral impact. **No secrets, .env files, or credentials committed.** All 12 changed files are pipeline config, pyproject.toml, and Python source/test files. ### SOP COMPLIANCE - [x] Branch named after issue (`4-switch-ci-to-forgejo-pypi` for issue #4) - [x] PR body follows `template-pr-body` (Summary, Changes, Test Plan, Review Checklist, Related Notes) - [x] Related Notes references the plan slug (`plan-2026-03-01-forgejo-pypi-migration`) - [x] Tests exist and pass (59/59 unit tests, 12 integration tests skip due to missing OAuth -- expected) - [x] No secrets, .env files, or credentials committed - [x] No unnecessary file changes (all changes are in scope: pipeline swap + ruff config + ruff formatting) - [x] Commit messages are descriptive ### VERDICT: APPROVED
forgejo_admin deleted branch 4-switch-ci-to-forgejo-pypi 2026-03-01 18:14:20 +00:00
Sign in to join this conversation.
No description provided.