-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): make opentrons_hardware not required (#9605)
The OT2 doesn't have opentrons_hardware installed - that's only an OT3 thing. We have a responsibility to make that actually function. This setup wasn't actually being tested. This commit adds - New makefile targets to "setup-ot2" in relevant python subprojects by running a pipenv sync and then removing opentrons_hardware from the virtualenv. This is not good, but absent being able to have separate pipfiles it seems like the best fix available. - Github workflow entries to lint and test under these conditions. This is also not good because it will make these tests take longer, but same thing about the conditions. To be truly optional, it must be possible to import opentrons without the ot3 feature flag set and not ever need opentrons_hardware. That was mostly true, but there were some exceptions (default re-exports) that needed to be updated.
- Loading branch information
Showing
15 changed files
with
159 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""rootfile conftest - settings that must be in root.""" | ||
import pytest | ||
|
||
# Options must be added at the root level for pytest to properly | ||
# pick them up. Technically, the main conftest that we use in | ||
# tests/opentrons is not the root level. | ||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--ot2-only", | ||
action="store_true", | ||
help="only run OT2 based tests", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from .controller import Controller | ||
from .simulator import Simulator | ||
from .ot3controller import OT3Controller | ||
from .ot3simulator import OT3Simulator | ||
|
||
__all__ = ["Controller", "Simulator", "OT3Controller", "OT3Simulator", "ot3utils"] | ||
# only expose the ot2 interfaces in __init__ so everything works if opentrons_hardware | ||
# is not present | ||
|
||
__all__ = ["Controller", "Simulator"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api/tests/opentrons/hardware_control/backends/test_ot3_controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.