-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(hardware): add opentrons hardware package to ot 2 build #13770
Merged
fsinapi
merged 4 commits into
edge
from
RET-1380-Add-opentrons_hardware-package-to-OT-2-build
Oct 19, 2023
+67
−6
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
59932d8
Configure opentrons-hardware to be included with OT-2 packages
fsinapi a6a65db
add opentrons_hardware to buildroot config files
fsinapi 317636e
Updated some typos in hardware/Config.in per Brayan's review
fsinapi a81ef47
Updates from Seth's review
fsinapi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,17 @@ | ||
config BR2_PACKAGE_PYTHON_OPENTRONS_HARDWARE | ||
bool "python-opentrons-hardware" | ||
depends on BR2_PACKAGE_PYTHON3 | ||
select BR2_PACKAGE_PYTHON_AIONOTIFY # runtime | ||
select BR2_PACKAGE_PYTHON_ANYIO # runtime | ||
select BR2_PACKAGE_PYTHON_JSONSCHEMA # runtime | ||
select BR2_PACKAGE_PYTHON_NUMPY # runtime | ||
select BR2_PACKAGE_PYTHON_PYDANTIC # runtime | ||
select BR2_PACKAGE_PYTHON_SERIAL # runtime | ||
select BR2_PACKAGE_PYTHON_SYSTEMD # runtime | ||
select BR2_PACKAGE_PYTHON_TYPING_EXTENSIONS # runtime | ||
select BR2_PACKAGE_PYTHON_CLICK # runtime | ||
|
||
help | ||
Opentrons hardware package. Provides an interface for OT-2 and Flex control. | ||
|
||
https://opentrons.com |
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,32 @@ | ||
################################################################################ | ||
# | ||
# python-opentrons-hardware | ||
# | ||
################################################################################ | ||
|
||
define OTHARDWARE_CALL_PBU | ||
$(shell python $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/scripts/python_build_utils.py hardware $(or $(OPENTRONS_PROJECT),robot-stack) $(1)) | ||
endef | ||
|
||
PYTHON_OPENTRONS_HARDWARE_VERSION = $(call OTHARDWARE_CALL_PBU,get_version) | ||
PYTHON_OPENTRONS_HARDWARE_LICENSE = Apache-2 | ||
PYTHON_OPENTRONS_HARDWARE_LICENSE_FILES = $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH)/LICENSE | ||
PYTHON_OPENTRONS_HARDWARE_SETUP_TYPE = setuptools | ||
PYTHON_OPENTRONS_HARDWARE_SITE_METHOD = local | ||
PYTHON_OPENTRONS_HARDWARE_SITE = $(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH) | ||
PYTHON_OPENTRONS_HARDWARE_SUBDIR = hardware | ||
PYTHON_OPENTRONS_HARDWARE_POST_INSTALL_TARGET_HOOKS = PYTHON_OPENTRONS_HARDWARE_INSTALL_VERSION | ||
|
||
define PYTHON_OPENTRONS_HARDWARE_INSTALL_VERSION | ||
echo '$(call OTHARDWARE_CALL_PBU,dump_br_version)' > $(BINARIES_DIR)/opentrons-hardware-version.json | ||
endef | ||
|
||
ot_hardware_name := python-opentrons-hardware | ||
|
||
export OPENTRONS_GIT_DIR=$(BR2_EXTERNAL_OPENTRONS_MONOREPO_PATH) | ||
|
||
# Calling inner-python-package directly instead of using python-package macro | ||
# because our directory layout doesn’t conform to buildroot’s expectation of | ||
# having the directory name be the package name | ||
$(eval $(call inner-python-package,$(ot_hardware_name),$(call UPPERCASE,$(ot_hardware_name)),$(call UPPERCASE,$(ot_hardware_name)),target)) | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we see if we can make the extras thing transitive? like, add an extra to
api
that is'flex-hardware'
that requiresopentrons_hardware["CAN"]
, an extra that isot2-hardware
that requiresopentrons_hardware
(maybe eventuallyopentrons_hardware["SERIAL"]
or whatever). Then the pipfile for api installsopentrons["flex-hardware"]
.The reason for this is that ideally we don't require hardware support for default in the api server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep this worked pretty nicely. Tested running all of the following and they seem to filter the packages correctly:
pipenv run pip install .
--> no hardware packagepipenv run pip install ".[ot2-hardware]"
--> opentrons_hardware without python-canpipenv run pip install ".[flex-hardware]"
--> opentrons_hardware with python_can