From 1c8e1be1f1a147a5c0fc3b14c82194e89a19a622 Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Wed, 6 Mar 2024 15:50:42 +0000 Subject: [PATCH 1/3] chore: Add a rust workspace --- .github/workflows/ci.yml | 22 ++--- Cargo.toml | 81 +++++-------------- quantinuum-hugr/Cargo.toml | 64 +++++++++++++++ .../benches}/bench_main.rs | 0 .../benches}/benchmarks/hugr.rs | 0 .../benches}/benchmarks/mod.rs | 0 .../examples}/extension/declarative.yaml | 0 {src => quantinuum-hugr/src}/algorithm.rs | 0 .../src}/algorithm/const_fold.rs | 0 .../src}/algorithm/half_node.rs | 0 .../src}/algorithm/nest_cfgs.rs | 0 {src => quantinuum-hugr/src}/builder.rs | 0 .../src}/builder/build_traits.rs | 0 {src => quantinuum-hugr/src}/builder/cfg.rs | 0 .../src}/builder/circuit.rs | 0 .../src}/builder/conditional.rs | 0 .../src}/builder/dataflow.rs | 0 .../src}/builder/handle.rs | 0 .../src}/builder/module.rs | 0 .../src}/builder/tail_loop.rs | 0 {src => quantinuum-hugr/src}/core.rs | 0 {src => quantinuum-hugr/src}/extension.rs | 0 .../src}/extension/const_fold.rs | 0 .../src}/extension/declarative.rs | 0 .../src}/extension/declarative/ops.rs | 0 .../src}/extension/declarative/signature.rs | 0 .../src}/extension/declarative/types.rs | 0 .../src}/extension/infer.rs | 0 .../src}/extension/infer/test.rs | 0 .../src}/extension/op_def.rs | 0 .../src}/extension/prelude.rs | 0 .../src}/extension/simple_op.rs | 0 .../src}/extension/type_def.rs | 0 .../src}/extension/validate.rs | 0 {src => quantinuum-hugr/src}/hugr.rs | 0 {src => quantinuum-hugr/src}/hugr/hugrmut.rs | 0 {src => quantinuum-hugr/src}/hugr/ident.rs | 0 {src => quantinuum-hugr/src}/hugr/rewrite.rs | 0 .../src}/hugr/rewrite/consts.rs | 0 .../src}/hugr/rewrite/inline_dfg.rs | 0 .../src}/hugr/rewrite/insert_identity.rs | 0 .../src}/hugr/rewrite/outline_cfg.rs | 0 .../src}/hugr/rewrite/replace.rs | 0 .../src}/hugr/rewrite/simple_replace.rs | 0 .../src}/hugr/serialize.rs | 2 +- {src => quantinuum-hugr/src}/hugr/validate.rs | 0 .../src}/hugr/validate/test.rs | 0 {src => quantinuum-hugr/src}/hugr/views.rs | 0 .../src}/hugr/views/descendants.rs | 0 .../src}/hugr/views/petgraph.rs | 0 .../src}/hugr/views/render.rs | 0 .../src}/hugr/views/root_checked.rs | 0 .../src}/hugr/views/sibling.rs | 0 .../src}/hugr/views/sibling_subgraph.rs | 0 .../hugr__hugr__views__tests__dot_cfg.snap | 0 .../hugr__hugr__views__tests__dot_dfg.snap | 0 ...gr__hugr__views__tests__dot_empty_dfg.snap | 0 .../hugr__hugr__views__tests__mmd_cfg.snap | 0 .../hugr__hugr__views__tests__mmd_dfg.snap | 0 ...gr__hugr__views__tests__mmd_empty_dfg.snap | 0 .../src}/hugr/views/tests.rs | 0 {src => quantinuum-hugr/src}/lib.rs | 1 - {src => quantinuum-hugr/src}/macros.rs | 0 {src => quantinuum-hugr/src}/ops.rs | 0 {src => quantinuum-hugr/src}/ops/constant.rs | 0 .../src}/ops/controlflow.rs | 0 {src => quantinuum-hugr/src}/ops/custom.rs | 0 {src => quantinuum-hugr/src}/ops/dataflow.rs | 0 {src => quantinuum-hugr/src}/ops/handle.rs | 0 {src => quantinuum-hugr/src}/ops/leaf.rs | 0 {src => quantinuum-hugr/src}/ops/module.rs | 0 {src => quantinuum-hugr/src}/ops/tag.rs | 0 {src => quantinuum-hugr/src}/ops/validate.rs | 0 .../src}/std_extensions.rs | 0 .../std_extensions/arithmetic/conversions.rs | 0 .../arithmetic/conversions/const_fold.rs | 0 .../std_extensions/arithmetic/float_ops.rs | 0 .../arithmetic/float_ops/const_fold.rs | 0 .../std_extensions/arithmetic/float_types.rs | 0 .../src}/std_extensions/arithmetic/int_ops.rs | 0 .../std_extensions/arithmetic/int_types.rs | 0 .../src}/std_extensions/arithmetic/mod.rs | 0 .../src}/std_extensions/collections.rs | 0 .../src}/std_extensions/logic.rs | 0 {src => quantinuum-hugr/src}/types.rs | 0 {src => quantinuum-hugr/src}/types/check.rs | 0 {src => quantinuum-hugr/src}/types/custom.rs | 0 .../src}/types/poly_func.rs | 0 .../src}/types/serialize.rs | 0 .../src}/types/signature.rs | 0 .../src}/types/type_param.rs | 0 .../src}/types/type_row.rs | 0 {src => quantinuum-hugr/src}/utils.rs | 0 {src => quantinuum-hugr/src}/values.rs | 0 release-plz.toml | 9 +++ 95 files changed, 103 insertions(+), 76 deletions(-) create mode 100644 quantinuum-hugr/Cargo.toml rename {benches => quantinuum-hugr/benches}/bench_main.rs (100%) rename {benches => quantinuum-hugr/benches}/benchmarks/hugr.rs (100%) rename {benches => quantinuum-hugr/benches}/benchmarks/mod.rs (100%) rename {examples => quantinuum-hugr/examples}/extension/declarative.yaml (100%) rename {src => quantinuum-hugr/src}/algorithm.rs (100%) rename {src => quantinuum-hugr/src}/algorithm/const_fold.rs (100%) rename {src => quantinuum-hugr/src}/algorithm/half_node.rs (100%) rename {src => quantinuum-hugr/src}/algorithm/nest_cfgs.rs (100%) rename {src => quantinuum-hugr/src}/builder.rs (100%) rename {src => quantinuum-hugr/src}/builder/build_traits.rs (100%) rename {src => quantinuum-hugr/src}/builder/cfg.rs (100%) rename {src => quantinuum-hugr/src}/builder/circuit.rs (100%) rename {src => quantinuum-hugr/src}/builder/conditional.rs (100%) rename {src => quantinuum-hugr/src}/builder/dataflow.rs (100%) rename {src => quantinuum-hugr/src}/builder/handle.rs (100%) rename {src => quantinuum-hugr/src}/builder/module.rs (100%) rename {src => quantinuum-hugr/src}/builder/tail_loop.rs (100%) rename {src => quantinuum-hugr/src}/core.rs (100%) rename {src => quantinuum-hugr/src}/extension.rs (100%) rename {src => quantinuum-hugr/src}/extension/const_fold.rs (100%) rename {src => quantinuum-hugr/src}/extension/declarative.rs (100%) rename {src => quantinuum-hugr/src}/extension/declarative/ops.rs (100%) rename {src => quantinuum-hugr/src}/extension/declarative/signature.rs (100%) rename {src => quantinuum-hugr/src}/extension/declarative/types.rs (100%) rename {src => quantinuum-hugr/src}/extension/infer.rs (100%) rename {src => quantinuum-hugr/src}/extension/infer/test.rs (100%) rename {src => quantinuum-hugr/src}/extension/op_def.rs (100%) rename {src => quantinuum-hugr/src}/extension/prelude.rs (100%) rename {src => quantinuum-hugr/src}/extension/simple_op.rs (100%) rename {src => quantinuum-hugr/src}/extension/type_def.rs (100%) rename {src => quantinuum-hugr/src}/extension/validate.rs (100%) rename {src => quantinuum-hugr/src}/hugr.rs (100%) rename {src => quantinuum-hugr/src}/hugr/hugrmut.rs (100%) rename {src => quantinuum-hugr/src}/hugr/ident.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite/consts.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite/inline_dfg.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite/insert_identity.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite/outline_cfg.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite/replace.rs (100%) rename {src => quantinuum-hugr/src}/hugr/rewrite/simple_replace.rs (100%) rename {src => quantinuum-hugr/src}/hugr/serialize.rs (99%) rename {src => quantinuum-hugr/src}/hugr/validate.rs (100%) rename {src => quantinuum-hugr/src}/hugr/validate/test.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/descendants.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/petgraph.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/render.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/root_checked.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/sibling.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/sibling_subgraph.rs (100%) rename {src => quantinuum-hugr/src}/hugr/views/snapshots/hugr__hugr__views__tests__dot_cfg.snap (100%) rename {src => quantinuum-hugr/src}/hugr/views/snapshots/hugr__hugr__views__tests__dot_dfg.snap (100%) rename {src => quantinuum-hugr/src}/hugr/views/snapshots/hugr__hugr__views__tests__dot_empty_dfg.snap (100%) rename {src => quantinuum-hugr/src}/hugr/views/snapshots/hugr__hugr__views__tests__mmd_cfg.snap (100%) rename {src => quantinuum-hugr/src}/hugr/views/snapshots/hugr__hugr__views__tests__mmd_dfg.snap (100%) rename {src => quantinuum-hugr/src}/hugr/views/snapshots/hugr__hugr__views__tests__mmd_empty_dfg.snap (100%) rename {src => quantinuum-hugr/src}/hugr/views/tests.rs (100%) rename {src => quantinuum-hugr/src}/lib.rs (99%) rename {src => quantinuum-hugr/src}/macros.rs (100%) rename {src => quantinuum-hugr/src}/ops.rs (100%) rename {src => quantinuum-hugr/src}/ops/constant.rs (100%) rename {src => quantinuum-hugr/src}/ops/controlflow.rs (100%) rename {src => quantinuum-hugr/src}/ops/custom.rs (100%) rename {src => quantinuum-hugr/src}/ops/dataflow.rs (100%) rename {src => quantinuum-hugr/src}/ops/handle.rs (100%) rename {src => quantinuum-hugr/src}/ops/leaf.rs (100%) rename {src => quantinuum-hugr/src}/ops/module.rs (100%) rename {src => quantinuum-hugr/src}/ops/tag.rs (100%) rename {src => quantinuum-hugr/src}/ops/validate.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/conversions.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/conversions/const_fold.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/float_ops.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/float_ops/const_fold.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/float_types.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/int_ops.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/int_types.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/arithmetic/mod.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/collections.rs (100%) rename {src => quantinuum-hugr/src}/std_extensions/logic.rs (100%) rename {src => quantinuum-hugr/src}/types.rs (100%) rename {src => quantinuum-hugr/src}/types/check.rs (100%) rename {src => quantinuum-hugr/src}/types/custom.rs (100%) rename {src => quantinuum-hugr/src}/types/poly_func.rs (100%) rename {src => quantinuum-hugr/src}/types/serialize.rs (100%) rename {src => quantinuum-hugr/src}/types/signature.rs (100%) rename {src => quantinuum-hugr/src}/types/type_param.rs (100%) rename {src => quantinuum-hugr/src}/types/type_row.rs (100%) rename {src => quantinuum-hugr/src}/utils.rs (100%) rename {src => quantinuum-hugr/src}/values.rs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fcf3f8f1..848e5eac6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,9 +33,9 @@ jobs: - name: Check formatting run: cargo fmt -- --check - name: Run clippy - run: cargo clippy --all-targets --all-features -- -D warnings + run: cargo clippy --all-targets --all-features --workspace -- -D warnings - name: Build docs - run: cargo doc --no-deps --all-features + run: cargo doc --no-deps --all-features --workspace env: RUSTDOCFLAGS: "-Dwarnings" @@ -48,9 +48,9 @@ jobs: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - name: Build benchmarks with no features - run: cargo bench --verbose --no-run --no-default-features + run: cargo bench --verbose --no-run --workspace --no-default-features - name: Build benchmarks with all features - run: cargo bench --verbose --no-run --all-features + run: cargo bench --verbose --no-run --workspace --all-features tests: runs-on: ubuntu-latest @@ -79,13 +79,13 @@ jobs: - name: Configure default rust toolchain run: rustup override set ${{steps.toolchain.outputs.name}} - name: Build with no features - run: cargo test --verbose --no-default-features --no-run + run: cargo test --verbose --workspace --no-default-features --no-run - name: Tests with no features - run: cargo test --verbose --no-default-features + run: cargo test --verbose --workspace --no-default-features - name: Build with all features - run: cargo test --verbose --all-features --no-run + run: cargo test --verbose --workspace --all-features --no-run - name: Tests with all features - run: cargo test --verbose --all-features + run: cargo test --verbose --workspace --all-features coverage: if: github.event_name != 'merge_group' @@ -102,10 +102,10 @@ jobs: - name: Run tests with coverage instrumentation run: | cargo llvm-cov clean --workspace - cargo llvm-cov --no-report --no-default-features --doctests - cargo llvm-cov --no-report --all-features --doctests + cargo llvm-cov --no-report --workspace --no-default-features --doctests + cargo llvm-cov --no-report --workspace --all-features --doctests - name: Generate coverage report - run: cargo llvm-cov --all-features report --codecov --output-path coverage.json + run: cargo llvm-cov --all-features --workspace report --codecov --output-path coverage.json - name: Upload coverage to codecov.io uses: codecov/codecov-action@v4 with: diff --git a/Cargo.toml b/Cargo.toml index 23f263892..f21aaf527 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,70 +1,25 @@ -[package] -name = "quantinuum-hugr" -version = "0.2.0" -edition = "2021" -rust-version = "1.75" - -license = "Apache-2.0" -readme = "README.md" -documentation = "https://docs.rs/hugr/" -repository = "https://github.com/CQCL/hugr" -description = "Quantinuum's Hierarchical Unified Graph Representation" -keywords = ["Quantum", "Quantinuum"] -categories = ["compilers"] - -[lib] -# Using different names for the lib and for the package is supported, but may be confusing. -# https://github.com/rust-lang/cargo/issues/6827 -# TODO: Should we rename one of them? -name = "hugr" -bench = false -path = "src/lib.rs" +[profile.release] +lto = "thin" -[features] -extension_inference = [] +[workspace] +resolver = "2" +members = ["quantinuum-hugr"] +default-members = ["quantinuum-hugr"] -[dependencies] -thiserror = "1.0.28" -portgraph = { version = "0.12.0", features = ["serde", "petgraph"] } -regex = "1.9.5" -cgmath = { version = "0.18.0", features = ["serde"] } -num-rational = { version = "0.4.1", features = ["serde"] } -downcast-rs = "1.2.0" -serde = { version = "1.0", features = [ - # Rc used here for Extension, but unfortunately we must turn the feature on globally - "derive", - "rc", -] } -serde_yaml = "0.9.19" -typetag = "0.2.7" -smol_str = { version = "0.2.0", features = ["serde"] } -derive_more = "0.99.17" -itertools = "0.12.0" -html-escape = "0.2.13" -bitvec = { version = "1.0.1", features = ["serde"] } -enum_dispatch = "0.3.11" -lazy_static = "1.4.0" -petgraph = { version = "0.6.3", default-features = false } -context-iterators = "0.2.0" -serde_json = "1.0.97" -delegate = "0.12.0" -paste = "1.0" -strum = "0.26.1" -strum_macros = "0.26.1" - -[dev-dependencies] -criterion = { version = "0.5.1", features = ["html_reports"] } -rstest = "0.18.1" -webbrowser = "0.8.10" -urlencoding = "2.1.2" -cool_asserts = "2.0.3" -insta = { version = "1.34.0", features = ["yaml"] } -jsonschema = "0.17.1" +[workspace.package] +rust-version = "1.75" +edition = "2021" +homepage = "https://github.com/CQCL/tket2" +repository = "https://github.com/CQCL/tket2" +license = "Apache-2.0" +# authors -[[bench]] -name = "bench_main" -harness = false +[workspace.lints.rust] +missing_docs = "warn" +[workspace.dependencies] +portgraph = { version = "0.12.0" } +insta = { version = "1.34.0" } [profile.dev.package.insta] opt-level = 3 diff --git a/quantinuum-hugr/Cargo.toml b/quantinuum-hugr/Cargo.toml new file mode 100644 index 000000000..a12b1766d --- /dev/null +++ b/quantinuum-hugr/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "quantinuum-hugr" +version = "0.2.0" +edition = { workspace = true } +rust-version = { workspace = true } + +license = { workspace = true } +readme = "README.md" +documentation = "https://docs.rs/hugr/" +homepage = { workspace = true } +repository = { workspace = true } +description = "Quantinuum's Hierarchical Unified Graph Representation" +keywords = ["Quantum", "Quantinuum"] +categories = ["compilers"] + +[lib] +name = "hugr" +bench = false +path = "src/lib.rs" + +[features] +extension_inference = [] + +[dependencies] +portgraph = { workspace = true, features = ["serde", "petgraph"] } +thiserror = "1.0.28" +regex = "1.9.5" +cgmath = { version = "0.18.0", features = ["serde"] } +num-rational = { version = "0.4.1", features = ["serde"] } +downcast-rs = "1.2.0" +serde = { version = "1.0", features = [ + # Rc used here for Extension, but unfortunately we must turn the feature on globally + "derive", + "rc", +] } +serde_yaml = "0.9.19" +typetag = "0.2.7" +smol_str = { version = "0.2.0", features = ["serde"] } +derive_more = "0.99.17" +itertools = "0.12.0" +html-escape = "0.2.13" +bitvec = { version = "1.0.1", features = ["serde"] } +enum_dispatch = "0.3.11" +lazy_static = "1.4.0" +petgraph = { version = "0.6.3", default-features = false } +context-iterators = "0.2.0" +serde_json = "1.0.97" +delegate = "0.12.0" +paste = "1.0" +strum = "0.26.1" +strum_macros = "0.26.1" + +[dev-dependencies] +criterion = { version = "0.5.1", features = ["html_reports"] } +rstest = "0.18.1" +webbrowser = "0.8.10" +urlencoding = "2.1.2" +cool_asserts = "2.0.3" +insta = { workspace = true, features = ["yaml"] } +jsonschema = "0.17.1" + +[[bench]] +name = "bench_main" +harness = false diff --git a/benches/bench_main.rs b/quantinuum-hugr/benches/bench_main.rs similarity index 100% rename from benches/bench_main.rs rename to quantinuum-hugr/benches/bench_main.rs diff --git a/benches/benchmarks/hugr.rs b/quantinuum-hugr/benches/benchmarks/hugr.rs similarity index 100% rename from benches/benchmarks/hugr.rs rename to quantinuum-hugr/benches/benchmarks/hugr.rs diff --git a/benches/benchmarks/mod.rs b/quantinuum-hugr/benches/benchmarks/mod.rs similarity index 100% rename from benches/benchmarks/mod.rs rename to quantinuum-hugr/benches/benchmarks/mod.rs diff --git a/examples/extension/declarative.yaml b/quantinuum-hugr/examples/extension/declarative.yaml similarity index 100% rename from examples/extension/declarative.yaml rename to quantinuum-hugr/examples/extension/declarative.yaml diff --git a/src/algorithm.rs b/quantinuum-hugr/src/algorithm.rs similarity index 100% rename from src/algorithm.rs rename to quantinuum-hugr/src/algorithm.rs diff --git a/src/algorithm/const_fold.rs b/quantinuum-hugr/src/algorithm/const_fold.rs similarity index 100% rename from src/algorithm/const_fold.rs rename to quantinuum-hugr/src/algorithm/const_fold.rs diff --git a/src/algorithm/half_node.rs b/quantinuum-hugr/src/algorithm/half_node.rs similarity index 100% rename from src/algorithm/half_node.rs rename to quantinuum-hugr/src/algorithm/half_node.rs diff --git a/src/algorithm/nest_cfgs.rs b/quantinuum-hugr/src/algorithm/nest_cfgs.rs similarity index 100% rename from src/algorithm/nest_cfgs.rs rename to quantinuum-hugr/src/algorithm/nest_cfgs.rs diff --git a/src/builder.rs b/quantinuum-hugr/src/builder.rs similarity index 100% rename from src/builder.rs rename to quantinuum-hugr/src/builder.rs diff --git a/src/builder/build_traits.rs b/quantinuum-hugr/src/builder/build_traits.rs similarity index 100% rename from src/builder/build_traits.rs rename to quantinuum-hugr/src/builder/build_traits.rs diff --git a/src/builder/cfg.rs b/quantinuum-hugr/src/builder/cfg.rs similarity index 100% rename from src/builder/cfg.rs rename to quantinuum-hugr/src/builder/cfg.rs diff --git a/src/builder/circuit.rs b/quantinuum-hugr/src/builder/circuit.rs similarity index 100% rename from src/builder/circuit.rs rename to quantinuum-hugr/src/builder/circuit.rs diff --git a/src/builder/conditional.rs b/quantinuum-hugr/src/builder/conditional.rs similarity index 100% rename from src/builder/conditional.rs rename to quantinuum-hugr/src/builder/conditional.rs diff --git a/src/builder/dataflow.rs b/quantinuum-hugr/src/builder/dataflow.rs similarity index 100% rename from src/builder/dataflow.rs rename to quantinuum-hugr/src/builder/dataflow.rs diff --git a/src/builder/handle.rs b/quantinuum-hugr/src/builder/handle.rs similarity index 100% rename from src/builder/handle.rs rename to quantinuum-hugr/src/builder/handle.rs diff --git a/src/builder/module.rs b/quantinuum-hugr/src/builder/module.rs similarity index 100% rename from src/builder/module.rs rename to quantinuum-hugr/src/builder/module.rs diff --git a/src/builder/tail_loop.rs b/quantinuum-hugr/src/builder/tail_loop.rs similarity index 100% rename from src/builder/tail_loop.rs rename to quantinuum-hugr/src/builder/tail_loop.rs diff --git a/src/core.rs b/quantinuum-hugr/src/core.rs similarity index 100% rename from src/core.rs rename to quantinuum-hugr/src/core.rs diff --git a/src/extension.rs b/quantinuum-hugr/src/extension.rs similarity index 100% rename from src/extension.rs rename to quantinuum-hugr/src/extension.rs diff --git a/src/extension/const_fold.rs b/quantinuum-hugr/src/extension/const_fold.rs similarity index 100% rename from src/extension/const_fold.rs rename to quantinuum-hugr/src/extension/const_fold.rs diff --git a/src/extension/declarative.rs b/quantinuum-hugr/src/extension/declarative.rs similarity index 100% rename from src/extension/declarative.rs rename to quantinuum-hugr/src/extension/declarative.rs diff --git a/src/extension/declarative/ops.rs b/quantinuum-hugr/src/extension/declarative/ops.rs similarity index 100% rename from src/extension/declarative/ops.rs rename to quantinuum-hugr/src/extension/declarative/ops.rs diff --git a/src/extension/declarative/signature.rs b/quantinuum-hugr/src/extension/declarative/signature.rs similarity index 100% rename from src/extension/declarative/signature.rs rename to quantinuum-hugr/src/extension/declarative/signature.rs diff --git a/src/extension/declarative/types.rs b/quantinuum-hugr/src/extension/declarative/types.rs similarity index 100% rename from src/extension/declarative/types.rs rename to quantinuum-hugr/src/extension/declarative/types.rs diff --git a/src/extension/infer.rs b/quantinuum-hugr/src/extension/infer.rs similarity index 100% rename from src/extension/infer.rs rename to quantinuum-hugr/src/extension/infer.rs diff --git a/src/extension/infer/test.rs b/quantinuum-hugr/src/extension/infer/test.rs similarity index 100% rename from src/extension/infer/test.rs rename to quantinuum-hugr/src/extension/infer/test.rs diff --git a/src/extension/op_def.rs b/quantinuum-hugr/src/extension/op_def.rs similarity index 100% rename from src/extension/op_def.rs rename to quantinuum-hugr/src/extension/op_def.rs diff --git a/src/extension/prelude.rs b/quantinuum-hugr/src/extension/prelude.rs similarity index 100% rename from src/extension/prelude.rs rename to quantinuum-hugr/src/extension/prelude.rs diff --git a/src/extension/simple_op.rs b/quantinuum-hugr/src/extension/simple_op.rs similarity index 100% rename from src/extension/simple_op.rs rename to quantinuum-hugr/src/extension/simple_op.rs diff --git a/src/extension/type_def.rs b/quantinuum-hugr/src/extension/type_def.rs similarity index 100% rename from src/extension/type_def.rs rename to quantinuum-hugr/src/extension/type_def.rs diff --git a/src/extension/validate.rs b/quantinuum-hugr/src/extension/validate.rs similarity index 100% rename from src/extension/validate.rs rename to quantinuum-hugr/src/extension/validate.rs diff --git a/src/hugr.rs b/quantinuum-hugr/src/hugr.rs similarity index 100% rename from src/hugr.rs rename to quantinuum-hugr/src/hugr.rs diff --git a/src/hugr/hugrmut.rs b/quantinuum-hugr/src/hugr/hugrmut.rs similarity index 100% rename from src/hugr/hugrmut.rs rename to quantinuum-hugr/src/hugr/hugrmut.rs diff --git a/src/hugr/ident.rs b/quantinuum-hugr/src/hugr/ident.rs similarity index 100% rename from src/hugr/ident.rs rename to quantinuum-hugr/src/hugr/ident.rs diff --git a/src/hugr/rewrite.rs b/quantinuum-hugr/src/hugr/rewrite.rs similarity index 100% rename from src/hugr/rewrite.rs rename to quantinuum-hugr/src/hugr/rewrite.rs diff --git a/src/hugr/rewrite/consts.rs b/quantinuum-hugr/src/hugr/rewrite/consts.rs similarity index 100% rename from src/hugr/rewrite/consts.rs rename to quantinuum-hugr/src/hugr/rewrite/consts.rs diff --git a/src/hugr/rewrite/inline_dfg.rs b/quantinuum-hugr/src/hugr/rewrite/inline_dfg.rs similarity index 100% rename from src/hugr/rewrite/inline_dfg.rs rename to quantinuum-hugr/src/hugr/rewrite/inline_dfg.rs diff --git a/src/hugr/rewrite/insert_identity.rs b/quantinuum-hugr/src/hugr/rewrite/insert_identity.rs similarity index 100% rename from src/hugr/rewrite/insert_identity.rs rename to quantinuum-hugr/src/hugr/rewrite/insert_identity.rs diff --git a/src/hugr/rewrite/outline_cfg.rs b/quantinuum-hugr/src/hugr/rewrite/outline_cfg.rs similarity index 100% rename from src/hugr/rewrite/outline_cfg.rs rename to quantinuum-hugr/src/hugr/rewrite/outline_cfg.rs diff --git a/src/hugr/rewrite/replace.rs b/quantinuum-hugr/src/hugr/rewrite/replace.rs similarity index 100% rename from src/hugr/rewrite/replace.rs rename to quantinuum-hugr/src/hugr/rewrite/replace.rs diff --git a/src/hugr/rewrite/simple_replace.rs b/quantinuum-hugr/src/hugr/rewrite/simple_replace.rs similarity index 100% rename from src/hugr/rewrite/simple_replace.rs rename to quantinuum-hugr/src/hugr/rewrite/simple_replace.rs diff --git a/src/hugr/serialize.rs b/quantinuum-hugr/src/hugr/serialize.rs similarity index 99% rename from src/hugr/serialize.rs rename to quantinuum-hugr/src/hugr/serialize.rs index 3488ecf1b..da6805d9c 100644 --- a/src/hugr/serialize.rs +++ b/quantinuum-hugr/src/hugr/serialize.rs @@ -281,7 +281,7 @@ pub mod test { lazy_static! { static ref SCHEMA: JSONSchema = { let schema_val: serde_json::Value = serde_json::from_str(include_str!( - "../../specification/schema/hugr_schema_v0.json" + "../../../specification/schema/hugr_schema_v0.json" )) .unwrap(); JSONSchema::options() diff --git a/src/hugr/validate.rs b/quantinuum-hugr/src/hugr/validate.rs similarity index 100% rename from src/hugr/validate.rs rename to quantinuum-hugr/src/hugr/validate.rs diff --git a/src/hugr/validate/test.rs b/quantinuum-hugr/src/hugr/validate/test.rs similarity index 100% rename from src/hugr/validate/test.rs rename to quantinuum-hugr/src/hugr/validate/test.rs diff --git a/src/hugr/views.rs b/quantinuum-hugr/src/hugr/views.rs similarity index 100% rename from src/hugr/views.rs rename to quantinuum-hugr/src/hugr/views.rs diff --git a/src/hugr/views/descendants.rs b/quantinuum-hugr/src/hugr/views/descendants.rs similarity index 100% rename from src/hugr/views/descendants.rs rename to quantinuum-hugr/src/hugr/views/descendants.rs diff --git a/src/hugr/views/petgraph.rs b/quantinuum-hugr/src/hugr/views/petgraph.rs similarity index 100% rename from src/hugr/views/petgraph.rs rename to quantinuum-hugr/src/hugr/views/petgraph.rs diff --git a/src/hugr/views/render.rs b/quantinuum-hugr/src/hugr/views/render.rs similarity index 100% rename from src/hugr/views/render.rs rename to quantinuum-hugr/src/hugr/views/render.rs diff --git a/src/hugr/views/root_checked.rs b/quantinuum-hugr/src/hugr/views/root_checked.rs similarity index 100% rename from src/hugr/views/root_checked.rs rename to quantinuum-hugr/src/hugr/views/root_checked.rs diff --git a/src/hugr/views/sibling.rs b/quantinuum-hugr/src/hugr/views/sibling.rs similarity index 100% rename from src/hugr/views/sibling.rs rename to quantinuum-hugr/src/hugr/views/sibling.rs diff --git a/src/hugr/views/sibling_subgraph.rs b/quantinuum-hugr/src/hugr/views/sibling_subgraph.rs similarity index 100% rename from src/hugr/views/sibling_subgraph.rs rename to quantinuum-hugr/src/hugr/views/sibling_subgraph.rs diff --git a/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_cfg.snap b/quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_cfg.snap similarity index 100% rename from src/hugr/views/snapshots/hugr__hugr__views__tests__dot_cfg.snap rename to quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_cfg.snap diff --git a/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_dfg.snap b/quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_dfg.snap similarity index 100% rename from src/hugr/views/snapshots/hugr__hugr__views__tests__dot_dfg.snap rename to quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_dfg.snap diff --git a/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_empty_dfg.snap b/quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_empty_dfg.snap similarity index 100% rename from src/hugr/views/snapshots/hugr__hugr__views__tests__dot_empty_dfg.snap rename to quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__dot_empty_dfg.snap diff --git a/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_cfg.snap b/quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_cfg.snap similarity index 100% rename from src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_cfg.snap rename to quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_cfg.snap diff --git a/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_dfg.snap b/quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_dfg.snap similarity index 100% rename from src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_dfg.snap rename to quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_dfg.snap diff --git a/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_empty_dfg.snap b/quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_empty_dfg.snap similarity index 100% rename from src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_empty_dfg.snap rename to quantinuum-hugr/src/hugr/views/snapshots/hugr__hugr__views__tests__mmd_empty_dfg.snap diff --git a/src/hugr/views/tests.rs b/quantinuum-hugr/src/hugr/views/tests.rs similarity index 100% rename from src/hugr/views/tests.rs rename to quantinuum-hugr/src/hugr/views/tests.rs diff --git a/src/lib.rs b/quantinuum-hugr/src/lib.rs similarity index 99% rename from src/lib.rs rename to quantinuum-hugr/src/lib.rs index 858a3760e..85b7502a7 100644 --- a/src/lib.rs +++ b/quantinuum-hugr/src/lib.rs @@ -135,7 +135,6 @@ //! ``` //! -#![warn(missing_docs)] // Unstable check, may cause false positives. // https://github.com/rust-lang/rust-clippy/issues/5112 #![warn(clippy::debug_assert_with_mut_call)] diff --git a/src/macros.rs b/quantinuum-hugr/src/macros.rs similarity index 100% rename from src/macros.rs rename to quantinuum-hugr/src/macros.rs diff --git a/src/ops.rs b/quantinuum-hugr/src/ops.rs similarity index 100% rename from src/ops.rs rename to quantinuum-hugr/src/ops.rs diff --git a/src/ops/constant.rs b/quantinuum-hugr/src/ops/constant.rs similarity index 100% rename from src/ops/constant.rs rename to quantinuum-hugr/src/ops/constant.rs diff --git a/src/ops/controlflow.rs b/quantinuum-hugr/src/ops/controlflow.rs similarity index 100% rename from src/ops/controlflow.rs rename to quantinuum-hugr/src/ops/controlflow.rs diff --git a/src/ops/custom.rs b/quantinuum-hugr/src/ops/custom.rs similarity index 100% rename from src/ops/custom.rs rename to quantinuum-hugr/src/ops/custom.rs diff --git a/src/ops/dataflow.rs b/quantinuum-hugr/src/ops/dataflow.rs similarity index 100% rename from src/ops/dataflow.rs rename to quantinuum-hugr/src/ops/dataflow.rs diff --git a/src/ops/handle.rs b/quantinuum-hugr/src/ops/handle.rs similarity index 100% rename from src/ops/handle.rs rename to quantinuum-hugr/src/ops/handle.rs diff --git a/src/ops/leaf.rs b/quantinuum-hugr/src/ops/leaf.rs similarity index 100% rename from src/ops/leaf.rs rename to quantinuum-hugr/src/ops/leaf.rs diff --git a/src/ops/module.rs b/quantinuum-hugr/src/ops/module.rs similarity index 100% rename from src/ops/module.rs rename to quantinuum-hugr/src/ops/module.rs diff --git a/src/ops/tag.rs b/quantinuum-hugr/src/ops/tag.rs similarity index 100% rename from src/ops/tag.rs rename to quantinuum-hugr/src/ops/tag.rs diff --git a/src/ops/validate.rs b/quantinuum-hugr/src/ops/validate.rs similarity index 100% rename from src/ops/validate.rs rename to quantinuum-hugr/src/ops/validate.rs diff --git a/src/std_extensions.rs b/quantinuum-hugr/src/std_extensions.rs similarity index 100% rename from src/std_extensions.rs rename to quantinuum-hugr/src/std_extensions.rs diff --git a/src/std_extensions/arithmetic/conversions.rs b/quantinuum-hugr/src/std_extensions/arithmetic/conversions.rs similarity index 100% rename from src/std_extensions/arithmetic/conversions.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/conversions.rs diff --git a/src/std_extensions/arithmetic/conversions/const_fold.rs b/quantinuum-hugr/src/std_extensions/arithmetic/conversions/const_fold.rs similarity index 100% rename from src/std_extensions/arithmetic/conversions/const_fold.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/conversions/const_fold.rs diff --git a/src/std_extensions/arithmetic/float_ops.rs b/quantinuum-hugr/src/std_extensions/arithmetic/float_ops.rs similarity index 100% rename from src/std_extensions/arithmetic/float_ops.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/float_ops.rs diff --git a/src/std_extensions/arithmetic/float_ops/const_fold.rs b/quantinuum-hugr/src/std_extensions/arithmetic/float_ops/const_fold.rs similarity index 100% rename from src/std_extensions/arithmetic/float_ops/const_fold.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/float_ops/const_fold.rs diff --git a/src/std_extensions/arithmetic/float_types.rs b/quantinuum-hugr/src/std_extensions/arithmetic/float_types.rs similarity index 100% rename from src/std_extensions/arithmetic/float_types.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/float_types.rs diff --git a/src/std_extensions/arithmetic/int_ops.rs b/quantinuum-hugr/src/std_extensions/arithmetic/int_ops.rs similarity index 100% rename from src/std_extensions/arithmetic/int_ops.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/int_ops.rs diff --git a/src/std_extensions/arithmetic/int_types.rs b/quantinuum-hugr/src/std_extensions/arithmetic/int_types.rs similarity index 100% rename from src/std_extensions/arithmetic/int_types.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/int_types.rs diff --git a/src/std_extensions/arithmetic/mod.rs b/quantinuum-hugr/src/std_extensions/arithmetic/mod.rs similarity index 100% rename from src/std_extensions/arithmetic/mod.rs rename to quantinuum-hugr/src/std_extensions/arithmetic/mod.rs diff --git a/src/std_extensions/collections.rs b/quantinuum-hugr/src/std_extensions/collections.rs similarity index 100% rename from src/std_extensions/collections.rs rename to quantinuum-hugr/src/std_extensions/collections.rs diff --git a/src/std_extensions/logic.rs b/quantinuum-hugr/src/std_extensions/logic.rs similarity index 100% rename from src/std_extensions/logic.rs rename to quantinuum-hugr/src/std_extensions/logic.rs diff --git a/src/types.rs b/quantinuum-hugr/src/types.rs similarity index 100% rename from src/types.rs rename to quantinuum-hugr/src/types.rs diff --git a/src/types/check.rs b/quantinuum-hugr/src/types/check.rs similarity index 100% rename from src/types/check.rs rename to quantinuum-hugr/src/types/check.rs diff --git a/src/types/custom.rs b/quantinuum-hugr/src/types/custom.rs similarity index 100% rename from src/types/custom.rs rename to quantinuum-hugr/src/types/custom.rs diff --git a/src/types/poly_func.rs b/quantinuum-hugr/src/types/poly_func.rs similarity index 100% rename from src/types/poly_func.rs rename to quantinuum-hugr/src/types/poly_func.rs diff --git a/src/types/serialize.rs b/quantinuum-hugr/src/types/serialize.rs similarity index 100% rename from src/types/serialize.rs rename to quantinuum-hugr/src/types/serialize.rs diff --git a/src/types/signature.rs b/quantinuum-hugr/src/types/signature.rs similarity index 100% rename from src/types/signature.rs rename to quantinuum-hugr/src/types/signature.rs diff --git a/src/types/type_param.rs b/quantinuum-hugr/src/types/type_param.rs similarity index 100% rename from src/types/type_param.rs rename to quantinuum-hugr/src/types/type_param.rs diff --git a/src/types/type_row.rs b/quantinuum-hugr/src/types/type_row.rs similarity index 100% rename from src/types/type_row.rs rename to quantinuum-hugr/src/types/type_row.rs diff --git a/src/utils.rs b/quantinuum-hugr/src/utils.rs similarity index 100% rename from src/utils.rs rename to quantinuum-hugr/src/utils.rs diff --git a/src/values.rs b/quantinuum-hugr/src/values.rs similarity index 100% rename from src/values.rs rename to quantinuum-hugr/src/values.rs diff --git a/release-plz.toml b/release-plz.toml index 0d7dd7e3e..b2c931533 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -1,2 +1,11 @@ [workspace] changelog_config = "cliff.toml" # use a custom git-cliff configuration +# disable the changelog for all packages +changelog_update = false + +[[package]] +name = "quantinuum-hugr" +# enable the changelog for this package +changelog_update = true +# set the path of the changelog to the root of the repository +changelog_path = "./CHANGELOG.md" From 6608d4cc33d93e852dbb1e0dccddd2e9a82163bb Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Wed, 6 Mar 2024 15:56:16 +0000 Subject: [PATCH 2/3] Point to the root's README --- quantinuum-hugr/README.md | 1 + 1 file changed, 1 insertion(+) create mode 120000 quantinuum-hugr/README.md diff --git a/quantinuum-hugr/README.md b/quantinuum-hugr/README.md new file mode 120000 index 000000000..32d46ee88 --- /dev/null +++ b/quantinuum-hugr/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file From a91f463844bcb91db5610665bbe964c6a316c42d Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Wed, 6 Mar 2024 16:02:01 +0000 Subject: [PATCH 3/3] Remove --workspace flag from `llvm-cov report` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 848e5eac6..725dea474 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: cargo llvm-cov --no-report --workspace --no-default-features --doctests cargo llvm-cov --no-report --workspace --all-features --doctests - name: Generate coverage report - run: cargo llvm-cov --all-features --workspace report --codecov --output-path coverage.json + run: cargo llvm-cov --all-features report --codecov --output-path coverage.json - name: Upload coverage to codecov.io uses: codecov/codecov-action@v4 with: