Skip to content

Add scripts for OpenAPI generation and post-generation and more convenience - #100

Merged
antalszava merged 11 commits into
mainfrom
makefile
Oct 8, 2026
Merged

antalszava merged 11 commits into
mainfrom
makefile

Conversation

@antalszava

@antalszava antalszava commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds scripts/regenerate_models.py as the OS-independent way to regenerate the client
  • Replace the perl one-liner post_hooks in openapi-python-client-config.yaml with scripts/post_generate.py (same behavior: SPDX/@generated headers, token hidden from repr) — the perl quoting was Unix-only and broke generation on Windows.
  • Add an optional Makefile with shorthand targets (regen, sync-spec, check-generated, lint, test, ...) that wrap the script and the existing uv run commands.
  • generated.yml now runs the script on a Linux/macOS/Windows matrix (staleness gate on Linux), so the regeneration command is defined in one place and exercised on all supported platforms.
  • ci.yml test matrix gains macOS and Windows entries (Python 3.14, --no-cov).
  • Update CONTRIBUTING.md to document the script as the regeneration workflow.

Test plan

  • uv run --group regen python scripts/regenerate_models.py reproduces the committed generated code with zero diff (i.e. the Python post-hooks are byte-identical to the perl ones).
  • Full suite passes locally: 242 tests, 100% branch coverage on hand-written code; ruff check, ruff format --check, and ty check clean.
  • generated.yml staleness jobs pass on ubuntu, macos, and windows on this PR.

Note: Used the help of Claude Code for this PR. 🤖

@antalszava
antalszava requested a review from a team as a code owner August 31, 2026 13:30
@antalszava antalszava changed the title Add cross-platform regeneration script and optional Makefile Add scripts for OpenAPI generation and post-generation and more convenience Aug 31, 2026
@antalszava
antalszava requested review from natestemen and splch August 31, 2026 14:36

@splch splch left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup. One Windows bug inline + two notes. Per plan on #95, this lands after the stack.

Comment thread scripts/post_generate.py
Comment thread .github/workflows/generated.yml Outdated
Comment thread openapi-python-client-config.yaml
hodgestar-ionq
hodgestar-ionq previously approved these changes Sep 1, 2026

@hodgestar-ionq hodgestar-ionq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you for adding the Makefile. I left a couple of questions.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/generated.yml Outdated
Comment thread scripts/post_generate.py Outdated
@splch

splch commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Heads-up: #101 added spec-sync.yml, which carries the same regeneration invocation as generated.yml. If this PR changes how regeneration is invoked, please update spec-sync.yml in the same change so the weekly bot regen and the staleness check stay identical.

@splch

splch commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

zizmor noo!

@antalszava
antalszava requested a review from splch October 8, 2026 18:16
@antalszava
antalszava merged commit 583e872 into main Oct 8, 2026
16 checks passed
@antalszava
antalszava deleted the makefile branch October 8, 2026 20:08
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.

3 participants