Add copyright headers to generated code and Getting Help to README#23
Merged
Conversation
Add a post-generation hook that prepends the Apache-2.0 copyright header to all generated .py files that don't already have one. Hand-written files are skipped since they already carry the header. Add a Getting Help section to the README directing users to GitHub Issues for bugs, IonQ Support for account questions, and docs.ionq.com for API documentation. Closes #18, closes #19.
Generated files are always fresh - no need to check for existing headers.
Replace verbose Python __import__/pathlib one-liners with concise perl -pi -e commands for both the token repr and copyright header post hooks. Both are shorter, use the same tool, and are cross-platform (macOS + Linux).
The staleness CI check failed because the post-generation hook was prepending copyright headers to files that already had them, producing duplicates. Removing the hand-written headers lets the hook handle all files uniformly.
Run the generator so the post-hook adds copyright headers to all .py files, matching what the staleness CI check produces.
Skip files that already start with '# Copyright' so the hook does not duplicate headers on handwritten files that the generator leaves untouched.
Use -0777 slurp mode with a single substitution instead of line-by-line processing with a per-file hash tracker.
Removed detailed package documentation and examples from the Jinja template.
Contributor
|
@splch can you check that I resolved this merge conflict correctly? |
The merge from main lost the imports and __all__ from the package_init template and re-introduced the copyright header that the post-hook now handles.
Collaborator
Author
just got it fixed up! no problem :) |
guenp
approved these changes
Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small open-source hygiene items:
Copyright headers on generated code (Add copyright headers to generated code templates #18) - Adds a post-generation hook to
openapi-python-client-config.yamlthat prepends the# Copyright 2026 IonQ, Inc. / SPDX-License-Identifier: Apache-2.0header to all generated.pyfiles. Hand-written files are skipped (they already have it). The hook runs beforeruff check/ruff format, so formatting is preserved.Getting Help section in README (Add Getting Help section to README #19) - Adds a section directing users to GitHub Issues for bugs, IonQ Support for account/billing, and docs.ionq.com for API docs.
Closes #18, closes #19.
Test plan
uv run pytest- all 218 tests pass, 100% coverageionq_core/tree - correctly identifies all headerless generated files and skips hand-written files that already have the headerImportant
Most code in
ionq_core/is auto-generated. Do not edit files underionq_core/api/,ionq_core/models/, orionq_core/client.py,errors.py,types.pydirectly.See CONTRIBUTING.md for details.