Skip to content

chore: release v0.19.1 #2079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
43 changes: 21 additions & 22 deletions .github/workflows/ci-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
branches:
- '**'
- "**"
merge_group:
types: [checks_requested]
workflow_dispatch: {}
Expand All @@ -25,7 +25,6 @@ env:
LLVM_VERSION: "14.0"
LLVM_FEATURE_NAME: "14-0"


jobs:
# Check if changes were made to the relevant files.
# Always returns true if running on the default branch, to ensure all changes are thoroughly checked.
Expand All @@ -43,25 +42,25 @@ jobs:
model: ${{ steps.filter.outputs.model == 'true' || steps.override.outputs.out == 'true' }}
llvm: ${{ steps.filter.outputs.llvm == 'true' || steps.override.outputs.out == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Override label
id: override
run: |
echo "Label contains run-ci-checks: $OVERRIDE_LABEL"
if [ "$OVERRIDE_LABEL" == "true" ]; then
echo "Overriding due to label 'run-ci-checks'"
echo "out=true" >> $GITHUB_OUTPUT
elif [ "$DEFAULT_BRANCH" == "true" ]; then
echo "Overriding due to running on the default branch"
echo "out=true" >> $GITHUB_OUTPUT
fi
env:
OVERRIDE_LABEL: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}
DEFAULT_BRANCH: ${{ github.ref_name == github.event.repository.default_branch }}
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/change-filters.yml
- uses: actions/checkout@v4
- name: Override label
id: override
run: |
echo "Label contains run-ci-checks: $OVERRIDE_LABEL"
if [ "$OVERRIDE_LABEL" == "true" ]; then
echo "Overriding due to label 'run-ci-checks'"
echo "out=true" >> $GITHUB_OUTPUT
elif [ "$DEFAULT_BRANCH" == "true" ]; then
echo "Overriding due to running on the default branch"
echo "out=true" >> $GITHUB_OUTPUT
fi
env:
OVERRIDE_LABEL: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}
DEFAULT_BRANCH: ${{ github.ref_name == github.event.repository.default_branch }}
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/change-filters.yml

check:
needs: changes
Expand Down Expand Up @@ -109,7 +108,7 @@ jobs:
- name: Override criterion with the CodSpeed harness
run: cargo add --dev codspeed-criterion-compat --rename criterion --package hugr
- name: Build benchmarks
run: cargo codspeed build --profile bench --features extension_inference,declarative,model_unstable,llvm,llvm-test
run: cargo codspeed build --profile bench --features extension_inference,declarative,llvm,llvm-test
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions hugr-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hugr-cli"
version = "0.15.3"
version = "0.19.1"
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
Expand All @@ -19,7 +19,7 @@ bench = false
clap = { workspace = true, features = ["derive", "cargo"] }
clap-verbosity-flag.workspace = true
derive_more = { workspace = true, features = ["display", "error", "from"] }
hugr = { path = "../hugr", version = "0.15.3" }
hugr = { path = "../hugr", version = "0.19.1" }
serde_json.workspace = true
clio = { workspace = true, features = ["clap-parse"] }

