Skip to content

Commit b5fc472

Browse files
authored
Prep 0.1.0 release: docs, drift pins, and CI hygiene (#30)
* Rewrite 0.1.0 changelog entry to reflect actual public API The placeholder entry described features at a high level and predated the final API surface. Replace it with bullets that match what 0.1.0 actually ships: the exported helpers, exception hierarchy, retry behavior, extension API, and supported Python versions. Bumps the release date to 2026-04-28. * Rewrite README for the 0.1.0 release Replaces the prior README with a from-scratch rewrite tailored to an autogenerated Python SDK against a versioned REST API. Structured per the conventions of openai-python, cloudflare-python, kubernetes-client, qiskit, and cirq: tagline, badges, codegen disclosure, alternative high-level SDKs, install, quickstart (Bell circuit), auth, async, errors, retries, pagination, polling, sessions, advanced (hooks / custom transport / error mapping / native gates), SDK-vs-API version table, SemVer carve-outs, requirements, contributing, support, license. * Rename code owners to developer-tools and link CUDA-Q backend source CODEOWNERS now points at @ionq/developer-tools, matching the team's current name. The README's CUDA-Q bullet now links directly to the IonQServerHelper backend in NVIDIA/cuda-quantum so users can see how the integration is wired. * Rewrite CONTRIBUTING.md for the 0.1.0 release Replaces the brief stub with a comprehensive contributor guide tailored to a generated Python SDK. Sections cover code of conduct, where to ask questions, bug reporting, scope guidance, the generated-vs-hand-written code structure (with the table of paths, the # @generated marker, and the PR-time staleness check), uv-based development setup, local check commands, integration tests, the exact regeneration command, the PR workflow, SemVer carve-outs, release process, security disclosure, and the CLA contact. * Strengthen issue templates and add security contact link Add an affected-area dropdown that mirrors CONTRIBUTING.md's generated/hand-written taxonomy, split bug description into what-happened and expected-behavior, require the reproduction field, add a search-confirmation checkbox to both templates, and route security reports through SECURITY.md instead of public issues. * Write SECURITY.md for the 0.1.0 release * Deduplicate documentation across README, CONTRIBUTING, and templates The generated/hand-written file boundary was restated in five places (README, CONTRIBUTING table, PR template, bug-report dropdown, and pyproject exclusions) with subtle drift, including __init__.py listed inconsistently. CONTRIBUTING.md is now the single source of truth; the other surfaces link to it. The bug-area classification keys off the @generated marker rather than enumerated paths so new generated files don't require doc updates. Other duplications removed: - README "Requirements" section (duplicated pyproject.toml dep pins) - One-row SDK<->API version table (kept the prose that was useful) - Hard-coded "Python 3.12, 3.13, or 3.14" lists (canonical: pyproject + ci.yml) - Standalone "Security" section in CONTRIBUTING (duplicated the Getting help bullet) - @mjk personal handle for the CLA (now opensource@ionq.co) Adds an [Unreleased] section to CHANGELOG so the contribution instruction to "add to the next release section" works. * Soft-wrap CONTRIBUTING.md and CODE_OF_CONDUCT.md Replace hard-wrapped prose (~80 cols) with one-paragraph-per-line so future edits don't reflow whole paragraphs. Word counts unchanged; rendered output is identical. * Tighten 0.1.0 docs and templates against peer-SDK conventions - Rewrite README relative links as absolute GitHub URLs so they resolve on PyPI (the renderer does not follow relative paths). - Add a Safe Harbor clause to SECURITY.md committing to no legal action against good-faith researchers. - Add `[Unreleased]` / `[0.1.0]` link reference footers to CHANGELOG.md so the version tokens resolve. - Replace the abbreviated CODE_OF_CONDUCT.md with the verbatim Contributor Covenant 2.1 and route reports to <conduct@ionq.co>; sync the same address in CONTRIBUTING.md. - Make the "What did you expect?" field optional in the bug-report template - tracebacks usually make it redundant. * Pin README copy to runtime constants and align doc drift - Bump pre-commit ruff to v0.15.12 so it matches the dev dep. - Drop "Quantum" from the README one-liner to align with pyproject and the auto-generated package docstring. - Match LoggingHook arrow style between README and extensions.py. - Reword CONTRIBUTING.md to describe the ty config accurately (rule override for api/ + models/, not a path exclusion). - Fill in 1.5x growth and default total wait in the polling module docstring. - Extract _DEFAULT_BASE_URL so the integration test can import the production URL once instead of redeclaring it. - Decouple unit-test placeholder URLs from the production base. - Add tests/test_docs_consistency.py to pin README copy to the retry, timeout, and polling constants so future drift fails CI. * Pin more drift surfaces in CI and dedupe workflow setup Extends the docs-consistency gate to cover the retry backoff trio, default base URL, auth prefix, exception classes, Python floor across pyproject/CI/.python-version/ruff/ty, generated-paths exclusions, the SessionManager example backend, and the package description across pyproject/README/__init__.py/template. Adds a setup-uv composite action so the pinned SHA and Python default live in one file; routes all five setup-using workflows through it. Names polling's growth factor, hoists the test BASE_URL into conftest, switches the SPDX post-hook to stamp \$(date +%Y), and unifies the package description on "A client library for accessing IonQ Cloud Platform API". * Drop redundant template-level description pin The template's only output is ionq_core/__init__.py, which CI regenerates and then asserts against the canonical text via test_init_module_docstring. A separate template-content test was redundant - the output check catches the same drift. Also trim a parenthetical from the bug-reporting copy. * Pin remaining drift surfaces and decouple tests from /v0.4 Add eight new test classes to test_docs_consistency.py covering generator tool versions, ClientExtension docstring defaults, polling docstring constants, polling.__all__ in README, pyproject classifiers vs CI matrix, _DEFAULT_BASE_URL vs openapi.json servers[0].url, SPDX year consistency across hand-written and generated files, and resolution of cross-doc anchor links. Pin spec-drift.yml's curl URL to _DEFAULT_BASE_URL so a future v0.4 -> v0.5 bump can't silently keep curl'ing the stale endpoint. Derive the API path in tests/conftest.py and tests/test_session.py from _DEFAULT_BASE_URL via urlparse instead of hardcoding /v0.4. * Simplify doc-drift tests and tighten surrounding copy Flatten tests/test_docs_consistency.py from 13 classes to module-level parametrized tests; same coverage in 217 lines instead of 291. Drop the markdown-anchor resolver test (GitHub already renders broken anchors visibly) and the backoff_factor pin (numbers live in _transport.py and won't drift independently of the README). Merge README's "SDK version vs API spec version" into "Versioning" - the SemVer carve-outs already imply API/SDK independence. Drop the duplicated higher-level-interface paragraph from CONTRIBUTING (already linked in "Getting help"). Tighten the post-generation hook paragraph to a one-liner; the config file is right above. Collapse the three-line max_retries fallback ladder in IonQClient into a single next() expression. * Cut documentation duplication and drift surfaces Trim README, CONTRIBUTING, and SECURITY to single-source content; drop the README pin tests for the removed copy. Module docstrings (rendered into the published API reference) now own behavioral detail; the README is the entry point only. - README: drop Authentication detail, Async usage, exception ASCII tree, retry/timeout values, full pagination/polling/sessions snippets, the Advanced section, and versioning carve-outs - all duplicated in module docstrings or drift-prone constants. - CONTRIBUTING: drop the hand-maintained generated-file list (now .gitattributes is the single source), the Versioning section (duplicate of README), and the Releasing section (maintainer-only). - SECURITY: drop the Supported Versions table - it would lie the moment 0.2 ships; the prose policy above already covers it. - test_docs_consistency: drop test_readme_mentions_runtime_constant, test_readme_lists_exception_class, test_readme_lists_polling_name, and the README half of the session-backend pin. Internal-consistency checks (Python floor, classifiers, ruff/coverage/.gitattributes paths, generated-tool versions, base URL, SPDX year, ClientExtension and polling docstring pins) are unchanged. * Fix SPDX post-hook silently skipped by openapi-python-client openapi-python-client checks `cmd.split(" ")[0]` against PATH before running each post_hook. The `YEAR=$(date +%Y) perl ...` prefix made the "command" `YEAR=$(date`, which fails the `shutil.which` check; the hook was skipped, regeneration dropped SPDX headers, and CI's staleness gate fired. Move the year computation into Perl's BEGIN block so the leading token is `perl` and the env-prefix trick is no longer needed. * Drop BEGIN wrapper from SPDX post-hook year computation (localtime)[5]+1900 is the canonical short form; with -p the wrapper's once-per-run benefit is moot (one assignment per file, microseconds). * Address review feedback on 0.1.0 prep - Switch SPDX post-hook from localtime to gmtime so the stamped year is deterministic across CI runner timezones. - Drop the leading underscore on _DEFAULT_BASE_URL and _DEFAULT_TIMEOUT in ionq_client.py; both are load-bearing for the drift-pin tests (and tests/conftest.py), so the private-by-convention naming was misleading. Not added to __all__ - kept off the wildcard surface. - Retarget dead CONTRIBUTING.md#reporting-bugs and #code-structure links in bug_report.yml and pull_request_template.md to the existing #proposing-changes heading; drop the redundant reporting-guide link since the template fields already prompt for what to include. - Add .github/actions/** to zizmor.yml path filters so the new setup-uv composite action gets the same audit coverage as workflow files. * Generalize SessionManager backend regex and unquote enable-cache Tighten test_session_example_backend_consistent so a non-qpu example backend (e.g. "simulator") in session.py would still be caught; pass enable-cache to the composite setup-uv action as a YAML boolean instead of a quoted string. * Unwrap hard-wrapped prose in docs and issue templates * Bump 0.1.0 release date to open-source launch * Correct 0.1.0 release date to actual launch day
1 parent 47c45e4 commit b5fc472

28 files changed

Lines changed: 554 additions & 509 deletions

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# Default owners for everything in the repo.
2-
* @ionq/sdk-team
3-
2+
* @ionq/developer-tools

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,49 @@ description: Report a bug in ionq-core
33
labels: [bug]
44

55
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for taking the time to file a bug report. Please search [existing issues](https://github.com/ionq/ionq-core-python/issues) first.
10+
11+
- type: dropdown
12+
id: area
13+
attributes:
14+
label: Affected area
15+
description: |
16+
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.
17+
options:
18+
- Generated client (regenerated from OpenAPI spec)
19+
- Hand-written extensions (retry, pagination, polling, sessions, native gates, etc.)
20+
- API surface / OpenAPI spec (originates upstream)
21+
- Documentation
22+
- Tests or tooling
23+
- Not sure
24+
validations:
25+
required: true
26+
627
- type: textarea
7-
id: description
28+
id: what-happened
829
attributes:
9-
label: Description
10-
description: What happened, and what did you expect to happen?
30+
label: What happened?
31+
description: A clear description of the bug, including any error message or traceback.
1132
validations:
1233
required: true
1334

35+
- type: textarea
36+
id: expected
37+
attributes:
38+
label: What did you expect to happen?
39+
description: Optional - skip if a traceback or error message above already shows the problem.
40+
1441
- type: textarea
1542
id: reproduction
1643
attributes:
1744
label: Reproduction
1845
description: Minimal code or steps to reproduce the bug.
1946
render: Python
47+
validations:
48+
required: true
2049

2150
- type: textarea
2251
id: version
@@ -25,8 +54,16 @@ body:
2554
description: |
2655
Paste the output of:
2756
```bash
28-
python -c "import ionq_core; print(ionq_core.__version__); import platform; print(platform.python_version()); print(platform.platform())"
57+
python -c "import ionq_core, sys, platform; print(ionq_core.__version__, sys.version, platform.platform())"
2958
```
3059
render: Text
3160
validations:
3261
required: true
62+
63+
- type: checkboxes
64+
id: searched
65+
attributes:
66+
label: Pre-submit checks
67+
options:
68+
- label: I searched existing issues and didn't find a duplicate.
69+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3+
- name: Report a security vulnerability
4+
url: https://github.com/ionq/ionq-core-python/security/policy
5+
about: Email security@ionq.co. Do not open a public issue.
36
- name: IonQ Support
47
url: https://ionq.com/contact
58
about: For account, billing, or platform questions, contact IonQ support directly.

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@ description: Suggest a feature for ionq-core
33
labels: [enhancement]
44

55
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
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).
10+
611
- type: textarea
712
id: description
813
attributes:
914
label: Description
1015
description: What problem would this solve, and how would you like it to work?
1116
validations:
1217
required: true
18+
19+
- type: checkboxes
20+
id: searched
21+
attributes:
22+
label: Pre-submit checks
23+
options:
24+
- label: I searched existing issues and didn't find a duplicate.
25+
required: true
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Set up uv with Python
2+
description: Install uv and Python with the project's pinned defaults.
3+
4+
inputs:
5+
python-version:
6+
description: Python version to install. Defaults to the project's floor.
7+
required: false
8+
default: "3.12"
9+
enable-cache:
10+
description: Pass-through to astral-sh/setup-uv enable-cache.
11+
required: false
12+
default: "false"
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
enable-cache: ${{ inputs.enable-cache }}

.github/pull_request_template.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
---
1010

1111
> [!IMPORTANT]
12-
> Most code in `ionq_core/` is auto-generated. Do not edit files under `ionq_core/api/`,
13-
> `ionq_core/models/`, or `ionq_core/client.py`, `errors.py`, `types.py` directly.
14-
> See [CONTRIBUTING.md](../CONTRIBUTING.md#code-structure) for details.
12+
> Most code in `ionq_core/` is auto-generated and overwritten on regeneration.
13+
> See [CONTRIBUTING.md](../CONTRIBUTING.md#proposing-changes) for which files are safe to edit.

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ jobs:
2323
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2424
with:
2525
persist-credentials: false
26-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
26+
- uses: ./.github/actions/setup-uv
2727
with:
28-
python-version: "3.12"
2928
enable-cache: ${{ github.event_name == 'push' }}
3029
- run: uv sync
3130
- run: uv run ruff check
@@ -43,7 +42,7 @@ jobs:
4342
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4443
with:
4544
persist-credentials: false
46-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
45+
- uses: ./.github/actions/setup-uv
4746
with:
4847
python-version: ${{ matrix.python-version }}
4948
enable-cache: ${{ github.event_name == 'push' }}
@@ -57,8 +56,7 @@ jobs:
5756
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5857
with:
5958
persist-credentials: false
60-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
59+
- uses: ./.github/actions/setup-uv
6160
with:
62-
python-version: "3.12"
6361
enable-cache: ${{ github.event_name == 'push' }}
6462
- run: uvx pip-audit --require-hashes --strict -r <(uv pip compile pyproject.toml --generate-hashes)

.github/workflows/docs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ jobs:
1919
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2020
with:
2121
persist-credentials: false
22-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
23-
with:
24-
python-version: "3.12"
22+
- uses: ./.github/actions/setup-uv
2523
- run: uv sync
2624
- run: uv run pdoc -o docs/ -d google ionq_core
2725
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5

.github/workflows/generated.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ jobs:
1818
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1919
with:
2020
persist-credentials: false
21-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
22-
with:
23-
python-version: "3.12"
24-
enable-cache: false
21+
- uses: ./.github/actions/setup-uv
2522
- name: Prepare spec
2623
run: |
2724
set -euo pipefail

.github/workflows/integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ jobs:
2424
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2525
with:
2626
persist-credentials: false
27-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
27+
- uses: ./.github/actions/setup-uv
2828
with:
29-
python-version: "3.12"
3029
enable-cache: true
3130
- run: uv sync
3231
- name: Run integration tests

0 commit comments

Comments
 (0)