Skip to content

Commit

Permalink
Configure opentrons-hardware to be included with OT-2 packages
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fsinapi committed Oct 11, 2023
1 parent e30c1b5 commit 59932d8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion hardware/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion notify-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion robot-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59932d8

Please sign in to comment.