Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api): Remove opentrons_hardware from ot3api (#14328)
* refactor(api): make ot3api always importable While OT3API is only used to control hardware on a flex (where the opentrons_hardware package is always available), it can also be used to simulate both in the context of the robot or desktop app (similar) and on installs from pypi, where opentrons_hardware is _not_ available because it is not intended to work on any platform other than linux. We can fix this by making sure that opentrons_hardware doesn't need to be imported in any protocol simulation path, by making sure that any imports from opentrons_hardware happen from (eventually) ot3controller, and ot3controller is conditionally imported when you try and build a hardware-controlling OT3API. That is generally pretty easy but it requires some refactors. For instance, - Planning moves needs to happen inside ot3controller - The backend needs to be the owner of the status bar controller and the estop controller and offer passthrough methods to the API These shouldn't change any functionality. Finally, to make sure this doesn't happen again, add a test to try and import and build a simulating OT3API in the no-hardware case. * refactor(api): type ot3 hardware control tests Next step in gradual typing! And fix up the changes required from the backend refactor while we're at it. Closes RSS-402
- Loading branch information