Revert "refactor(api): Move opentrons.initialize() to its own file (#15191)" #15234
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
PR #15191 / commit 1be63cd sneakily broke
hardware-testing
because of a circular import problem.This does a
git revert
on it until we can figure out a proper solution.Test Plan
hardware-testing
works again. It will not run in CI until chore(hardware-testing): Run the hardware testing github actions on more PR's #15233 merges, so we need to run it locally.Review requests
Generalizing from that specific stack trace, the problem seems to be:
opentrons.hardware_control
import some things inopentrons.config
opentrons.config
import some things inopentrons.hardware_control
opentrons.hardware_control
andopentrons.config
have a bunch of__init__.py
re-exports, you can't import anything from either of them without dragging in the whole subtree, and this is what creates the cycleThis looks kind of hairy to solve. I think removing the re-exports is a good practice in general, but that could get intrusive.
I'm open to other ideas. Maybe it's backwards that
opentrons.config
is depending onopentrons.hardware_control
in the first place? Maybe we wantopentrons.config
to be more self-contained, at the cost of duplicating some types withopentrons.hardware_control
?Risk assessment
Low.