-
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
Changes from 2 commits
59932d8
a6a65db
317636e
a81ef47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
config BR2_PACKAGE_PYTHON_OPENTRONS_HARDWARE | ||
bool "python-opentrons-system-server" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hardware server There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed |
||
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 system HTTP server. Provides access to an OT-2 robot. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 |
||
|
||
https://opentrons.com |
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)) | ||
|
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