Skip to content

Update cirq_rigetti to conform to the new mypy standard #6661

Closed
@NoureldinYosri

Description

Description of the issue
recently mypy released a new version which broke the CI for cirq_regetti ... as a temperary solution we turned off type checks for cirq_regetti #6662

the CI failure is

cirq-rigetti/cirq_rigetti/quil_input.py:18: error: Cannot find implementation or library stub for module named "pyquil.parser"  [import]
cirq-rigetti/cirq_rigetti/quil_input.py:18: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
cirq-rigetti/cirq_rigetti/quil_input.py:258: error: Item "int" of "Union[Qubit, QubitPlaceholder, FormalArgument, int]" has no attribute "index"  [union-attr]
cirq-rigetti/cirq_rigetti/quil_input.py:269: error: Item "int" of "Union[Qubit, QubitPlaceholder, FormalArgument, int]" has no attribute "index"  [union-attr]
cirq-rigetti/cirq_rigetti/conftest.py:44: error: Missing return statement  [empty-body]
cirq-rigetti/cirq_rigetti/conftest.py:44: note: If the method is meant to be abstract, use @abc.abstractmethod
cirq-rigetti/cirq_rigetti/conftest.py:44: error: Signature of "execute" incompatible with supertype "QAM"  [override]
cirq-rigetti/cirq_rigetti/conftest.py:44: note:      Superclass:
cirq-rigetti/cirq_rigetti/conftest.py:44: note:          def execute(self, executable: Union[EncryptedProgram, Program], memory_map: Optional[Mapping[str, Union[Sequence[int], Sequence[float]]]] = ..., **kwargs: Any) -> Any
cirq-rigetti/cirq_rigetti/conftest.py:44: note:      Subclass:
cirq-rigetti/cirq_rigetti/conftest.py:44: note:          def execute(self, executable: Union[EncryptedProgram, Program]) -> T
cirq-rigetti/cirq_rigetti/conftest.py:47: error: Signature of "run" incompatible with supertype "QAM"  [override]
cirq-rigetti/cirq_rigetti/conftest.py:47: note:      Superclass:
cirq-rigetti/cirq_rigetti/conftest.py:47: note:          def run(self, executable: Union[EncryptedProgram, Program], memory_map: Optional[Mapping[str, Union[Sequence[int], Sequence[float]]]] = ..., **kwargs: Any) -> QAMExecutionResult
cirq-rigetti/cirq_rigetti/conftest.py:47: note:      Subclass:
cirq-rigetti/cirq_rigetti/conftest.py:47: note:          def run(self, program: Union[EncryptedProgram, Program]) -> QAMExecutionResult
cirq-rigetti/cirq_rigetti/conftest.py:58: error: Signature of "native_quil_to_executable" incompatible with supertype "AbstractCompiler"  [override]
cirq-rigetti/cirq_rigetti/conftest.py:58: note:      Superclass:
cirq-rigetti/cirq_rigetti/conftest.py:58: note:          def native_quil_to_executable(self, nq_program: Program, **kwargs: Any) -> Union[EncryptedProgram, Program]
cirq-rigetti/cirq_rigetti/conftest.py:58: note:      Subclass:
cirq-rigetti/cirq_rigetti/conftest.py:58: note:          def native_quil_to_executable(self, nq_program: Program) -> Union[EncryptedProgram, Program]
cirq-rigetti/cirq_rigetti/conftest.py:64: error: Cannot instantiate abstract class "MockQAM" with abstract attribute "execute_with_memory_map_batch"  [abstract]
cirq-rigetti/cirq_rigetti/conftest.py:82: error: Cannot instantiate abstract class "MockCompiler" with abstract attribute "reset"  [abstract]
cirq-rigetti/cirq_rigetti/aspen_device.py:74: error: Argument "isa" to "QCSQuantumProcessor" has incompatible type "qcs_api_client.models.instruction_set_architecture.InstructionSetArchitecture"; expected "qcs_sdk.qpu.isa.InstructionSetArchitecture"  [arg-type]
cirq-rigetti/cirq_rigetti/circuit_sweep_executors.py:65: error: Item "EncryptedProgram" of "Union[EncryptedProgram, Program]" has no attribute "write_memory"  [union-attr]
cirq-rigetti/cirq_rigetti/circuit_sweep_executors.py:65: error: Item "Program" of "Union[EncryptedProgram, Program]" has no attribute "write_memory"  [union-attr]
cirq-rigetti/cirq_rigetti/circuit_sweep_executors.py:125: error: "Program" has no attribute "_instructions"; maybe "instructions", "_add_instruction", or "filter_instructions"?  [attr-defined]
cirq-rigetti/cirq_rigetti/circuit_sweep_executors.py:126: error: "Program" has no attribute "_synthesized_instructions"  [attr-defined]
Found 14 errors in 4 files (checked 1163 source files)

Metadata

Labels

kind/healthFor CI/testing/release process/refactoring/technical debt itemstriage/acceptedA consensus emerged that this bug report, feature request, or other action should be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions