From 59932d8147104383e94bda2d11855a7965bca864 Mon Sep 17 00:00:00 2001 From: Frank Sinapi Date: Wed, 11 Oct 2023 15:22:30 -0400 Subject: [PATCH] Configure opentrons-hardware to be included with OT-2 packages * Make "python-can" an optional dependency for "opentrons_hardware" * Add "CAN" as an extra dependency for opentrons-hardware from the base opentrons pipfile * All "setup-ot2" targets just move python-can instead of the entire hardware package --- api/Makefile | 2 +- api/Pipfile | 2 +- api/setup.py | 1 + hardware/setup.py | 6 +++++- notify-server/Makefile | 2 +- robot-server/Makefile | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/api/Makefile b/api/Makefile index 770a5026743..adff7704fd9 100755 --- a/api/Makefile +++ b/api/Makefile @@ -79,7 +79,7 @@ setup: .PHONY: setup-ot2 setup-ot2: $(pipenv) sync $(pipenv_opts) - $(pipenv) run pip uninstall -y opentrons_hardware + $(pipenv) run pip uninstall -y python-can $(pipenv) run pip freeze .PHONY: clean diff --git a/api/Pipfile b/api/Pipfile index 6f18398fd2d..3b742d4e7b9 100755 --- a/api/Pipfile +++ b/api/Pipfile @@ -36,7 +36,7 @@ types-mock = "==4.0.1" types-setuptools = "==57.0.2" opentrons-shared-data = { editable = true, path = "../shared-data/python" } opentrons = { editable = true, path = "." } -opentrons-hardware = { editable = true, path = "./../hardware" } +opentrons-hardware = { editable = true, path = "./../hardware", extras= ["CAN"] } # specify typing-extensions explicitly to force lockfile inclusion on Python >= 3.8 typing-extensions = ">=4.0.0,<5" pytest-profiling = "~=1.7.0" diff --git a/api/setup.py b/api/setup.py index ec02586992e..e95d36ece8a 100755 --- a/api/setup.py +++ b/api/setup.py @@ -60,6 +60,7 @@ def get_version(): PACKAGES = find_packages(where="src") INSTALL_REQUIRES = [ f"opentrons-shared-data=={VERSION}", + f"opentrons-hardware=={VERSION}", "aionotify==0.2.0", "anyio==3.3.0", "jsonschema==3.0.2", diff --git a/hardware/setup.py b/hardware/setup.py index 8dbb43965a3..59526d0aee9 100644 --- a/hardware/setup.py +++ b/hardware/setup.py @@ -47,11 +47,14 @@ def get_version() -> str: DESCRIPTION = "Hardware control for Opentrons Robots." PACKAGES = find_packages(where=".", exclude=["tests.*", "tests"]) INSTALL_REQUIRES = [ - "python-can==3.3.4", "pyserial==3.5", f"opentrons_shared_data=={VERSION}", ] +EXTRAS = { + "CAN": ["python-can==3.3.4"], +} + def read(*parts: str) -> str: """Build an absolute path from parts and return the contents of the resulting file. @@ -80,6 +83,7 @@ def read(*parts: str) -> str: zip_safe=False, classifiers=CLASSIFIERS, install_requires=INSTALL_REQUIRES, + extras_require=EXTRAS, include_package_data=True, package_data={ "opentrons_hardware": ["py.typed", "opentrons_hardware.cmakefind"] diff --git a/notify-server/Makefile b/notify-server/Makefile index 30e79a994a8..6588592fb96 100755 --- a/notify-server/Makefile +++ b/notify-server/Makefile @@ -68,7 +68,7 @@ setup: .PHONY: setup-ot2 setup-ot2: $(pipenv) sync $(pipenv_opts) - $(pipenv) run pip uninstall -y opentrons_hardware + $(pipenv) run pip uninstall -y python-can $(pipenv) run pip freeze .PHONY: clean diff --git a/robot-server/Makefile b/robot-server/Makefile index c91b4176280..dacf7f1638c 100755 --- a/robot-server/Makefile +++ b/robot-server/Makefile @@ -82,7 +82,7 @@ setup: .PHONY: setup-ot2 setup-ot2: $(pipenv) sync $(pipenv_opts) - $(pipenv) run pip uninstall -y opentrons_hardware + $(pipenv) run pip uninstall -y python-can $(pipenv) run pip freeze .PHONY: clean