Expand Down
11 changes: 11 additions & 0 deletions hugr-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [0.19.1](https://github.com/CQCL/hugr/compare/hugr-core-v0.15.3...hugr-core-v0.19.1) - 2025-04-25

### New Features

- Export the portgraph hierarchy in HugrInternals ([#2057](https://github.com/CQCL/hugr/pull/2057))
- Implement Debug for generic Wire<N>s ([#2068](https://github.com/CQCL/hugr/pull/2068))
- Add ExtensionOp helpers ([#2072](https://github.com/CQCL/hugr/pull/2072))
- ReplaceTypes: handlers for array constants + linearization ([#2023](https://github.com/CQCL/hugr/pull/2023))
- move `ArrayOpBuilder` to hugr-core ([#2115](https://github.com/CQCL/hugr/pull/2115))
- [**breaking**] Removed `model_unstable` feature flag. ([#2113](https://github.com/CQCL/hugr/pull/2113))

## [0.15.3](https://github.com/CQCL/hugr/compare/hugr-core-v0.15.2...hugr-core-v0.15.3) - 2025-04-02

### Documentation
Expand Down
6 changes: 2 additions & 4 deletions hugr-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hugr-core"
version = "0.15.3"
version = "0.19.1"
edition = { workspace = true }
rust-version = { workspace = true }

Expand All @@ -19,18 +19,16 @@ workspace = true
[features]
extension_inference = []
declarative = ["serde_yaml"]
model_unstable = ["hugr-model"]
zstd = ["dep:zstd"]

[lib]
bench = false

[[test]]
name = "model"
required-features = ["model_unstable"]

[dependencies]
hugr-model = { version = "0.19.0", path = "../hugr-model", optional = true }
hugr-model = { version = "0.19.1", path = "../hugr-model" }

cgmath = { workspace = true, features = ["serde"] }
delegate = { workspace = true }
Expand Down
20 changes: 8 additions & 12 deletions hugr-core/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
![](/hugr/assets/hugr_logo.svg)

hugr-core
===============
# hugr-core

[![build_status][]](https://github.com/CQCL/hugr/actions)
[![crates][]](https://crates.io/crates/hugr-core)
Expand All @@ -21,9 +20,6 @@ Please read the [API documentation here][].
Not enabled by default.
- `declarative`:
Experimental support for declaring extensions in YAML files, support is limited.
- `model_unstable`
Import and export from the representation defined in the `hugr-model` crate.
Unstable and subject to change. Not enabled by default.

## Recent Changes

Expand All @@ -38,10 +34,10 @@ See [DEVELOPMENT.md](https://github.com/CQCL/hugr/blob/main/DEVELOPMENT.md) for

This project is licensed under Apache License, Version 2.0 ([LICENSE][] or http://www.apache.org/licenses/LICENSE-2.0).

[API documentation here]: https://docs.rs/hugr-core/
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
[crates]: https://img.shields.io/crates/v/hugr-core
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/hugr?logo=codecov
[LICENSE]: https://github.com/CQCL/hugr/blob/main/LICENCE
[CHANGELOG]: https://github.com/CQCL/hugr/blob/main/hugr-core/CHANGELOG.md
[API documentation here]: https://docs.rs/hugr-core/
[build_status]: https://github.com/CQCL/hugr/actions/workflows/ci-rs.yml/badge.svg?branch=main
[msrv]: https://img.shields.io/badge/rust-1.75.0%2B-blue.svg
[crates]: https://img.shields.io/crates/v/hugr-core
[codecov]: https://img.shields.io/codecov/c/gh/CQCL/hugr?logo=codecov
[LICENSE]: https://github.com/CQCL/hugr/blob/main/LICENCE
[CHANGELOG]: https://github.com/CQCL/hugr/blob/main/hugr-core/CHANGELOG.md
33 changes: 1 addition & 32 deletions hugr-core/src/envelope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ use std::io::Write;
#[allow(unused_imports)]
use itertools::Itertools as _;

#[cfg(feature = "model_unstable")]
use crate::import::ImportError;

/// Read a HUGR envelope from a reader.
Expand Down Expand Up @@ -197,19 +196,16 @@ pub enum EnvelopeError {
source: PackageEncodingError,
},
/// Error importing a HUGR from a hugr-model payload.
#[cfg(feature = "model_unstable")]
ModelImport {
/// The source error.
source: ImportError,
},
/// Error reading a HUGR model payload.
#[cfg(feature = "model_unstable")]
ModelRead {
/// The source error.
source: hugr_model::v0::binary::ReadError,
},
/// Error writing a HUGR model payload.
#[cfg(feature = "model_unstable")]
ModelWrite {
/// The source error.
source: hugr_model::v0::binary::WriteError,
Expand All @@ -225,17 +221,9 @@ fn read_impl(
match header.format {
#[allow(deprecated)]
EnvelopeFormat::PackageJson => Ok(Package::from_json_reader(payload, registry)?),
#[cfg(feature = "model_unstable")]
EnvelopeFormat::Model | EnvelopeFormat::ModelWithExtensions => {
decode_model(payload, registry, header.format)
}
#[cfg(not(feature = "model_unstable"))]
EnvelopeFormat::Model | EnvelopeFormat::ModelWithExtensions => {
Err(EnvelopeError::FormatUnsupported {
format: header.format,
feature: Some("model_unstable"),
})
}
}
}

Expand All @@ -246,7 +234,6 @@ fn read_impl(
/// - `extension_registry`: An extension registry with additional extensions to use when
/// decoding the HUGR, if they are not already included in the package.
/// - `format`: The format of the payload.
#[cfg(feature = "model_unstable")]
fn decode_model(
mut stream: impl BufRead,
extension_registry: &ExtensionRegistry,
Expand Down Expand Up @@ -286,22 +273,13 @@ fn write_impl(
match config.format {
#[allow(deprecated)]
EnvelopeFormat::PackageJson => package.to_json_writer(writer)?,
#[cfg(feature = "model_unstable")]
EnvelopeFormat::Model | EnvelopeFormat::ModelWithExtensions => {
encode_model(writer, package, config.format)?
}
#[cfg(not(feature = "model_unstable"))]
EnvelopeFormat::Model | EnvelopeFormat::ModelWithExtensions => {
return Err(EnvelopeError::FormatUnsupported {
format: config.format,
feature: Some("model_unstable"),
})
}
}
Ok(())
}

#[cfg(feature = "model_unstable")]
fn encode_model(
mut writer: impl Write,
package: &Package,
Expand Down Expand Up @@ -391,7 +369,6 @@ mod tests {
//#[case::empty(Package::default())] // Not currently supported
#[case::simple(simple_package())]
//#[case::multi(multi_module_package())] // Not currently supported
#[cfg(feature = "model_unstable")]
fn module_exts_roundtrip(#[case] package: Package) {
let mut buffer = Vec::new();
let config = EnvelopeConfig {
Expand All @@ -417,15 +394,7 @@ mod tests {
format: EnvelopeFormat::Model,
zstd: None,
};
let res = package.store(&mut buffer, config);

match cfg!(feature = "model_unstable") {
true => res.unwrap(),
false => {
assert_matches!(res, Err(EnvelopeError::FormatUnsupported { .. }));
return;
}
}
package.store(&mut buffer, config).unwrap();

let (decoded_config, new_package) =
read_envelope(BufReader::new(buffer.as_slice()), &PRELUDE_REGISTRY).unwrap();
Expand Down
2 changes: 0 additions & 2 deletions hugr-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
pub mod builder;
pub mod core;
pub mod envelope;
#[cfg(feature = "model_unstable")]
pub mod export;
pub mod extension;
pub mod hugr;
#[cfg(feature = "model_unstable")]
pub mod import;
pub mod macros;
pub mod ops;
Expand Down
1 change: 0 additions & 1 deletion hugr-core/src/std_extensions/arithmetic/float_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl std::ops::Deref for ConstF64 {

impl ConstF64 {
/// Name of the constructor for creating constant 64bit floats.
#[cfg_attr(not(feature = "model_unstable"), allow(dead_code))]
pub(crate) const CTR_NAME: &'static str = "arithmetic.float.const_f64";

/// Create a new [`ConstF64`]
Expand Down
1 change: 0 additions & 1 deletion hugr-core/src/std_extensions/arithmetic/int_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ pub struct ConstInt {

impl ConstInt {
/// Name of the constructor for creating constant integers.
#[cfg_attr(not(feature = "model_unstable"), allow(dead_code))]
pub(crate) const CTR_NAME: &'static str = "arithmetic.int.const";

/// Create a new [`ConstInt`] with a given width and unsigned value
Expand Down
1 change: 0 additions & 1 deletion hugr-core/src/std_extensions/collections/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub struct ArrayValue {

impl ArrayValue {
/// Name of the constructor for creating constant arrays.
#[cfg_attr(not(feature = "model_unstable"), allow(dead_code))]
pub(crate) const CTR_NAME: &'static str = "collections.array.const";

/// Create a new [CustomConst] for an array of values of type `typ`.
Expand Down
6 changes: 6 additions & 0 deletions hugr-llvm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.19.1](https://github.com/CQCL/hugr/compare/hugr-llvm-v0.15.3...hugr-llvm-v0.19.1) - 2025-04-25

### New Features

- move `ArrayOpBuilder` to hugr-core ([#2115](https://github.com/CQCL/hugr/pull/2115))

## [0.15.3](https://github.com/CQCL/hugr/compare/hugr-llvm-v0.15.2...hugr-llvm-v0.15.3) - 2025-04-02

### New Features
Expand Down
4 changes: 2 additions & 2 deletions hugr-llvm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hugr-llvm"
version = "0.15.3"
version = "0.19.1"
description = "A general and extensible crate for lowering HUGRs into LLVM IR"

edition.workspace = true
Expand All @@ -24,7 +24,7 @@ llvm14-0 = ["inkwell/llvm14-0"]

[dependencies]
inkwell = { version = "0.5.0", default-features = false }
hugr-core = { path = "../hugr-core", version = "0.15.3" }
hugr-core = { path = "../hugr-core", version = "0.19.1" }
anyhow = "1.0.98"
itertools.workspace = true
delegate.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion hugr-model/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hugr-model"
version = "0.19.0"
version = "0.19.1"
readme = "README.md"
documentation = "https://docs.rs/hugr-model/"
description = "Data model for Quantinuum's HUGR intermediate representation"
Expand Down
Loading
Loading