Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4b1bd80
Rewrite 0.1.0 changelog entry to reflect actual public API
splch Apr 28, 2026
5426608
Rewrite README for the 0.1.0 release
splch Apr 28, 2026
4500aff
Rename code owners to developer-tools and link CUDA-Q backend source
splch Apr 28, 2026
49ac347
Rewrite CONTRIBUTING.md for the 0.1.0 release
splch Apr 28, 2026
0f87f1d
Strengthen issue templates and add security contact link
splch Apr 28, 2026
d1082f0
Write SECURITY.md for the 0.1.0 release
splch Apr 28, 2026
1dc93fc
Deduplicate documentation across README, CONTRIBUTING, and templates
splch Apr 28, 2026
caa0db0
Soft-wrap CONTRIBUTING.md and CODE_OF_CONDUCT.md
splch Apr 28, 2026
63aa637
Tighten 0.1.0 docs and templates against peer-SDK conventions
splch Apr 28, 2026
151c423
Pin README copy to runtime constants and align doc drift
splch Apr 28, 2026
14b072e
Pin more drift surfaces in CI and dedupe workflow setup
splch Apr 28, 2026
6739cc8
Drop redundant template-level description pin
splch Apr 28, 2026
22cd986
Pin remaining drift surfaces and decouple tests from /v0.4
splch Apr 28, 2026
de102db
Simplify doc-drift tests and tighten surrounding copy
splch Apr 28, 2026
3ec148d
Cut documentation duplication and drift surfaces
splch Apr 28, 2026
3d54156
Fix SPDX post-hook silently skipped by openapi-python-client
splch Apr 29, 2026
33f91b4
Drop BEGIN wrapper from SPDX post-hook year computation
splch Apr 29, 2026
296b200
Address review feedback on 0.1.0 prep
splch Apr 29, 2026
10129e6
Generalize SessionManager backend regex and unquote enable-cache
splch Apr 29, 2026
244e0cf
Unwrap hard-wrapped prose in docs and issue templates
splch Apr 29, 2026
07f1709
Bump 0.1.0 release date to open-source launch
splch Apr 29, 2026
7160cec
Correct 0.1.0 release date to actual launch day
splch Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Default owners for everything in the repo.
* @ionq/sdk-team

* @ionq/developer-tools
45 changes: 41 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,49 @@ description: Report a bug in ionq-core
labels: [bug]

