Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ defaults:
shell: bash

jobs:
crate:
name: Publish to crates.io
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Verify package
run: cargo publish --dry-run --locked
- name: Publish to crates.io
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

wheels:
name: Wheel (${{ matrix.target }})
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ version = "0.3.0"
edition = "2024"
rust-version = "1.85"
description = "Rust implementation of the QIR labeled results formatter"
readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/Quantinuum/qir-formatter"
documentation = "https://docs.rs/qir-formatter"
keywords = ["qir", "quantum", "formatter", "results"]
categories = ["encoding", "science", "science::quantum-computing"]

[lib]
name = "_native"
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and emits the text format expected by tools that consume labeled QIR output.
pip install qir-formatter
```

Rust consumers can add the crate from crates.io:

```sh
cargo add qir-formatter --rename qir_formatter
```

The release workflow builds native wheels for standard (GIL-enabled) CPython
3.10 and newer on:

Expand Down Expand Up @@ -95,12 +101,12 @@ methods with typed Rust inputs. Writer methods append to a concrete `QirOutput`
buffer containing text and a malformed-value count. Floats use Rust's standard
formatting, not Python's exact decimal notation.

Consumers can rename the package dependency to give the library an idiomatic
crate name:
The published package uses a hyphenated crates.io name. Consumers can rename the
dependency to give the library an idiomatic crate name:

```toml
[dependencies]
qir_formatter = { package = "qir-formatter", git = "https://github.com/Quantinuum/qir-formatter" }
qir_formatter = { package = "qir-formatter", version = "0.3" }
```

```rust
Expand Down
Loading