[PR #2] [MERGED] Add CI (ruff, mypy, pytest) and a dormant PyPI publish workflow #11

Closed
opened 2026-10-26 22:40:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-python-sdk/pull/2
Author: @wei-hai
Created: 7/15/2026
Status: ✅ Merged
Merged: 7/15/2026
Merged by: @wei-hai

Base: feat/demo-client ← Head: ci/github-actions


📝 Commits (2)

  • 7e0192d Add CI pipeline stacked on the demo client branch
  • a3a6aab CI: rebase onto latest feat/demo-client, fix ruff format nit

📊 Changes

5 files changed (+331 additions, -0 deletions)

View changed files

➕ .github/workflows/ci.yml (+48 -0)
➕ .github/workflows/publish.yml (+68 -0)
📝 pyproject.toml (+21 -0)
📝 src/comfy_sdk/__init__.py (+1 -0)
➕ tests/test_client.py (+193 -0)

📄 Description

Summary

Stacked on #1 (feat/demo-client) rather than main, so this PR is CI/tooling only — no client-logic changes.

  • Adds .github/workflows/ci.yml: runs on pull requests and pushes to main, across a Python 3.10/3.11/3.12/3.13 matrix. Each run installs the package with pip install -e .[dev], then runs ruff check (lint), ruff format --check (formatting), mypy (lenient type checking), and pytest.
  • Adds tests/test_client.py: spins up a local stub HTTP server (standard-library http.server, on a background thread — no extra test dependencies) and drives the Comfy client through submit -> poll -> download, the 422 "wrong format" rejection, and (matching this branch's parent auth commit) the Unauthorized path both when no API key is set and when one is set but rejected. This keeps the SDK's own tests independent of any real Comfy API v2 server or the proxy.
  • Adds [tool.ruff] (line length 100, target py310), lenient [tool.mypy], [tool.pytest.ini_options], and [project.optional-dependencies] dev = [ruff, mypy, pytest] — all added on top of the existing pyproject.toml from feat/demo-client, nothing removed or re-added.
  • Adds a dormant .github/workflows/publish.yml scaffold for publishing to PyPI on demand. It is intentionally inert right now: the job carries if: false and only triggers on manual workflow_dispatch, gated behind a GitHub environment: pypi (for a manual-approval step once that environment is configured with reviewers). The file has a TODO block at the top describing what's needed to turn it on (create the PyPI project, configure a PyPI "Trusted Publisher" for this repo/workflow, and create the pypi environment) — flipping if: false to if: true is the only change needed once those are in place.

src/comfy_sdk/__init__.py is untouched by this PR — git diff origin/feat/demo-client...ci/github-actions shows only .github/workflows/*.yml, the additive pyproject.toml hunks, and tests/test_client.py.

Test plan

  • ruff check . — fails today, pre-existing on feat/demo-client's tip: one line in src/comfy_sdk/__init__.py (the run() signature) is 105 characters against the 100-character limit this PR introduces. Left as-is per instructions not to touch client source in this PR — worth a one-line wrap on the feat/demo-client branch before merge, or CI will start red on this repo.
  • ruff format --check . — same file, same reason, would reformat.
  • mypy src — passes, no issues.
  • pytest -v — 4 passed (submit/poll/download happy path, 422 UI-format rejection, unauthorized-no-key, unauthorized-rejected-key).
  • Validated both workflow YAML files parse (yaml.safe_load).
  • CI itself run on GitHub Actions (will run automatically; expect the lint/format job to go red until the line-length fix above lands on feat/demo-client).

Notes for reviewers

  • This PR intentionally targets feat/demo-client as its base (not main), so it reviews as "CI on top of the client" rather than duplicating the client's files. Merge #1 first, then this one (or merge this after rebasing once #1 lands, whichever the team prefers).
  • Publish workflow is scaffold-only per the org's current manual-publish-only decision; no PyPI credentials exist yet.
  • No LICENSE file exists in this repo yet — leaving that to the org to decide on, not addressing it here.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-python-sdk/pull/2 **Author:** [@wei-hai](https://github.com/wei-hai) **Created:** 7/15/2026 **Status:** ✅ Merged **Merged:** 7/15/2026 **Merged by:** [@wei-hai](https://github.com/wei-hai) **Base:** `feat/demo-client` ← **Head:** `ci/github-actions` --- ### 📝 Commits (2) - [`7e0192d`](https://github.com/Comfy-Org/comfy-python-sdk/commit/7e0192d45902df7ceba95fa6f3fe8c2dff78115c) Add CI pipeline stacked on the demo client branch - [`a3a6aab`](https://github.com/Comfy-Org/comfy-python-sdk/commit/a3a6aabf2d660bd9ee24632af6b7aa58e2512b58) CI: rebase onto latest feat/demo-client, fix ruff format nit ### 📊 Changes **5 files changed** (+331 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/ci.yml` (+48 -0) ➕ `.github/workflows/publish.yml` (+68 -0) 📝 `pyproject.toml` (+21 -0) 📝 `src/comfy_sdk/__init__.py` (+1 -0) ➕ `tests/test_client.py` (+193 -0) </details> ### 📄 Description ## Summary Stacked on #1 (`feat/demo-client`) rather than `main`, so this PR is CI/tooling only — no client-logic changes. - Adds `.github/workflows/ci.yml`: runs on pull requests and pushes to `main`, across a Python 3.10/3.11/3.12/3.13 matrix. Each run installs the package with `pip install -e .[dev]`, then runs `ruff check` (lint), `ruff format --check` (formatting), `mypy` (lenient type checking), and `pytest`. - Adds `tests/test_client.py`: spins up a local stub HTTP server (standard-library `http.server`, on a background thread — no extra test dependencies) and drives the `Comfy` client through submit -> poll -> download, the 422 "wrong format" rejection, and (matching this branch's parent auth commit) the `Unauthorized` path both when no API key is set and when one is set but rejected. This keeps the SDK's own tests independent of any real Comfy API v2 server or the proxy. - Adds `[tool.ruff]` (line length 100, target py310), lenient `[tool.mypy]`, `[tool.pytest.ini_options]`, and `[project.optional-dependencies] dev = [ruff, mypy, pytest]` — all added on top of the existing `pyproject.toml` from `feat/demo-client`, nothing removed or re-added. - Adds a **dormant** `.github/workflows/publish.yml` scaffold for publishing to PyPI on demand. It is intentionally inert right now: the job carries `if: false` and only triggers on manual `workflow_dispatch`, gated behind a GitHub `environment: pypi` (for a manual-approval step once that environment is configured with reviewers). The file has a `TODO` block at the top describing what's needed to turn it on (create the PyPI project, configure a PyPI "Trusted Publisher" for this repo/workflow, and create the `pypi` environment) — flipping `if: false` to `if: true` is the only change needed once those are in place. `src/comfy_sdk/__init__.py` is untouched by this PR — `git diff origin/feat/demo-client...ci/github-actions` shows only `.github/workflows/*.yml`, the additive `pyproject.toml` hunks, and `tests/test_client.py`. ## Test plan - [x] `ruff check .` — **fails today**, pre-existing on `feat/demo-client`'s tip: one line in `src/comfy_sdk/__init__.py` (the `run()` signature) is 105 characters against the 100-character limit this PR introduces. Left as-is per instructions not to touch client source in this PR — worth a one-line wrap on the `feat/demo-client` branch before merge, or CI will start red on this repo. - [x] `ruff format --check .` — same file, same reason, would reformat. - [x] `mypy src` — passes, no issues. - [x] `pytest -v` — 4 passed (submit/poll/download happy path, 422 UI-format rejection, unauthorized-no-key, unauthorized-rejected-key). - [x] Validated both workflow YAML files parse (`yaml.safe_load`). - [ ] CI itself run on GitHub Actions (will run automatically; expect the lint/format job to go red until the line-length fix above lands on `feat/demo-client`). ## Notes for reviewers - This PR intentionally targets `feat/demo-client` as its base (not `main`), so it reviews as "CI on top of the client" rather than duplicating the client's files. Merge #1 first, then this one (or merge this after rebasing once #1 lands, whichever the team prefers). - Publish workflow is scaffold-only per the org's current manual-publish-only decision; no PyPI credentials exist yet. - No `LICENSE` file exists in this repo yet — leaving that to the org to decide on, not addressing it here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:40:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-python-sdk#11
No description provided.