body:
- type: markdown
attributes:
value: |
Thanks for taking the time to file a bug report. Please search [existing issues](https://github.com/ionq/ionq-core-python/issues) first.

- type: dropdown
id: area
attributes:
label: Affected area
description: |
See [proposing changes](https://github.com/ionq/ionq-core-python/blob/main/CONTRIBUTING.md#proposing-changes) for the boundary between generated and hand-written code.
options:
- Generated client (regenerated from OpenAPI spec)
- Hand-written extensions (retry, pagination, polling, sessions, native gates, etc.)
- API surface / OpenAPI spec (originates upstream)
- Documentation
- Tests or tooling
- Not sure
validations:
required: true

- type: textarea
id: description
id: what-happened
attributes:
label: Description
description: What happened, and what did you expect to happen?
label: What happened?
description: A clear description of the bug, including any error message or traceback.
validations:
required: true

- type: textarea
id: expected
attributes:
label: What did you expect to happen?
description: Optional - skip if a traceback or error message above already shows the problem.

- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Minimal code or steps to reproduce the bug.
render: Python
validations:
required: true

- type: textarea
id: version
Expand All @@ -25,8 +54,16 @@ body:
description: |
Paste the output of:
```bash
python -c "import ionq_core; print(ionq_core.__version__); import platform; print(platform.python_version()); print(platform.platform())"
python -c "import ionq_core, sys, platform; print(ionq_core.__version__, sys.version, platform.platform())"
```
render: Text
validations:
required: true

- type: checkboxes
id: searched
attributes:
label: Pre-submit checks
options:
- label: I searched existing issues and didn't find a duplicate.
required: true
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Report a security vulnerability
url: https://github.com/ionq/ionq-core-python/security/policy
about: Email security@ionq.co. Do not open a public issue.
- name: IonQ Support
url: https://ionq.com/contact
about: For account, billing, or platform questions, contact IonQ support directly.
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@ description: Suggest a feature for ionq-core
labels: [enhancement]

body:
- type: markdown
attributes:
value: |
Please search [existing issues](https://github.com/ionq/ionq-core-python/issues) before opening a new request. For API surface changes (new endpoints, parameter names, response shapes), see [proposing changes](https://github.com/ionq/ionq-core-python/blob/main/CONTRIBUTING.md#proposing-changes).

- type: textarea
id: description
attributes:
label: Description
description: What problem would this solve, and how would you like it to work?
validations:
required: true

- type: checkboxes
id: searched
attributes:
label: Pre-submit checks
options:
- label: I searched existing issues and didn't find a duplicate.
required: true
20 changes: 20 additions & 0 deletions .github/actions/setup-uv/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Set up uv with Python
description: Install uv and Python with the project's pinned defaults.

inputs:
python-version:
description: Python version to install. Defaults to the project's floor.
required: false
default: "3.12"
enable-cache:
description: Pass-through to astral-sh/setup-uv enable-cache.
required: false
default: "false"

runs:
using: composite
steps:
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ inputs.python-version }}
enable-cache: ${{ inputs.enable-cache }}
5 changes: 2 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
---

> [!IMPORTANT]
> Most code in `ionq_core/` is auto-generated. Do not edit files under `ionq_core/api/`,
> `ionq_core/models/`, or `ionq_core/client.py`, `errors.py`, `types.py` directly.
> See [CONTRIBUTING.md](../CONTRIBUTING.md#code-structure) for details.
> Most code in `ionq_core/` is auto-generated and overwritten on regeneration.
> See [CONTRIBUTING.md](../CONTRIBUTING.md#proposing-changes) for which files are safe to edit.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: ./.github/actions/setup-uv
with:
python-version: "3.12"
enable-cache: ${{ github.event_name == 'push' }}
- run: uv sync
- run: uv run ruff check
Expand All @@ -43,7 +42,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: ./.github/actions/setup-uv
with:
python-version: ${{ matrix.python-version }}
enable-cache: ${{ github.event_name == 'push' }}
Expand All @@ -57,8 +56,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: ./.github/actions/setup-uv
with:
python-version: "3.12"
enable-cache: ${{ github.event_name == 'push' }}
- run: uvx pip-audit --require-hashes --strict -r <(uv pip compile pyproject.toml --generate-hashes)
4 changes: 1 addition & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.12"
- uses: ./.github/actions/setup-uv
- run: uv sync
- run: uv run pdoc -o docs/ -d google ionq_core
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.12"
enable-cache: false
- uses: ./.github/actions/setup-uv
- name: Prepare spec
run: |
set -euo pipefail
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- uses: ./.github/actions/setup-uv
with:
python-version: "3.12"
enable-cache: true
- run: uv sync
- name: Run integration tests
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.12"
enable-cache: false
- uses: ./.github/actions/setup-uv
- run: uv build
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Audit workflows
on:
push:
branches: [main]
paths: [".github/workflows/**"]
paths: [".github/workflows/**", ".github/actions/**"]
pull_request:
paths: [".github/workflows/**"]
paths: [".github/workflows/**", ".github/actions/**"]

permissions:
actions: read
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: gitleaks

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.11
rev: v0.15.12
hooks:
- id: ruff-check
args: [--fix]
Expand Down
34 changes: 19 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2026-04-22
## [Unreleased]

## [0.1.0] - 2026-04-29

### Added

- Auto-generated Python client from the IonQ OpenAPI v0.4 spec (endpoints, typed models, sync + async)
- `IonQClient` convenience wrapper with API key handling, configurable base URL, and User-Agent
- Retry transport with exponential backoff, idempotency-aware retry, and Retry-After support
- Structured exception hierarchy (`IonQError` -> `APIError` -> `AuthenticationError`, `RateLimitError`, etc.)
- Pagination helpers (`iter_jobs`, `aiter_jobs`, `iter_session_jobs`, `aiter_session_jobs`)
- Job polling helpers (`wait_for_job`, `async_wait_for_job`) with timeout and failure detection
- `SessionManager` for QPU session lifecycle (create, end, status, context manager)
- `ClientExtension` API for downstream SDKs to inject hooks, headers, timeouts, and transport wrappers
- Native gate unitary matrices (`gpi_matrix`, `gpi2_matrix`, `ms_matrix`, `zz_matrix`)
- OpenAPI Overlay for spec workarounds (nullable schemas, missing endpoints, gate fixes)
- 100% test coverage on hand-written code (line + branch) enforced in CI
- CI/CD: lint, type check, tests on Python 3.12-3.14, generated code staleness check, weekly spec drift detection
- `IonQClient` factory with `IONQ_API_KEY` auto-detection, configurable timeouts, and unified sync + async transports.
- Sync and async variants (`sync`, `sync_detailed`, `asyncio`, `asyncio_detailed`) for every endpoint, generated from the IonQ OpenAPI spec via `openapi-python-client`.
- Endpoint coverage: backends, characterizations, jobs (create, list, get, delete, cancel, cost, estimate, compiled file, probabilities, variant histogram/shots/probabilities), sessions (create, list, get, end, list jobs), usage, whoami.
- Structured exception hierarchy rooted at `IonQError`, with `APIError` subclasses for 400, 401, 403, 404, 429, and 5xx responses, plus `APIConnectionError` and `APITimeoutError` for transport failures. `RateLimitError` exposes `retry_after`.
- Automatic retry with exponential backoff and jitter on 429, 500, 502, 503, and 520-529 (default 2 retries), respecting `Retry-After` headers.
- `ClientExtension` configuration bundle for downstream SDKs: `EventHook` / `AsyncEventHook` protocols, `HookTransport`, custom retryable status codes, header injection, transport wrappers, and `error_mapper`.
- Pagination helpers `iter_jobs`, `aiter_jobs`, `iter_session_jobs`, and `aiter_session_jobs` that auto-follow cursor pagination.
- Polling helpers `wait_for_job` and `async_wait_for_job` with exponential backoff, `JobTimeoutError`, and `JobFailedError`.
- `SessionManager` with sync and async context-manager support, optional `max_jobs` / `max_time` / `max_cost` limits, and `SessionManager.from_id` for reconnecting to existing sessions.
- Native trapped-ion gate unitaries `gpi_matrix`, `gpi2_matrix`, `ms_matrix`, and `zz_matrix` as plain Python nested tuples (no NumPy dependency).
- Typed `attrs` request and response models with `from_dict()` / `to_dict()` and an `Unset` sentinel that distinguishes "not provided" from `None`.
- Python 3.12 - 3.14 support, `py.typed` marker, Apache-2.0 license.

[Unreleased]: https://github.com/ionq/ionq-core-python/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/ionq/ionq-core-python/releases/tag/v0.1.0
87 changes: 67 additions & 20 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,82 @@

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment:
Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

Examples of unacceptable behavior:
## Scope

- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information without explicit permission
- Other conduct which could reasonably be considered inappropriate
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the project maintainers at support@ionq.co. All complaints will be
reviewed and investigated.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <conduct@ionq.co>. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
Loading
Loading