Skip to content

Commit 40974cc

Browse files
Sync OpenAPI: add clone and artifact endpoints, replace CostModel (#83)
* Sync OpenAPI: add clone and artifact endpoints, replace CostModel Regenerate the client against the upstream v0.4 spec (issue #52). - Add clone_job (POST /jobs/{UUID}/clone) and CloneJobPayload. - Replace get_compiled_file (GET /jobs/{UUID}/circuits/{lang}) with get_job_artifact (GET /jobs/{UUID}/artifacts/{artifactId}); the response body is opaque, so only the *_detailed callables are generated. - Replace CostModel with ApiCostModel ("QCT" / "2QGE_operations"). - Add Backend.supported_gates/supported_native_gates/supported_error_mitigations. - Add estimate_job_cost fields: estimated_quantum_compute_time_us, plus rate_information.qct_cost_cents and rate_type; cost fields now nullable. - Update tests, AGENTS.md, and CHANGELOG accordingly. * Bump https://github.com/astral-sh/ruff-pre-commit Bumps the pre-commit group with 1 update: [https://github.com/astral-sh/ruff-pre-commit](https://github.com/astral-sh/ruff-pre-commit). Updates `https://github.com/astral-sh/ruff-pre-commit` from v0.15.14 to 0.15.15 - [Release notes](https://github.com/astral-sh/ruff-pre-commit/releases) - [Commits](astral-sh/ruff-pre-commit@v0.15.14...v0.15.15) --- updated-dependencies: - dependency-name: https://github.com/astral-sh/ruff-pre-commit dependency-version: 0.15.15 dependency-type: direct:production dependency-group: pre-commit ... Signed-off-by: dependabot[bot] <support@github.com> * Bump actions/checkout from 6.0.2 to 6.0.3 in the actions group Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6.0.2 to 6.0.3 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@de0fac2...df4cb1c) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> * Bump the python group across 1 directory with 5 updates Bumps the python group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [pytest](https://github.com/pytest-dev/pytest) | `9.0.3` | `9.1.0` | | [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) | `1.3.0` | `1.4.0` | | [ruff](https://github.com/astral-sh/ruff) | `0.15.15` | `0.15.18` | | [ty](https://github.com/astral-sh/ty) | `0.0.40` | `0.0.50` | | [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) | `0.28.4` | `0.29.0` | Updates `pytest` from 9.0.3 to 9.1.0 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@9.0.3...9.1.0) Updates `pytest-asyncio` from 1.3.0 to 1.4.0 - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](pytest-dev/pytest-asyncio@v1.3.0...v1.4.0) Updates `ruff` from 0.15.15 to 0.15.18 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.15.15...0.15.18) Updates `ty` from 0.0.40 to 0.0.50 - [Release notes](https://github.com/astral-sh/ty/releases) - [Changelog](https://github.com/astral-sh/ty/blob/main/CHANGELOG.md) - [Commits](astral-sh/ty@0.0.40...0.0.50) Updates `openapi-python-client` from 0.28.4 to 0.29.0 - [Release notes](https://github.com/openapi-generators/openapi-python-client/releases) - [Changelog](https://github.com/openapi-generators/openapi-python-client/blob/main/CHANGELOG.md) - [Commits](openapi-generators/openapi-python-client@v0.28.4...v0.29.0) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.1.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python - dependency-name: pytest-asyncio dependency-version: 1.4.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python - dependency-name: ruff dependency-version: 0.15.18 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python - dependency-name: ty dependency-version: 0.0.50 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: python - dependency-name: openapi-python-client dependency-version: 0.29.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python ... Signed-off-by: dependabot[bot] <support@github.com> * Regenerate client with openapi-python-client 0.29.0 Pulls in the pending dependabot bumps (openapi-python-client 0.29.0, ruff 0.15.18, ty 0.0.50, pytest 9.1.0, pytest-asyncio 1.4.0, actions/checkout 6.0.3, ruff-pre-commit v0.15.15) and regenerates the client against them. - 0.29.0 parses timestamps via stdlib datetime.fromisoformat instead of dateutil.parser.isoparse, so drop the now-unused python-dateutil runtime dependency. - 0.29.0 emits bare 'return value' (not cast(Enum, value)) in the generated enum check_* helpers, which ty 0.0.50 flags as invalid-return-type since it can't narrow str to the Literal through the 'value in <set>' guard. Ignore that rule for ionq_core/models/** (the only place those helpers live; api/** return types stay checked), mirroring the existing invalid-argument-type override for generated code. * chore: Simplify the comment * chore: Normalize indentations --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent c697a8d commit 40974cc

75 files changed

Lines changed: 1509 additions & 285 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 10
2222
steps:
23-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2424
with:
2525
persist-credentials: false
2626
- uses: ./.github/actions/setup-uv
@@ -39,7 +39,7 @@ jobs:
3939
matrix:
4040
python-version: ["3.11", "3.12", "3.13", "3.14"]
4141
steps:
42-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
42+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
4343
with:
4444
persist-credentials: false
4545
- uses: ./.github/actions/setup-uv
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-latest
5454
timeout-minutes: 10
5555
steps:
56-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
56+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
5757
with:
5858
persist-credentials: false
5959
- uses: ./.github/actions/setup-uv

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 10
1818
steps:
19-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
19+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2020
with:
2121
persist-credentials: false
2222
- uses: ./.github/actions/setup-uv

.github/workflows/generated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 10
1717
steps:
18-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
18+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
1919
with:
2020
persist-credentials: false
2121
- uses: ./.github/actions/setup-uv

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
timeout-minutes: 15
2222
environment: integration
2323
steps:
24-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2525
with:
2626
persist-credentials: false
2727
- uses: ./.github/actions/setup-uv

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
timeout-minutes: 10
2020
steps:
21-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
21+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2222
with:
2323
persist-credentials: false
2424
- name: Verify tag matches pyproject version

.github/workflows/spec-drift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 5
1616
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
17+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
1818
with:
1919
persist-credentials: false
2020
- name: Fetch latest spec

.github/workflows/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 5
1818
steps:
19-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
19+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2020
with:
2121
persist-credentials: false
2222
- uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: gitleaks
1414

1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.15.14
16+
rev: v0.15.15
1717
hooks:
1818
- id: ruff-check
1919
args: [--fix]

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ Every endpoint module exposes four callables: `sync`, `sync_detailed`, `asyncio`
7575

7676
```python
7777
from ionq_core import IonQClient
78-
from ionq_core.api.default import create_job, get_job, get_compiled_file, get_jobs
78+
from ionq_core.api.default import create_job, get_job, get_variant_probabilities, get_jobs
7979
from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayload
8080

81-
client = IonQClient() # reads IONQ_API_KEY
82-
get_job.sync(uuid, client=client) # one path param
83-
get_compiled_file.sync(uuid, lang, client=client) # multiple path params
84-
get_jobs.sync(client=client, status="completed", limit=10) # query only
85-
create_job.sync(client=client, body=payload) # body only
81+
client = IonQClient() # reads IONQ_API_KEY
82+
get_job.sync(uuid, client=client) # one path param
83+
get_variant_probabilities.sync(uuid, variant_id, client=client) # multiple path params
84+
get_jobs.sync(client=client, status="completed", limit=10) # query only
85+
create_job.sync(client=client, body=payload) # body only
8686
```
8787

8888
Use `next_=` (trailing underscore) for the cursor pagination kwarg — Python keyword collision. The `iter_jobs` / `aiter_jobs` / `iter_session_jobs` / `aiter_session_jobs` helpers handle paging for you.

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
99
### Added
1010

1111
- `QctrlQaoaJobCreationPayload` and `QctrlQaoaJobInput` for submitting Q-CTRL QAOA maxcut combinatorial-optimization jobs via `create_job`. The `create_job` body union now also accepts `QctrlQaoaJobCreationPayload`.
12-
- `cost_model` optional field on `BaseJob`, `GetCircuitJobResponse`, and `GetJobResponse`, typed as `CostModel` (`"quantum_compute_time"` or `"execution_time"`).
12+
- `cost_model` optional field on `BaseJob`, `GetCircuitJobResponse`, and `GetJobResponse`, typed as `ApiCostModel` (`"QCT"` or `"2QGE_operations"`).
13+
- `clone_job` endpoint (`POST /jobs/{UUID}/clone`) and its `CloneJobPayload` model for resubmitting an existing job with optional overrides.
14+
- `get_job_artifact` endpoint (`GET /jobs/{UUID}/artifacts/{artifactId}`) for downloading job artifacts by id. The response body is opaque, so only the `sync_detailed` / `asyncio_detailed` callables are generated; read the bytes off `Response.content`.
15+
- `Backend` now exposes `supported_gates`, `supported_native_gates`, and `supported_error_mitigations`.
16+
- `estimate_job_cost` response gained `estimated_quantum_compute_time_us`, and its `rate_information` gained `qct_cost_cents` and `rate_type` (`"qct"` or `"2qge"`). Its `cost_1q_gate`, `cost_2q_gate`, and `job_cost_minimum` rate fields are now nullable.
1317

1418
### Changed
1519

1620
- `NativeCircuitInput.qubits` and `JsonMultiCircuitInput.qubits` are now `int | Unset` (previously `float | Unset`), matching upstream's tightening to `format: int32, minimum: 1`. `QisCircuitInput.qubits` already had this type locally via the OpenAPI overlay; that overlay action has been removed now that upstream is correct natively.
21+
- Regenerated with `openapi-python-client` 0.29.0. Generated models now parse timestamps with the standard library (`datetime.fromisoformat`) instead of `dateutil.parser.isoparse`.
22+
23+
### Removed
24+
25+
- `get_compiled_file` endpoint (`GET /jobs/{UUID}/circuits/{lang}`) and its `GetCompiledFileLang` enum, removed upstream in favor of `get_job_artifact`. Compiled circuits are now fetched as artifacts by id rather than by `lang` (`"native"` / `"qasm3"`).
26+
- `CostModel` model, replaced by `ApiCostModel`.
27+
- The `python-dateutil` runtime dependency, no longer needed now that generated code uses `datetime.fromisoformat`.
1728

1829
## [0.1.1] - 2026-04-30
1930

0 commit comments

Comments
 (0)