Thanks for your interest in improving ionq-core. This guide covers how to file bugs, propose changes, set up a development environment, regenerate the client, and submit pull requests.
This project follows the Contributor Covenant. Report unacceptable behavior to conduct@ionq.co.
- Bug reports and feature requests -> open an issue using the bug or feature template.
- Account, billing, or platform questions -> https://ionq.com/contact.
- Security vulnerabilities -> see SECURITY.md. Do not open a public issue.
ionq-core is generated from IonQ's OpenAPI specification, and most of the package is overwritten on every regeneration. Before opening a pull request, check where your change belongs:
- API surface changes (new endpoints, parameter names, response shapes) -> these originate in the upstream OpenAPI spec, not this repo. Open an issue describing the change you want to see.
- Bugs in generated code -> files marked
linguist-generated=truein.gitattributesare overwritten on every regeneration; never edit them directly. File an issue rather than editing the generated output. - Hand-written extensions, tests, docs, type hints, tooling -> pull requests welcome.
For non-trivial changes, open an issue first to confirm scope before investing significant time.
This project uses uv for Python and dependency management; the uv.lock file is canonical and CI runs with UV_FROZEN=true.
git clone https://github.com/ionq/ionq-core-python
cd ionq-core-python
uv sync
pre-commit installThe supported Python floor is set by requires-python in pyproject.toml; the CI matrix in ci.yml is the source of truth for tested interpreters.
uv run pytest # unit tests; 100% branch coverage gate on hand-written code
uv run ruff check # lint
uv run ruff format --check # format check (drop --check to apply)
uv run ty check ionq_core/ # type checkCoverage is measured against the hand-written modules only; the generated surface is excluded. Tests treat warnings as errors.
Tests under tests/integration/ hit the live IonQ API. They are excluded by default and require an API key:
export IONQ_API_KEY=...
uv run pytest -m integration --no-covCI runs them on a weekly schedule via the integration workflow against a gated secret; you do not need to run them locally for most contributions.
To regenerate ionq_core/api/, ionq_core/models/, and the root-level generated files, run:
uv sync --group regen
curl -sf https://api.ionq.co/v0.4/api-docs -o openapi.json
if [ -f openapi-overlay.yaml ]; then
uv run oas-patch overlay openapi.json openapi-overlay.yaml -o /tmp/patched-spec.json
else
cp openapi.json /tmp/patched-spec.json
fi
uv run openapi-python-client generate \
--path /tmp/patched-spec.json \
--meta none \
--config openapi-python-client-config.yaml \
--custom-template-path custom-templates \
--output-path ionq_core \
--overwriteKeep this command in sync with the generated workflow, which runs the same invocation on every PR. Post-generation hooks (in openapi-python-client-config.yaml) inject SPDX/@generated headers, hide AuthenticatedClient.token from repr, and run ruff fix-and-format.
Commit the regenerated files alongside the spec or template change that caused them. Spec drift is checked weekly by spec-drift.yml, which opens an issue if openapi.json falls behind upstream.
- Fork the repository and create a topic branch off
main. - Make your changes; add or update tests for any hand-written code you touch.
- Run the local checks above and
pre-commit run --all-files. - Push and open a PR against
main. Fill in the Summary and Test plan sections of the template. - CI must pass: lint, tests across the supported-Python matrix, the generated-code staleness check,
pip-audit, andzizmorwhen workflow files change. A reviewer from@ionq/developer-toolswill review.
There is no enforced commit-message format, but PR titles become release notes via gh release create --generate-notes. Write each title as the line you would want to see in a changelog: imperative mood, user-facing, no leading ticket number.
User-visible changes should also be reflected in CHANGELOG.md under the next release section, in Keep a Changelog format.
Contributions are accepted under the project's Apache 2.0 license. To receive IonQ's CLA, email opensource@ionq.co.