From b71b6d4d37414ae85055d0fd088c8fbc2072a67b Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 9 Jan 2025 12:44:10 -0500 Subject: [PATCH 1/6] chore: update Cargo.lock --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e3c33e4..ac098c8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1148,7 +1148,7 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quil-cli" -version = "0.6.2-rc.1" +version = "0.6.2" dependencies = [ "anyhow", "clap", @@ -1157,7 +1157,7 @@ dependencies = [ [[package]] name = "quil-py" -version = "0.13.2-rc.1" +version = "0.13.3-rc.0" dependencies = [ "indexmap", "ndarray", @@ -1172,7 +1172,7 @@ dependencies = [ [[package]] name = "quil-rs" -version = "0.29.2-rc.1" +version = "0.29.2" dependencies = [ "approx", "clap", From 79814db897f7089e9c4eedacfb43ee52c16ba0f9 Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 9 Jan 2025 12:49:28 -0500 Subject: [PATCH 2/6] ci: update to `actions/upload-artifact@v4` actions/upload-artifact@v3 is deprecated and was failing --- .github/workflows/bench.yml | 2 +- .github/workflows/publish-quil-py.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index f3b76737..d44b9caf 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -52,7 +52,7 @@ jobs: - name: Archive benchmark results if: ${{ github.ref == 'refs/heads/main'}} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: benchmarks-${{ matrix.os }} path: target/criterion diff --git a/.github/workflows/publish-quil-py.yml b/.github/workflows/publish-quil-py.yml index cd2af01f..ef70e1d3 100644 --- a/.github/workflows/publish-quil-py.yml +++ b/.github/workflows/publish-quil-py.yml @@ -50,7 +50,7 @@ jobs: run: | pip install quil --find-links dist --force-reinstall - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: dist @@ -86,7 +86,7 @@ jobs: run: | pip install quil --find-links dist --force-reinstall - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: dist @@ -124,7 +124,7 @@ jobs: run: | pip install quil --find-links dist --force-reinstall --no-deps - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: wheels path: dist @@ -151,7 +151,7 @@ jobs: command: sdist args: --manifest-path quil-py/Cargo.toml --out dist - name: Upload sdist - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: dist From a755e21bbf02da594d42a62d5f871f30208a9a2e Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 9 Jan 2025 12:59:03 -0500 Subject: [PATCH 3/6] chore: satisfy `cargo clippy` --- Cargo.lock | 101 ++++++------------ quil-py/src/lib.rs | 4 + quil-rs/Cargo.toml | 2 +- quil-rs/src/parser/lexer/wrapped_parsers.rs | 2 +- quil-rs/src/parser/token.rs | 2 +- .../program/analysis/control_flow_graph.rs | 2 +- quil-rs/src/program/scheduling/graph.rs | 4 +- .../src/program/scheduling/graphviz_dot.rs | 6 +- 8 files changed, 46 insertions(+), 77 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac098c8f..abfd1315 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -215,8 +215,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -455,8 +455,8 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -795,8 +795,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1025,15 +1025,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid", -] - [[package]] name = "proc-macro2" version = "1.0.78" @@ -1065,13 +1056,13 @@ dependencies = [ [[package]] name = "proptest-derive" -version = "0.3.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b46295382dc76166cb7cf2bb4a97952464e4b7ed5a43e6cd34e1fec3349ddc" +checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -1121,9 +1112,9 @@ version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7305c720fa01b8055ec95e484a6eca7a83c841267f0dd5280f0c8b8551d2c158" dependencies = [ - "proc-macro2 1.0.78", + "proc-macro2", "pyo3-macros-backend", - "quote 1.0.35", + "quote", "syn 2.0.48", ] @@ -1134,9 +1125,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c7e9b68bb9c3149c5b0cade5d07f953d6d125eb4337723c4ccdb665f1f96185" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.78", + "proc-macro2", "pyo3-build-config", - "quote 1.0.35", + "quote", "syn 2.0.48", ] @@ -1201,22 +1192,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "proc-macro2 1.0.78", + "proc-macro2", ] [[package]] @@ -1386,8 +1368,8 @@ checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" dependencies = [ "cfg-if", "glob", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "regex", "relative-path", "rustc_version", @@ -1492,8 +1474,8 @@ version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1583,31 +1565,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "rustversion", "syn 2.0.48", ] -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid", -] - [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "unicode-ident", ] @@ -1617,8 +1588,8 @@ version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "unicode-ident", ] @@ -1656,8 +1627,8 @@ version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1708,12 +1679,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unindent" version = "0.2.3" @@ -1770,8 +1735,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", "wasm-bindgen-shared", ] @@ -1782,7 +1747,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ - "quote 1.0.35", + "quote", "wasm-bindgen-macro-support", ] @@ -1792,8 +1757,8 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", diff --git a/quil-py/src/lib.rs b/quil-py/src/lib.rs index 91079b74..112ba602 100644 --- a/quil-py/src/lib.rs +++ b/quil-py/src/lib.rs @@ -1,3 +1,7 @@ +// This error is triggered by PyO3 v0.20.3; it's fixed in 0.21, so this attribute can be removed +// when we update PyO3. +#![allow(non_local_definitions)] + use pyo3::prelude::*; use rigetti_pyo3::create_init_submodule; diff --git a/quil-rs/Cargo.toml b/quil-rs/Cargo.toml index 4fbdce81..84dac1a7 100644 --- a/quil-rs/Cargo.toml +++ b/quil-rs/Cargo.toml @@ -34,7 +34,7 @@ insta = "1.37.0" petgraph = "0.6.2" pretty_assertions = "1.4.0" proptest = "1.0.0" -proptest-derive = "0.3.0" +proptest-derive = "0.5.1" rand = "0.8.5" rasciigraph = "0.2.0" rstest = "0.18.2" diff --git a/quil-rs/src/parser/lexer/wrapped_parsers.rs b/quil-rs/src/parser/lexer/wrapped_parsers.rs index d047a63f..0ea59838 100644 --- a/quil-rs/src/parser/lexer/wrapped_parsers.rs +++ b/quil-rs/src/parser/lexer/wrapped_parsers.rs @@ -84,7 +84,7 @@ where /// what tag string was expected. pub(crate) fn tag<'a>( lit: &'static str, -) -> impl FnMut(LexInput<'a>) -> InternalLexResult> { +) -> impl FnMut(LexInput<'a>) -> InternalLexResult<'a, LexInput<'a>> { move |input| { map_err(nom_tag(lit), |err: nom::error::Error>| { InternalLexError::from_kind(err.input, LexErrorKind::ExpectedString(lit)) diff --git a/quil-rs/src/parser/token.rs b/quil-rs/src/parser/token.rs index 6f0b1a9e..53164b57 100644 --- a/quil-rs/src/parser/token.rs +++ b/quil-rs/src/parser/token.rs @@ -48,7 +48,7 @@ impl nom::InputLength for TokenWithLocation<'_> { /// Wraps a parser that returns a [`Token`] and combines it with file location information. pub(crate) fn token_with_location<'i, E, P>( mut parser: P, -) -> impl FnMut(LexInput<'i>) -> LexResult<'i, TokenWithLocation, E> +) -> impl FnMut(LexInput<'i>) -> LexResult<'i, TokenWithLocation<'i>, E> where P: nom::Parser, Token, E>, E: nom::error::ParseError>, diff --git a/quil-rs/src/program/analysis/control_flow_graph.rs b/quil-rs/src/program/analysis/control_flow_graph.rs index 59393fad..78cff6e5 100644 --- a/quil-rs/src/program/analysis/control_flow_graph.rs +++ b/quil-rs/src/program/analysis/control_flow_graph.rs @@ -367,7 +367,7 @@ pub enum BasicBlockTerminatorOwned { Halt, } -impl<'p> From> for BasicBlockTerminatorOwned { +impl From> for BasicBlockTerminatorOwned { fn from(value: BasicBlockTerminator) -> Self { match value { BasicBlockTerminator::ConditionalJump { diff --git a/quil-rs/src/program/scheduling/graph.rs b/quil-rs/src/program/scheduling/graph.rs index 878524a2..a9f78f6e 100644 --- a/quil-rs/src/program/scheduling/graph.rs +++ b/quil-rs/src/program/scheduling/graph.rs @@ -460,7 +460,7 @@ impl<'a> ScheduledBasicBlock<'a> { &self.graph } - pub fn instructions(&'a self) -> &[&'a Instruction] { + pub fn instructions(&'a self) -> &'a [&'a Instruction] { self.basic_block.instructions() } @@ -538,7 +538,7 @@ impl<'a> From<&'a ScheduledBasicBlockOwned> for ScheduledBasicBlock<'a> { } } -impl<'a> From> for ScheduledBasicBlockOwned { +impl From> for ScheduledBasicBlockOwned { fn from(block: ScheduledBasicBlock) -> Self { Self { basic_block: block.basic_block.into(), diff --git a/quil-rs/src/program/scheduling/graphviz_dot.rs b/quil-rs/src/program/scheduling/graphviz_dot.rs index f555b292..d6a82ca8 100644 --- a/quil-rs/src/program/scheduling/graphviz_dot.rs +++ b/quil-rs/src/program/scheduling/graphviz_dot.rs @@ -29,7 +29,7 @@ use crate::{ use super::graph::ScheduledProgram; -impl<'a> ScheduledBasicBlock<'a> { +impl ScheduledBasicBlock<'_> { /// Given a [`dot_writer::Scope`] representing a subgraph/cluster, write the timing graph for this block into it. /// Uses the `node_prefix` argument for namespacing so that node IDs remain unique within the overall graph. fn write_dot_format(&self, cluster: &mut dot_writer::Scope, node_prefix: &str) { @@ -108,7 +108,7 @@ impl<'p> From<&'p Target> for DotFormatBlockLabel<'p> { } } -impl<'p> From for DotFormatBlockLabel<'p> { +impl From for DotFormatBlockLabel<'_> { fn from(index: usize) -> Self { DotFormatBlockLabel::Unlabeled { index } } @@ -123,7 +123,7 @@ impl std::fmt::Display for DotFormatBlockLabel<'_> { } } -impl<'a> ScheduledProgram<'a> { +impl ScheduledProgram<'_> { /// Return a DOT format string (as bytes) for use with Graphviz. /// /// This outputs a `digraph` object with a `subgraph` for each block to inform the layout engine. From 0ac68f2f5a217b2ec4a144d46d5d7e780de2fe31 Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 9 Jan 2025 13:23:59 -0500 Subject: [PATCH 4/6] ci: remove dependency on now-removed Python module `distutils` --- quil-py/Makefile.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quil-py/Makefile.toml b/quil-py/Makefile.toml index 58dc55e7..a6890395 100644 --- a/quil-py/Makefile.toml +++ b/quil-py/Makefile.toml @@ -1,5 +1,5 @@ [env] -PYTHONPATH = { script = [ "python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'" ] } +PYTHONPATH = { script = [ "python -c 'import sysconfig; print(sysconfig.get_path(\"platlib\"))'" ] } RUST_BACKTRACE = 0 [tasks.check-venv] From 573d53718745c1f3244b4179a6d5f3b1335c24f9 Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 9 Jan 2025 16:16:04 -0500 Subject: [PATCH 5/6] feat: add missing `__all__` definitions to `.pyi` files --- quil-py/quil/expression/__init__.pyi | 12 ++++ quil-py/quil/instructions/__init__.pyi | 78 ++++++++++++++++++++++++++ quil-py/quil/program/__init__.pyi | 20 +++++++ quil-py/quil/validation/__init__.pyi | 4 ++ quil-py/quil/validation/identifier.pyi | 6 ++ quil-py/quil/waveforms/__init__.pyi | 9 +++ 6 files changed, 129 insertions(+) diff --git a/quil-py/quil/expression/__init__.pyi b/quil-py/quil/expression/__init__.pyi index 9d1da781..feee22d2 100644 --- a/quil-py/quil/expression/__init__.pyi +++ b/quil-py/quil/expression/__init__.pyi @@ -5,6 +5,18 @@ from typing import Dict, Optional, Sequence, Union, final from quil.instructions import MemoryReference +__all__ = [ + 'Expression', + 'FunctionCallExpression', + 'InfixExpression', + 'PrefixExpression', + 'ExpressionFunction', + 'PrefixOperator', + 'InfixOperator', + 'EvaluationError', + 'ParseExpressionError', +] + class EvaluationError(ValueError): """Error that may occur while evaluation an ``Expression``.""" diff --git a/quil-py/quil/instructions/__init__.pyi b/quil-py/quil/instructions/__init__.pyi index 1af96957..ea0ef834 100644 --- a/quil-py/quil/instructions/__init__.pyi +++ b/quil-py/quil/instructions/__init__.pyi @@ -7,6 +7,84 @@ from typing_extensions import Self from quil.expression import Expression +__all__ = [ + 'Instruction', + 'Arithmetic', + 'ArithmeticOperand', + 'ArithmeticOperator', + 'BinaryLogic', + 'BinaryOperand', + 'BinaryOperator', + 'Call', + 'CallArgument', + 'Comparison', + 'ComparisonOperand', + 'ComparisonOperator', + 'Convert', + 'Exchange', + 'ExternParameter', + 'ExternParameterType', + 'ExternSignature', + 'Move', + 'UnaryLogic', + 'UnaryOperator', + 'Calibration', + 'CalibrationIdentifier', + 'CircuitDefinition', + 'MeasureCalibrationDefinition', + 'MeasureCalibrationIdentifier', + 'Declaration', + 'Load', + 'Offset', + 'Sharing', + 'Store', + 'ScalarType', + 'Vector', + 'Measurement', + 'Include', + 'Pragma', + 'PragmaArgument', + 'AttributeValue', + 'Capture', + 'FrameDefinition', + 'FrameIdentifier', + 'Pulse', + 'RawCapture', + 'SetFrequency', + 'SetPhase', + 'SetScale', + 'ShiftFrequency', + 'ShiftPhase', + 'SwapPhases', + 'Gate', + 'GateDefinition', + 'GateModifier', + 'GateSpecification', + 'PauliGate', + 'PauliTerm', + 'PauliSum', + 'Jump', + 'JumpWhen', + 'JumpUnless', + 'Label', + 'Target', + 'TargetPlaceholder', + 'Measurement', + 'MemoryReference', + 'Qubit', + 'QubitPlaceholder', + 'Reset', + 'Delay', + 'Fence', + 'Waveform', + 'WaveformDefinition', + 'WaveformInvocation', + 'CallError', + 'ExternError', + 'GateError', + 'ParseMemoryReferenceError', +] + @final class Instruction: """A Quil instruction. Each variant corresponds to a possible type of Quil instruction. diff --git a/quil-py/quil/program/__init__.pyi b/quil-py/quil/program/__init__.pyi index 9f6a9d47..d18748f1 100644 --- a/quil-py/quil/program/__init__.pyi +++ b/quil-py/quil/program/__init__.pyi @@ -96,6 +96,26 @@ from quil.instructions import ( Waveform, ) +__all__ = [ + 'FrameSet', + 'Program', + 'CalibrationExpansion', + 'CalibrationExpansionSourceMap', + 'CalibrationExpansionSourceMapEntry', + 'CalibrationSource', + 'MaybeCalibrationExpansion', + 'ProgramCalibrationExpansion', + 'ProgramCalibrationExpansionSourceMap', + 'ProgramCalibrationExpansionSourceMapEntry', + 'CalibrationSet', + 'MemoryRegion', + 'BasicBlock', + 'ControlFlowGraph', + 'ScheduleSeconds', + 'ScheduleSecondsItem', + 'TimeSpanSeconds', +] + @final class Program: @staticmethod diff --git a/quil-py/quil/validation/__init__.pyi b/quil-py/quil/validation/__init__.pyi index bd850da7..b665d4a2 100644 --- a/quil-py/quil/validation/__init__.pyi +++ b/quil-py/quil/validation/__init__.pyi @@ -1 +1,5 @@ from . import identifier as identifier + +__all__ = [ + 'identifier', +] diff --git a/quil-py/quil/validation/identifier.pyi b/quil-py/quil/validation/identifier.pyi index 16950278..b4e1bf32 100644 --- a/quil-py/quil/validation/identifier.pyi +++ b/quil-py/quil/validation/identifier.pyi @@ -1,3 +1,9 @@ +__all__ = [ + 'IdentifierValidationError', + 'validate_identifier', + 'validate_user_identifier', +] + class IdentifierValidationError(ValueError): """Errors that may occur when validating a Quil identifier.""" diff --git a/quil-py/quil/waveforms/__init__.pyi b/quil-py/quil/waveforms/__init__.pyi index 57c0b36f..721a9574 100644 --- a/quil-py/quil/waveforms/__init__.pyi +++ b/quil-py/quil/waveforms/__init__.pyi @@ -1,5 +1,14 @@ from typing import Iterable +__all__ = [ + 'BoxcarKernel', + 'ErfSquare', + 'Gaussian', + 'DragGaussian', + 'HermiteGaussian', + 'apply_phase_and_detuning', +] + def apply_phase_and_detuning(iq_values: Iterable[complex], phase: float, detuning: float, sample_rate: float): """Modulate and phase shift waveform IQ data in place.""" ... From 043bc53841f19a3f3fb307d131236376edf17f1b Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 9 Jan 2025 17:50:56 -0500 Subject: [PATCH 6/6] ci: delete broken `validate-downstream` file --- .github/workflows/validate-downstream.yml | 116 ---------------------- 1 file changed, 116 deletions(-) delete mode 100644 .github/workflows/validate-downstream.yml diff --git a/.github/workflows/validate-downstream.yml b/.github/workflows/validate-downstream.yml deleted file mode 100644 index b0d732bc..00000000 --- a/.github/workflows/validate-downstream.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: Check pyQuil Compatibility -on: - pull_request: - -jobs: - check-pyquil: - name: Check compatibility with pyQuil - runs-on: ubuntu-latest - steps: - - name: Checkout quil-rs Repository - uses: actions/checkout@v4 - with: - path: quil-rs - - - name: Checkout pyQuil Repository - uses: actions/checkout@v4 - with: - repository: "rigetti/pyquil" - path: pyquil - - - name: Install Rust Toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Restore Python Virtual Environment - uses: syphar/restore-virtualenv@v1 - - - name: Setup pyQuil Repository - run: | - pip uninstall -y -r <(pip freeze) || true - pip install "./pyquil[latex]" maturin mypy ruff pytest pytest-mock - maturin develop -m quil-rs/quil-py/Cargo.toml - - - name: Run mypy - id: mypy - continue-on-error: true - working-directory: ./pyquil - run: | - mypy pyquil - - - name: Run ruff - id: ruff - continue-on-error: true - working-directory: ./pyquil - run: | - ruff check pyquil - - - name: Run pytest - id: pytest - continue-on-error: true - working-directory: ./pyquil - run: | - pytest test/unit -x - - - name: Post PR Comment and Fail if Necessary - uses: actions/github-script@v6 - with: - script: | - const mypyFailed = '${{ steps.mypy.outcome }}' === 'failure'; - const ruffFailed = '${{ steps.ruff.outcome }}' === 'failure'; - const pytestFailed = '${{ steps.pytest.outcome }}' === 'failure'; - - const owner = context.repo.owner; - const repo = context.repo.repo; - const issue_number = context.issue.number; - - // Fetch existing comment, if it exists - const identifier = `pyQuil-checks-comment`; - const comments = await github.rest.issues.listComments({ - owner, - repo, - issue_number, - }); - const existingComment = comments.data.find(comment => comment.body.startsWith(``)); - - - async function postOrUpdateComment(body) { - if (existingComment) { - await github.rest.issues.updateComment({ - owner, - repo, - comment_id: existingComment.id, - body - }); - } else { - await github.rest.issues.createComment({ - owner, - repo, - issue_number, - body - }); - } - } - - var body = "" - - if (mypyFailed || ruffFailed || pytestFailed) { - body += `⚠️ **pyQuil Compatibility Checks Failed**:\n\n| Tool | Status |\n-----|-----|\n`; - - if (mypyFailed) { - body += `| mypy | ❌ Failed |\n`; - } - if (ruffFailed) { - body += `| ruff | ❌ Failed |\n`; - } - if (pytestFailed) { - body += `| pytest | ❌ Failed |\n`; - } - body += `\n**Note**: These failures don't necessarily block the PR but both authors and reviewers should check the results for unintentional breaking changes.`; - } else { - body += `✅ **pyQuil Compatibility Checks Passed**. Great job!`; - } - - await postOrUpdateComment(body);