From 1bc3e2ff85ee4f41ba6aca44fce6791977acb78b Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Wed, 10 Oct 2018 17:30:59 -0400 Subject: [PATCH] build(api): Add shared-data to wheel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And do it in a way that doesn’t require copying it into the source tree. By overriding the build_py subcommand of distutils, which is a core element of basically all the following distutils commands like sdist or install or (most crucially) bdist_wheel, we can insert our shared-data into the build directory which means it will be present in all the following artifacts. Closes #2452 --- api/.coveragerc | 15 ++- api/MANIFEST.in | 11 +- api/Makefile | 32 ++++-- api/README.rst | 7 ++ api/codecov.yml | 2 + api/pylama.ini | 16 +-- api/pytest.ini | 2 + api/setup.py | 105 +++++++++++++----- api/{ => src}/opentrons/CHANGELOG.md | 0 api/{ => src}/opentrons/__init__.py | 0 api/{ => src}/opentrons/api/__init__.py | 0 api/{ => src}/opentrons/api/calibration.py | 0 api/{ => src}/opentrons/api/models.py | 0 api/{ => src}/opentrons/api/routers.py | 0 api/{ => src}/opentrons/api/session.py | 0 api/{ => src}/opentrons/broker/__init__.py | 0 api/{ => src}/opentrons/broker/broker.py | 0 api/{ => src}/opentrons/broker/topics.py | 0 api/{ => src}/opentrons/cli/__init__.py | 0 api/{ => src}/opentrons/commands/__init__.py | 0 api/{ => src}/opentrons/commands/commands.py | 0 api/{ => src}/opentrons/commands/tree.py | 0 api/{ => src}/opentrons/commands/types.py | 0 api/{ => src}/opentrons/config/__init__.py | 1 + .../opentrons/config/advanced_settings.py | 0 .../opentrons/config/containers/__init__.py | 0 .../config/containers/default-containers.json | 0 .../opentrons/config/feature_flags.py | 0 .../config/modules/95-opentrons-modules.rules | 0 .../opentrons/config/modules/avrdude.conf | 0 .../config/smoothie/config_one_pro_plus | 0 .../config/smoothie/smoothie-defaults.ini | 0 .../opentrons/data_storage/__init__.py | 0 .../opentrons/data_storage/database.py | 0 .../data_storage/database_migration.py | 0 .../data_storage/database_queries.py | 0 .../data_storage/labware_definitions.py | 0 .../data_storage/old_container_loading.py | 0 .../opentrons/data_storage/schema_changes.py | 0 .../opentrons/data_storage/serializers.py | 0 .../opentrons/deck_calibration/__init__.py | 0 .../opentrons/deck_calibration/dc_main.py | 0 .../opentrons/deck_calibration/endpoints.py | 0 .../opentrons/deck_calibration/linal.py | 0 api/{ => src}/opentrons/drivers/__init__.py | 0 api/{ => src}/opentrons/drivers/connection.py | 0 .../opentrons/drivers/mag_deck/__init__.py | 0 .../opentrons/drivers/mag_deck/driver.py | 0 .../opentrons/drivers/rpi_drivers/__init__.py | 0 .../opentrons/drivers/rpi_drivers/gpio.py | 0 .../opentrons/drivers/serial_communication.py | 0 .../drivers/smoothie_drivers/__init__.py | 0 .../drivers/smoothie_drivers/driver_3_0.py | 0 .../opentrons/drivers/temp_deck/__init__.py | 0 .../opentrons/drivers/temp_deck/driver.py | 0 .../opentrons/hardware_control/__init__.py | 0 .../opentrons/hardware_control/controller.py | 0 .../hardware_control/modules/__init__.py | 0 .../hardware_control/modules/magdeck.py | 0 .../hardware_control/modules/mod_abc.py | 0 .../hardware_control/modules/tempdeck.py | 0 .../hardware_control/modules/update.py | 0 .../opentrons/hardware_control/simulator.py | 0 api/{ => src}/opentrons/helpers/__init__.py | 0 api/{ => src}/opentrons/helpers/helpers.py | 0 .../opentrons/legacy_api/__init__.py | 0 api/{ => src}/opentrons/legacy_api/api.py | 0 .../legacy_api/containers/__init__.py | 0 .../legacy_api/containers/placeable.py | 0 .../legacy_api/instruments/__init__.py | 0 .../legacy_api/instruments/instrument.py | 0 .../legacy_api/instruments/pipette.py | 0 .../legacy_api/instruments/pipette_config.py | 3 +- .../opentrons/legacy_api/modules/__init__.py | 0 .../opentrons/legacy_api/modules/magdeck.py | 0 .../opentrons/legacy_api/modules/tempdeck.py | 0 .../opentrons/legacy_api/robot/__init__.py | 0 .../opentrons/legacy_api/robot/mover.py | 0 .../opentrons/legacy_api/robot/robot.py | 0 .../legacy_api/robot/robot_configs.py | 0 api/{ => src}/opentrons/main.py | 0 api/{ => src}/opentrons/package.json | 0 .../opentrons/protocol_api/__init__.py | 0 .../opentrons/protocol_api/back_compat.py | 0 .../opentrons/protocol_api/labware.py | 0 api/{ => src}/opentrons/protocols/__init__.py | 0 api/{ => src}/opentrons/resources/api.service | 0 api/{ => src}/opentrons/resources/inetd.conf | 0 .../jupyter/jupyter_notebook_config.py | 0 api/{ => src}/opentrons/resources/nginx.conf | 0 .../opentrons/resources/ot-environ.sh | 0 .../resources/scripts/announce_mdns.py | 0 .../opentrons/resources/scripts/calibrate | 0 .../opentrons/resources/scripts/lpc21isp | Bin .../opentrons/resources/scripts/miniterm | 0 .../opentrons/resources/scripts/mount_usb.py | 0 .../resources/scripts/pipette_memory | 0 .../resources/scripts/provision-api-resources | 0 .../opentrons/resources/scripts/setup.sh | 0 .../opentrons/resources/scripts/setup_gpio.py | 0 .../opentrons/resources/scripts/start.sh | 0 .../resources/scripts/switches_lights | 0 .../resources/smoothie-edge-6168d32.hex | 0 api/{ => src}/opentrons/server/__init__.py | 0 .../opentrons/server/endpoints/__init__.py | 0 .../opentrons/server/endpoints/control.py | 0 .../server/endpoints/serverlib_fallback.py | 0 .../opentrons/server/endpoints/settings.py | 0 .../opentrons/server/endpoints/update.py | 0 .../opentrons/server/endpoints/wifi.py | 0 api/{ => src}/opentrons/server/http.py | 0 api/{ => src}/opentrons/server/main.py | 0 api/{ => src}/opentrons/server/rpc.py | 0 api/{ => src}/opentrons/server/serialize.py | 0 api/{ => src}/opentrons/simulate_protocol.py | 0 api/{ => src}/opentrons/system/__init__.py | 0 api/{ => src}/opentrons/system/nmcli.py | 0 api/{ => src}/opentrons/system/resin.py | 0 api/{ => src}/opentrons/system/udev.py | 0 api/{ => src}/opentrons/tools/__init__.py | 0 api/{ => src}/opentrons/tools/factory_test.py | 0 api/{ => src}/opentrons/tools/gantry_test.py | 0 .../opentrons/tools/overnight_test.py | 0 .../opentrons/tools/write_pipette_memory.py | 0 api/{ => src}/opentrons/tools/z_stage_test.py | 0 api/{ => src}/opentrons/trackers/__init__.py | 0 api/{ => src}/opentrons/trackers/move_msgs.py | 0 .../opentrons/trackers/pose_tracker.py | 0 api/{ => src}/opentrons/types.py | 0 api/{ => src}/opentrons/util/__init__.py | 0 .../opentrons/util/calibration_functions.py | 0 api/{ => src}/opentrons/util/environment.py | 0 api/{ => src}/opentrons/util/vector.py | 0 133 files changed, 129 insertions(+), 65 deletions(-) create mode 100644 api/codecov.yml create mode 100644 api/pytest.ini rename api/{ => src}/opentrons/CHANGELOG.md (100%) rename api/{ => src}/opentrons/__init__.py (100%) rename api/{ => src}/opentrons/api/__init__.py (100%) rename api/{ => src}/opentrons/api/calibration.py (100%) rename api/{ => src}/opentrons/api/models.py (100%) rename api/{ => src}/opentrons/api/routers.py (100%) rename api/{ => src}/opentrons/api/session.py (100%) rename api/{ => src}/opentrons/broker/__init__.py (100%) rename api/{ => src}/opentrons/broker/broker.py (100%) rename api/{ => src}/opentrons/broker/topics.py (100%) rename api/{ => src}/opentrons/cli/__init__.py (100%) rename api/{ => src}/opentrons/commands/__init__.py (100%) rename api/{ => src}/opentrons/commands/commands.py (100%) rename api/{ => src}/opentrons/commands/tree.py (100%) rename api/{ => src}/opentrons/commands/types.py (100%) rename api/{ => src}/opentrons/config/__init__.py (99%) rename api/{ => src}/opentrons/config/advanced_settings.py (100%) rename api/{ => src}/opentrons/config/containers/__init__.py (100%) rename api/{ => src}/opentrons/config/containers/default-containers.json (100%) rename api/{ => src}/opentrons/config/feature_flags.py (100%) rename api/{ => src}/opentrons/config/modules/95-opentrons-modules.rules (100%) rename api/{ => src}/opentrons/config/modules/avrdude.conf (100%) rename api/{ => src}/opentrons/config/smoothie/config_one_pro_plus (100%) rename api/{ => src}/opentrons/config/smoothie/smoothie-defaults.ini (100%) rename api/{ => src}/opentrons/data_storage/__init__.py (100%) rename api/{ => src}/opentrons/data_storage/database.py (100%) rename api/{ => src}/opentrons/data_storage/database_migration.py (100%) rename api/{ => src}/opentrons/data_storage/database_queries.py (100%) rename api/{ => src}/opentrons/data_storage/labware_definitions.py (100%) rename api/{ => src}/opentrons/data_storage/old_container_loading.py (100%) rename api/{ => src}/opentrons/data_storage/schema_changes.py (100%) rename api/{ => src}/opentrons/data_storage/serializers.py (100%) rename api/{ => src}/opentrons/deck_calibration/__init__.py (100%) rename api/{ => src}/opentrons/deck_calibration/dc_main.py (100%) rename api/{ => src}/opentrons/deck_calibration/endpoints.py (100%) rename api/{ => src}/opentrons/deck_calibration/linal.py (100%) rename api/{ => src}/opentrons/drivers/__init__.py (100%) rename api/{ => src}/opentrons/drivers/connection.py (100%) rename api/{ => src}/opentrons/drivers/mag_deck/__init__.py (100%) rename api/{ => src}/opentrons/drivers/mag_deck/driver.py (100%) rename api/{ => src}/opentrons/drivers/rpi_drivers/__init__.py (100%) rename api/{ => src}/opentrons/drivers/rpi_drivers/gpio.py (100%) rename api/{ => src}/opentrons/drivers/serial_communication.py (100%) rename api/{ => src}/opentrons/drivers/smoothie_drivers/__init__.py (100%) rename api/{ => src}/opentrons/drivers/smoothie_drivers/driver_3_0.py (100%) rename api/{ => src}/opentrons/drivers/temp_deck/__init__.py (100%) rename api/{ => src}/opentrons/drivers/temp_deck/driver.py (100%) rename api/{ => src}/opentrons/hardware_control/__init__.py (100%) rename api/{ => src}/opentrons/hardware_control/controller.py (100%) rename api/{ => src}/opentrons/hardware_control/modules/__init__.py (100%) rename api/{ => src}/opentrons/hardware_control/modules/magdeck.py (100%) rename api/{ => src}/opentrons/hardware_control/modules/mod_abc.py (100%) rename api/{ => src}/opentrons/hardware_control/modules/tempdeck.py (100%) rename api/{ => src}/opentrons/hardware_control/modules/update.py (100%) rename api/{ => src}/opentrons/hardware_control/simulator.py (100%) rename api/{ => src}/opentrons/helpers/__init__.py (100%) rename api/{ => src}/opentrons/helpers/helpers.py (100%) rename api/{ => src}/opentrons/legacy_api/__init__.py (100%) rename api/{ => src}/opentrons/legacy_api/api.py (100%) rename api/{ => src}/opentrons/legacy_api/containers/__init__.py (100%) rename api/{ => src}/opentrons/legacy_api/containers/placeable.py (100%) rename api/{ => src}/opentrons/legacy_api/instruments/__init__.py (100%) rename api/{ => src}/opentrons/legacy_api/instruments/instrument.py (100%) rename api/{ => src}/opentrons/legacy_api/instruments/pipette.py (100%) rename api/{ => src}/opentrons/legacy_api/instruments/pipette_config.py (97%) rename api/{ => src}/opentrons/legacy_api/modules/__init__.py (100%) rename api/{ => src}/opentrons/legacy_api/modules/magdeck.py (100%) rename api/{ => src}/opentrons/legacy_api/modules/tempdeck.py (100%) rename api/{ => src}/opentrons/legacy_api/robot/__init__.py (100%) rename api/{ => src}/opentrons/legacy_api/robot/mover.py (100%) rename api/{ => src}/opentrons/legacy_api/robot/robot.py (100%) rename api/{ => src}/opentrons/legacy_api/robot/robot_configs.py (100%) rename api/{ => src}/opentrons/main.py (100%) rename api/{ => src}/opentrons/package.json (100%) rename api/{ => src}/opentrons/protocol_api/__init__.py (100%) rename api/{ => src}/opentrons/protocol_api/back_compat.py (100%) rename api/{ => src}/opentrons/protocol_api/labware.py (100%) rename api/{ => src}/opentrons/protocols/__init__.py (100%) rename api/{ => src}/opentrons/resources/api.service (100%) rename api/{ => src}/opentrons/resources/inetd.conf (100%) rename api/{ => src}/opentrons/resources/jupyter/jupyter_notebook_config.py (100%) rename api/{ => src}/opentrons/resources/nginx.conf (100%) rename api/{ => src}/opentrons/resources/ot-environ.sh (100%) rename api/{ => src}/opentrons/resources/scripts/announce_mdns.py (100%) rename api/{ => src}/opentrons/resources/scripts/calibrate (100%) rename api/{ => src}/opentrons/resources/scripts/lpc21isp (100%) rename api/{ => src}/opentrons/resources/scripts/miniterm (100%) rename api/{ => src}/opentrons/resources/scripts/mount_usb.py (100%) rename api/{ => src}/opentrons/resources/scripts/pipette_memory (100%) rename api/{ => src}/opentrons/resources/scripts/provision-api-resources (100%) rename api/{ => src}/opentrons/resources/scripts/setup.sh (100%) rename api/{ => src}/opentrons/resources/scripts/setup_gpio.py (100%) rename api/{ => src}/opentrons/resources/scripts/start.sh (100%) rename api/{ => src}/opentrons/resources/scripts/switches_lights (100%) rename api/{ => src}/opentrons/resources/smoothie-edge-6168d32.hex (100%) rename api/{ => src}/opentrons/server/__init__.py (100%) rename api/{ => src}/opentrons/server/endpoints/__init__.py (100%) rename api/{ => src}/opentrons/server/endpoints/control.py (100%) rename api/{ => src}/opentrons/server/endpoints/serverlib_fallback.py (100%) rename api/{ => src}/opentrons/server/endpoints/settings.py (100%) rename api/{ => src}/opentrons/server/endpoints/update.py (100%) rename api/{ => src}/opentrons/server/endpoints/wifi.py (100%) rename api/{ => src}/opentrons/server/http.py (100%) rename api/{ => src}/opentrons/server/main.py (100%) rename api/{ => src}/opentrons/server/rpc.py (100%) rename api/{ => src}/opentrons/server/serialize.py (100%) rename api/{ => src}/opentrons/simulate_protocol.py (100%) rename api/{ => src}/opentrons/system/__init__.py (100%) rename api/{ => src}/opentrons/system/nmcli.py (100%) rename api/{ => src}/opentrons/system/resin.py (100%) rename api/{ => src}/opentrons/system/udev.py (100%) rename api/{ => src}/opentrons/tools/__init__.py (100%) rename api/{ => src}/opentrons/tools/factory_test.py (100%) rename api/{ => src}/opentrons/tools/gantry_test.py (100%) rename api/{ => src}/opentrons/tools/overnight_test.py (100%) rename api/{ => src}/opentrons/tools/write_pipette_memory.py (100%) rename api/{ => src}/opentrons/tools/z_stage_test.py (100%) rename api/{ => src}/opentrons/trackers/__init__.py (100%) rename api/{ => src}/opentrons/trackers/move_msgs.py (100%) rename api/{ => src}/opentrons/trackers/pose_tracker.py (100%) rename api/{ => src}/opentrons/types.py (100%) rename api/{ => src}/opentrons/util/__init__.py (100%) rename api/{ => src}/opentrons/util/calibration_functions.py (100%) rename api/{ => src}/opentrons/util/environment.py (100%) rename api/{ => src}/opentrons/util/vector.py (100%) diff --git a/api/.coveragerc b/api/.coveragerc index d1ba6fee10a..26eb11eb3ed 100644 --- a/api/.coveragerc +++ b/api/.coveragerc @@ -1,9 +1,8 @@ [run] -omit = - */python?.?/* - */lib-python/?.?/*.py - */lib_pypy/_*.py - */site-packages/ordereddict.py - */site-packages/nose/* - */tests/* - opentrons/_version.py +include = + */site-packages/opentrons/* + +[paths] +source = + src/opentrons + */site-packages/opentrons diff --git a/api/MANIFEST.in b/api/MANIFEST.in index 0f7e297d524..e1532006c27 100755 --- a/api/MANIFEST.in +++ b/api/MANIFEST.in @@ -1,8 +1,3 @@ -include opentrons/package.json -include opentrons/config/containers/default-containers.json -include opentrons/config/smoothie/smoothie-defaults.ini -include opentrons/config/smoothie/config_one_pro_plus -include opentrons/config/modules/avrdude.conf -include opentrons/config/modules/95-opentrons-modules.rules -include opentrons/config/pipette-config.json -recursive-include opentrons/resources * +include src/opentrons/package.json +graft src/opentrons/config +graft src/opentrons/resources diff --git a/api/Makefile b/api/Makefile index 55ce6a6a3d8..f52dff6d594 100755 --- a/api/Makefile +++ b/api/Makefile @@ -11,13 +11,21 @@ firmware = $(wildcard smoothie/*.hex) # python and pipenv config python := pipenv run python +pip := pipenv run pip +pytest := pipenv run py.test pipenv_opts := --dev pipenv_opts += $(and $(CI),--ignore-pipfile) +tests ?= tests +test_opts ?= + .PHONY: install install: pipenv install $(pipenv_opts) +.PHONY: all +all: lint test + .PHONY: clean clean: shx rm -rf \ @@ -30,17 +38,13 @@ clean: '**/*.pyc' .PHONY: test -test: - $(python) -m pytest \ - --cov=opentrons \ - --cov-report term-missing:skip-covered \ - --cov-report xml:coverage.xml \ - tests +test: local-install + ${pytest} ${tests} ${test_opts} .PHONY: lint lint: - $(python) -m mypy opentrons - $(python) -m pylama opentrons tests + $(python) -m mypy src/opentrons + $(python) -m pylama src/opentrons tests .PHONY: docs docs: @@ -55,8 +59,8 @@ publish: .PHONY: dev dev: export ENABLE_VIRTUAL_SMOOTHIE := true -dev: - $(python) opentrons/main.py -P 31950 +dev: local-install + $(python) -m opentrons.main -P 31950 .PHONY: wheel wheel: clean @@ -64,6 +68,14 @@ wheel: clean shx rm -rf build shx ls dist +.PHONY: local-install +local-install: wheel + $(pip) install --ignore-installed --no-deps dist/opentrons-*.whl + +.PHONY: local-shell +local-shell: local-install + pipenv shell + .PHONY: push push: wheel curl -X POST \ diff --git a/api/README.rst b/api/README.rst index 15cffdae43f..97bddfd1b9c 100755 --- a/api/README.rst +++ b/api/README.rst @@ -102,3 +102,10 @@ Below is a short protocol that will pick up a tip and use it to move 100ul volum p300.dispense(plate[i + 1]) p300.return_tip() + +Using This Repo Outside Of A Robot +---------------------------------- + +The code in this subdirectory can be used outside of a robot to check protocols; however, because the code requires extra shared data files and dependencies, you cannot simply run a python interpreter. + +To use the opentrons API locally, please run ``make install`` to set up your system. Then, running ``make local-shell`` will give you a shell with the opentrons module all set up and ready to be imported. diff --git a/api/codecov.yml b/api/codecov.yml new file mode 100644 index 00000000000..693f53bfa18 --- /dev/null +++ b/api/codecov.yml @@ -0,0 +1,2 @@ +fixes: + -"src/opentrons/"::"opentrons/" diff --git a/api/pylama.ini b/api/pylama.ini index 6b8354249c9..19b26ccb703 100755 --- a/api/pylama.ini +++ b/api/pylama.ini @@ -5,30 +5,30 @@ linters = mccabe,pep8,pyflakes [pylama:mccabe] complexity = 9 -[pylama:opentrons/server/tests/data/bad_protocol.py] +[pylama:src/opentrons/server/tests/data/bad_protocol.py] skip = 1 # For Windows -[pylama:opentrons\server\tests\data\bad_protocol.py] +[pylama:src\opentrons\server\tests\data\bad_protocol.py] skip = 1 -[pylama:opentrons/server/tests/data/empty.py] +[pylama:src/opentrons/server/tests/data/empty.py] skip = 1 # For Windows -[pylama:opentrons\server\tests\data\empty.py] +[pylama:src\opentrons\server\tests\data\empty.py] skip = 1 -[pylama:opentrons/_version.py] +[pylama:src/opentrons/_version.py] skip = 1 # For Windows -[pylama:opentrons\_version.py] +[pylama:src\opentrons\_version.py] skip = 1 -[pylama:opentrons/resources/jupyter/jupyter_notebook_config.py] +[pylama:src/opentrons/resources/jupyter/jupyter_notebook_config.py] skip = 1 # For Windows -[pylama:opentrons\resources\jupyter\jupyter_notebook_config.py] +[pylama:src\opentrons\resources\jupyter\jupyter_notebook_config.py] skip = 1 diff --git a/api/pytest.ini b/api/pytest.ini new file mode 100644 index 00000000000..add3cc70986 --- /dev/null +++ b/api/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --cov --cov-report term-missing:skip-covered --cov-report xml:coverage.xml \ No newline at end of file diff --git a/api/setup.py b/api/setup.py index d1eb297a36d..c63ddea625a 100755 --- a/api/setup.py +++ b/api/setup.py @@ -2,15 +2,80 @@ # https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/ import codecs import os -import shutil +import os.path from setuptools import setup, find_packages +from setuptools.command import build_py, sdist + import json HERE = os.path.abspath(os.path.dirname(__file__)) +# Where we get our files from +SHARED_DATA_PATH = os.path.join('..', 'shared-data') +# The subdirectories of SHARED_DATA_PATH to scan for files +SHARED_DATA_SUBDIRS = ['labware-json-schema', + 'protocol-json-schema', + 'definitions', + 'robot-data'] +# Where, relative to the package root, we put the files we copy +DEST_BASE_PATH = 'shared_data' + + +def get_shared_data_files(): + to_include = [] + for subdir in SHARED_DATA_SUBDIRS: + top = os.path.join(SHARED_DATA_PATH, subdir) + for dirpath, dirnames, filenames in os.walk(top): + from_source = os.path.relpath(dirpath, SHARED_DATA_PATH) + to_include.extend([os.path.join(from_source, fname) + for fname in filenames]) + return to_include + + +class SDistWithSharedData(sdist.sdist): + description = sdist.sdist.description\ + + " Also, include opentrons data files." + + def make_release_tree(self, base_dir, files): + self.announce("adding opentrons data files to base dir {}".format(base_dir)) + for data_file in get_shared_data_files(): + sdist_dest = os.path.join(base_dir, DEST_BASE_PATH) + self.mkpath(os.path.join(sdist_dest, 'opentrons', + os.path.dirname(data_file))) + self.copy_file(os.path.join(SHARED_DATA_PATH, data_file), + os.path.join(sdist_dest, data_file)) + super().make_release_tree(base_dir, files) + + +class BuildWithSharedData(build_py.build_py): + description = build_py.build_py.description\ + + " Also, include opentrons data files" + + def _get_data_files(self): + """ + Override of build_py.get_data_files that includes out of tree configs. + These are currently hardcoded to include everything in + ../shared-data/robot-data, which will move to + opentrons/config/shared-data + """ + files = super()._get_data_files() + # We don’t really want to duplicate logic used in the original + # implementation, but we can back out what it did with commonpath - + # should be something ending in opentrons + build_base = os.path.commonpath([f[2] for f in files]) + # We want a list of paths to only files relative to ../shared-data + to_include = get_shared_data_files() + destination = os.path.join(build_base, DEST_BASE_PATH) + # And finally, tell the system about our files + print("FILES BEFORE {}".format(files)) + files.append(('opentrons', SHARED_DATA_PATH, + destination, to_include)) + print("FILES AFTER {}".format(files)) + return files + def get_version(): - with open(os.path.join(HERE, 'opentrons', 'package.json')) as pkg: + with open(os.path.join(HERE, 'src', 'opentrons', 'package.json')) as pkg: package_json = json.load(pkg) return package_json.get('version') @@ -37,13 +102,14 @@ def get_version(): DESCRIPTION = ( "The Opentrons API is a simple framework designed to make " "writing automated biology lab protocols easy.") -PACKAGES = find_packages(where='.', exclude=["tests.*", "tests"]) +PACKAGES = find_packages(where='src') INSTALL_REQUIRES = [ 'pyserial==3.2.1', 'aiohttp==2.3.8', 'numpy==1.12.1', 'urwid==1.3.1'] + def read(*parts): """ Build an absolute path from *parts* and and return the contents of the @@ -54,20 +120,6 @@ def read(*parts): if __name__ == "__main__": - pipette_config_filename = 'pipette-config.json' - config_src = os.path.join( - '..', 'shared-data', 'robot-data', pipette_config_filename) - config_dst = os.path.join('opentrons', 'config') - # If you add more copies like this in setup.py you must add them to the - # Dockerfile as well, since this doesn’t work during a docker build - try: - pipette_config_file = os.path.join(config_dst, pipette_config_filename) - if os.path.exists(pipette_config_file): - os.remove(pipette_config_file) - shutil.copy2(config_src, config_dst) - except OSError: - print('Unable to copy shared data directory due to exception:') - setup( python_requires='>=3.6', name=DISTNAME, @@ -87,17 +139,10 @@ def read(*parts): install_requires=INSTALL_REQUIRES, setup_requires=['pytest-runner'], tests_require=['pytest'], - include_package_data=True + include_package_data=True, + package_dir={'': 'src'}, + cmdclass={ + 'build_py': BuildWithSharedData, + 'sdist': SDistWithSharedData + } ) - if os.environ.get('RUNNING_ON_PI'): - # This only applies to software updates: when `pip install` is invoked - # on a running robot - not when `pip install` is invoked in the - # Dockerfile and not when the server starts up on a robot. - resource_dir = os.path.join(HERE, 'opentrons', 'resources') - provision = os.path.join(resource_dir, 'provision.py') - # We use a subprocess that invokes another python here to avoid - # importing the opentrons module that we’re about to install, since this - # is side-effect-heavy. - import sys - import subprocess - subprocess.check_call([sys.executable, provision], stdout=sys.stdout) diff --git a/api/opentrons/CHANGELOG.md b/api/src/opentrons/CHANGELOG.md similarity index 100% rename from api/opentrons/CHANGELOG.md rename to api/src/opentrons/CHANGELOG.md diff --git a/api/opentrons/__init__.py b/api/src/opentrons/__init__.py similarity index 100% rename from api/opentrons/__init__.py rename to api/src/opentrons/__init__.py diff --git a/api/opentrons/api/__init__.py b/api/src/opentrons/api/__init__.py similarity index 100% rename from api/opentrons/api/__init__.py rename to api/src/opentrons/api/__init__.py diff --git a/api/opentrons/api/calibration.py b/api/src/opentrons/api/calibration.py similarity index 100% rename from api/opentrons/api/calibration.py rename to api/src/opentrons/api/calibration.py diff --git a/api/opentrons/api/models.py b/api/src/opentrons/api/models.py similarity index 100% rename from api/opentrons/api/models.py rename to api/src/opentrons/api/models.py diff --git a/api/opentrons/api/routers.py b/api/src/opentrons/api/routers.py similarity index 100% rename from api/opentrons/api/routers.py rename to api/src/opentrons/api/routers.py diff --git a/api/opentrons/api/session.py b/api/src/opentrons/api/session.py similarity index 100% rename from api/opentrons/api/session.py rename to api/src/opentrons/api/session.py diff --git a/api/opentrons/broker/__init__.py b/api/src/opentrons/broker/__init__.py similarity index 100% rename from api/opentrons/broker/__init__.py rename to api/src/opentrons/broker/__init__.py diff --git a/api/opentrons/broker/broker.py b/api/src/opentrons/broker/broker.py similarity index 100% rename from api/opentrons/broker/broker.py rename to api/src/opentrons/broker/broker.py diff --git a/api/opentrons/broker/topics.py b/api/src/opentrons/broker/topics.py similarity index 100% rename from api/opentrons/broker/topics.py rename to api/src/opentrons/broker/topics.py diff --git a/api/opentrons/cli/__init__.py b/api/src/opentrons/cli/__init__.py similarity index 100% rename from api/opentrons/cli/__init__.py rename to api/src/opentrons/cli/__init__.py diff --git a/api/opentrons/commands/__init__.py b/api/src/opentrons/commands/__init__.py similarity index 100% rename from api/opentrons/commands/__init__.py rename to api/src/opentrons/commands/__init__.py diff --git a/api/opentrons/commands/commands.py b/api/src/opentrons/commands/commands.py similarity index 100% rename from api/opentrons/commands/commands.py rename to api/src/opentrons/commands/commands.py diff --git a/api/opentrons/commands/tree.py b/api/src/opentrons/commands/tree.py similarity index 100% rename from api/opentrons/commands/tree.py rename to api/src/opentrons/commands/tree.py diff --git a/api/opentrons/commands/types.py b/api/src/opentrons/commands/types.py similarity index 100% rename from api/opentrons/commands/types.py rename to api/src/opentrons/commands/types.py diff --git a/api/opentrons/config/__init__.py b/api/src/opentrons/config/__init__.py similarity index 99% rename from api/opentrons/config/__init__.py rename to api/src/opentrons/config/__init__.py index 92ca5215712..93ad0b518e5 100644 --- a/api/opentrons/config/__init__.py +++ b/api/src/opentrons/config/__init__.py @@ -75,6 +75,7 @@ def get_config_index() -> dict: """ rewrite_needed = False base_path = settings_dir() + print("Using settings dir {}".format(base_path)) file_path = os.path.join(base_path, index_filename) with open(file_path) as base_config_file: res = json.load(base_config_file) diff --git a/api/opentrons/config/advanced_settings.py b/api/src/opentrons/config/advanced_settings.py similarity index 100% rename from api/opentrons/config/advanced_settings.py rename to api/src/opentrons/config/advanced_settings.py diff --git a/api/opentrons/config/containers/__init__.py b/api/src/opentrons/config/containers/__init__.py similarity index 100% rename from api/opentrons/config/containers/__init__.py rename to api/src/opentrons/config/containers/__init__.py diff --git a/api/opentrons/config/containers/default-containers.json b/api/src/opentrons/config/containers/default-containers.json similarity index 100% rename from api/opentrons/config/containers/default-containers.json rename to api/src/opentrons/config/containers/default-containers.json diff --git a/api/opentrons/config/feature_flags.py b/api/src/opentrons/config/feature_flags.py similarity index 100% rename from api/opentrons/config/feature_flags.py rename to api/src/opentrons/config/feature_flags.py diff --git a/api/opentrons/config/modules/95-opentrons-modules.rules b/api/src/opentrons/config/modules/95-opentrons-modules.rules similarity index 100% rename from api/opentrons/config/modules/95-opentrons-modules.rules rename to api/src/opentrons/config/modules/95-opentrons-modules.rules diff --git a/api/opentrons/config/modules/avrdude.conf b/api/src/opentrons/config/modules/avrdude.conf similarity index 100% rename from api/opentrons/config/modules/avrdude.conf rename to api/src/opentrons/config/modules/avrdude.conf diff --git a/api/opentrons/config/smoothie/config_one_pro_plus b/api/src/opentrons/config/smoothie/config_one_pro_plus similarity index 100% rename from api/opentrons/config/smoothie/config_one_pro_plus rename to api/src/opentrons/config/smoothie/config_one_pro_plus diff --git a/api/opentrons/config/smoothie/smoothie-defaults.ini b/api/src/opentrons/config/smoothie/smoothie-defaults.ini similarity index 100% rename from api/opentrons/config/smoothie/smoothie-defaults.ini rename to api/src/opentrons/config/smoothie/smoothie-defaults.ini diff --git a/api/opentrons/data_storage/__init__.py b/api/src/opentrons/data_storage/__init__.py similarity index 100% rename from api/opentrons/data_storage/__init__.py rename to api/src/opentrons/data_storage/__init__.py diff --git a/api/opentrons/data_storage/database.py b/api/src/opentrons/data_storage/database.py similarity index 100% rename from api/opentrons/data_storage/database.py rename to api/src/opentrons/data_storage/database.py diff --git a/api/opentrons/data_storage/database_migration.py b/api/src/opentrons/data_storage/database_migration.py similarity index 100% rename from api/opentrons/data_storage/database_migration.py rename to api/src/opentrons/data_storage/database_migration.py diff --git a/api/opentrons/data_storage/database_queries.py b/api/src/opentrons/data_storage/database_queries.py similarity index 100% rename from api/opentrons/data_storage/database_queries.py rename to api/src/opentrons/data_storage/database_queries.py diff --git a/api/opentrons/data_storage/labware_definitions.py b/api/src/opentrons/data_storage/labware_definitions.py similarity index 100% rename from api/opentrons/data_storage/labware_definitions.py rename to api/src/opentrons/data_storage/labware_definitions.py diff --git a/api/opentrons/data_storage/old_container_loading.py b/api/src/opentrons/data_storage/old_container_loading.py similarity index 100% rename from api/opentrons/data_storage/old_container_loading.py rename to api/src/opentrons/data_storage/old_container_loading.py diff --git a/api/opentrons/data_storage/schema_changes.py b/api/src/opentrons/data_storage/schema_changes.py similarity index 100% rename from api/opentrons/data_storage/schema_changes.py rename to api/src/opentrons/data_storage/schema_changes.py diff --git a/api/opentrons/data_storage/serializers.py b/api/src/opentrons/data_storage/serializers.py similarity index 100% rename from api/opentrons/data_storage/serializers.py rename to api/src/opentrons/data_storage/serializers.py diff --git a/api/opentrons/deck_calibration/__init__.py b/api/src/opentrons/deck_calibration/__init__.py similarity index 100% rename from api/opentrons/deck_calibration/__init__.py rename to api/src/opentrons/deck_calibration/__init__.py diff --git a/api/opentrons/deck_calibration/dc_main.py b/api/src/opentrons/deck_calibration/dc_main.py similarity index 100% rename from api/opentrons/deck_calibration/dc_main.py rename to api/src/opentrons/deck_calibration/dc_main.py diff --git a/api/opentrons/deck_calibration/endpoints.py b/api/src/opentrons/deck_calibration/endpoints.py similarity index 100% rename from api/opentrons/deck_calibration/endpoints.py rename to api/src/opentrons/deck_calibration/endpoints.py diff --git a/api/opentrons/deck_calibration/linal.py b/api/src/opentrons/deck_calibration/linal.py similarity index 100% rename from api/opentrons/deck_calibration/linal.py rename to api/src/opentrons/deck_calibration/linal.py diff --git a/api/opentrons/drivers/__init__.py b/api/src/opentrons/drivers/__init__.py similarity index 100% rename from api/opentrons/drivers/__init__.py rename to api/src/opentrons/drivers/__init__.py diff --git a/api/opentrons/drivers/connection.py b/api/src/opentrons/drivers/connection.py similarity index 100% rename from api/opentrons/drivers/connection.py rename to api/src/opentrons/drivers/connection.py diff --git a/api/opentrons/drivers/mag_deck/__init__.py b/api/src/opentrons/drivers/mag_deck/__init__.py similarity index 100% rename from api/opentrons/drivers/mag_deck/__init__.py rename to api/src/opentrons/drivers/mag_deck/__init__.py diff --git a/api/opentrons/drivers/mag_deck/driver.py b/api/src/opentrons/drivers/mag_deck/driver.py similarity index 100% rename from api/opentrons/drivers/mag_deck/driver.py rename to api/src/opentrons/drivers/mag_deck/driver.py diff --git a/api/opentrons/drivers/rpi_drivers/__init__.py b/api/src/opentrons/drivers/rpi_drivers/__init__.py similarity index 100% rename from api/opentrons/drivers/rpi_drivers/__init__.py rename to api/src/opentrons/drivers/rpi_drivers/__init__.py diff --git a/api/opentrons/drivers/rpi_drivers/gpio.py b/api/src/opentrons/drivers/rpi_drivers/gpio.py similarity index 100% rename from api/opentrons/drivers/rpi_drivers/gpio.py rename to api/src/opentrons/drivers/rpi_drivers/gpio.py diff --git a/api/opentrons/drivers/serial_communication.py b/api/src/opentrons/drivers/serial_communication.py similarity index 100% rename from api/opentrons/drivers/serial_communication.py rename to api/src/opentrons/drivers/serial_communication.py diff --git a/api/opentrons/drivers/smoothie_drivers/__init__.py b/api/src/opentrons/drivers/smoothie_drivers/__init__.py similarity index 100% rename from api/opentrons/drivers/smoothie_drivers/__init__.py rename to api/src/opentrons/drivers/smoothie_drivers/__init__.py diff --git a/api/opentrons/drivers/smoothie_drivers/driver_3_0.py b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py similarity index 100% rename from api/opentrons/drivers/smoothie_drivers/driver_3_0.py rename to api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py diff --git a/api/opentrons/drivers/temp_deck/__init__.py b/api/src/opentrons/drivers/temp_deck/__init__.py similarity index 100% rename from api/opentrons/drivers/temp_deck/__init__.py rename to api/src/opentrons/drivers/temp_deck/__init__.py diff --git a/api/opentrons/drivers/temp_deck/driver.py b/api/src/opentrons/drivers/temp_deck/driver.py similarity index 100% rename from api/opentrons/drivers/temp_deck/driver.py rename to api/src/opentrons/drivers/temp_deck/driver.py diff --git a/api/opentrons/hardware_control/__init__.py b/api/src/opentrons/hardware_control/__init__.py similarity index 100% rename from api/opentrons/hardware_control/__init__.py rename to api/src/opentrons/hardware_control/__init__.py diff --git a/api/opentrons/hardware_control/controller.py b/api/src/opentrons/hardware_control/controller.py similarity index 100% rename from api/opentrons/hardware_control/controller.py rename to api/src/opentrons/hardware_control/controller.py diff --git a/api/opentrons/hardware_control/modules/__init__.py b/api/src/opentrons/hardware_control/modules/__init__.py similarity index 100% rename from api/opentrons/hardware_control/modules/__init__.py rename to api/src/opentrons/hardware_control/modules/__init__.py diff --git a/api/opentrons/hardware_control/modules/magdeck.py b/api/src/opentrons/hardware_control/modules/magdeck.py similarity index 100% rename from api/opentrons/hardware_control/modules/magdeck.py rename to api/src/opentrons/hardware_control/modules/magdeck.py diff --git a/api/opentrons/hardware_control/modules/mod_abc.py b/api/src/opentrons/hardware_control/modules/mod_abc.py similarity index 100% rename from api/opentrons/hardware_control/modules/mod_abc.py rename to api/src/opentrons/hardware_control/modules/mod_abc.py diff --git a/api/opentrons/hardware_control/modules/tempdeck.py b/api/src/opentrons/hardware_control/modules/tempdeck.py similarity index 100% rename from api/opentrons/hardware_control/modules/tempdeck.py rename to api/src/opentrons/hardware_control/modules/tempdeck.py diff --git a/api/opentrons/hardware_control/modules/update.py b/api/src/opentrons/hardware_control/modules/update.py similarity index 100% rename from api/opentrons/hardware_control/modules/update.py rename to api/src/opentrons/hardware_control/modules/update.py diff --git a/api/opentrons/hardware_control/simulator.py b/api/src/opentrons/hardware_control/simulator.py similarity index 100% rename from api/opentrons/hardware_control/simulator.py rename to api/src/opentrons/hardware_control/simulator.py diff --git a/api/opentrons/helpers/__init__.py b/api/src/opentrons/helpers/__init__.py similarity index 100% rename from api/opentrons/helpers/__init__.py rename to api/src/opentrons/helpers/__init__.py diff --git a/api/opentrons/helpers/helpers.py b/api/src/opentrons/helpers/helpers.py similarity index 100% rename from api/opentrons/helpers/helpers.py rename to api/src/opentrons/helpers/helpers.py diff --git a/api/opentrons/legacy_api/__init__.py b/api/src/opentrons/legacy_api/__init__.py similarity index 100% rename from api/opentrons/legacy_api/__init__.py rename to api/src/opentrons/legacy_api/__init__.py diff --git a/api/opentrons/legacy_api/api.py b/api/src/opentrons/legacy_api/api.py similarity index 100% rename from api/opentrons/legacy_api/api.py rename to api/src/opentrons/legacy_api/api.py diff --git a/api/opentrons/legacy_api/containers/__init__.py b/api/src/opentrons/legacy_api/containers/__init__.py similarity index 100% rename from api/opentrons/legacy_api/containers/__init__.py rename to api/src/opentrons/legacy_api/containers/__init__.py diff --git a/api/opentrons/legacy_api/containers/placeable.py b/api/src/opentrons/legacy_api/containers/placeable.py similarity index 100% rename from api/opentrons/legacy_api/containers/placeable.py rename to api/src/opentrons/legacy_api/containers/placeable.py diff --git a/api/opentrons/legacy_api/instruments/__init__.py b/api/src/opentrons/legacy_api/instruments/__init__.py similarity index 100% rename from api/opentrons/legacy_api/instruments/__init__.py rename to api/src/opentrons/legacy_api/instruments/__init__.py diff --git a/api/opentrons/legacy_api/instruments/instrument.py b/api/src/opentrons/legacy_api/instruments/instrument.py similarity index 100% rename from api/opentrons/legacy_api/instruments/instrument.py rename to api/src/opentrons/legacy_api/instruments/instrument.py diff --git a/api/opentrons/legacy_api/instruments/pipette.py b/api/src/opentrons/legacy_api/instruments/pipette.py similarity index 100% rename from api/opentrons/legacy_api/instruments/pipette.py rename to api/src/opentrons/legacy_api/instruments/pipette.py diff --git a/api/opentrons/legacy_api/instruments/pipette_config.py b/api/src/opentrons/legacy_api/instruments/pipette_config.py similarity index 97% rename from api/opentrons/legacy_api/instruments/pipette_config.py rename to api/src/opentrons/legacy_api/instruments/pipette_config.py index 6dc74f32ceb..ae419bca4c6 100644 --- a/api/opentrons/legacy_api/instruments/pipette_config.py +++ b/api/src/opentrons/legacy_api/instruments/pipette_config.py @@ -6,7 +6,8 @@ root_dir = os.path.abspath(os.path.dirname(root_file)) -config_file = os.path.join(root_dir, 'config', 'pipette-config.json') +config_file = os.path.join(root_dir, + 'shared_data', 'robot-data', 'pipette-config.json') log = logging.getLogger(__name__) pipette_config = namedtuple( diff --git a/api/opentrons/legacy_api/modules/__init__.py b/api/src/opentrons/legacy_api/modules/__init__.py similarity index 100% rename from api/opentrons/legacy_api/modules/__init__.py rename to api/src/opentrons/legacy_api/modules/__init__.py diff --git a/api/opentrons/legacy_api/modules/magdeck.py b/api/src/opentrons/legacy_api/modules/magdeck.py similarity index 100% rename from api/opentrons/legacy_api/modules/magdeck.py rename to api/src/opentrons/legacy_api/modules/magdeck.py diff --git a/api/opentrons/legacy_api/modules/tempdeck.py b/api/src/opentrons/legacy_api/modules/tempdeck.py similarity index 100% rename from api/opentrons/legacy_api/modules/tempdeck.py rename to api/src/opentrons/legacy_api/modules/tempdeck.py diff --git a/api/opentrons/legacy_api/robot/__init__.py b/api/src/opentrons/legacy_api/robot/__init__.py similarity index 100% rename from api/opentrons/legacy_api/robot/__init__.py rename to api/src/opentrons/legacy_api/robot/__init__.py diff --git a/api/opentrons/legacy_api/robot/mover.py b/api/src/opentrons/legacy_api/robot/mover.py similarity index 100% rename from api/opentrons/legacy_api/robot/mover.py rename to api/src/opentrons/legacy_api/robot/mover.py diff --git a/api/opentrons/legacy_api/robot/robot.py b/api/src/opentrons/legacy_api/robot/robot.py similarity index 100% rename from api/opentrons/legacy_api/robot/robot.py rename to api/src/opentrons/legacy_api/robot/robot.py diff --git a/api/opentrons/legacy_api/robot/robot_configs.py b/api/src/opentrons/legacy_api/robot/robot_configs.py similarity index 100% rename from api/opentrons/legacy_api/robot/robot_configs.py rename to api/src/opentrons/legacy_api/robot/robot_configs.py diff --git a/api/opentrons/main.py b/api/src/opentrons/main.py similarity index 100% rename from api/opentrons/main.py rename to api/src/opentrons/main.py diff --git a/api/opentrons/package.json b/api/src/opentrons/package.json similarity index 100% rename from api/opentrons/package.json rename to api/src/opentrons/package.json diff --git a/api/opentrons/protocol_api/__init__.py b/api/src/opentrons/protocol_api/__init__.py similarity index 100% rename from api/opentrons/protocol_api/__init__.py rename to api/src/opentrons/protocol_api/__init__.py diff --git a/api/opentrons/protocol_api/back_compat.py b/api/src/opentrons/protocol_api/back_compat.py similarity index 100% rename from api/opentrons/protocol_api/back_compat.py rename to api/src/opentrons/protocol_api/back_compat.py diff --git a/api/opentrons/protocol_api/labware.py b/api/src/opentrons/protocol_api/labware.py similarity index 100% rename from api/opentrons/protocol_api/labware.py rename to api/src/opentrons/protocol_api/labware.py diff --git a/api/opentrons/protocols/__init__.py b/api/src/opentrons/protocols/__init__.py similarity index 100% rename from api/opentrons/protocols/__init__.py rename to api/src/opentrons/protocols/__init__.py diff --git a/api/opentrons/resources/api.service b/api/src/opentrons/resources/api.service similarity index 100% rename from api/opentrons/resources/api.service rename to api/src/opentrons/resources/api.service diff --git a/api/opentrons/resources/inetd.conf b/api/src/opentrons/resources/inetd.conf similarity index 100% rename from api/opentrons/resources/inetd.conf rename to api/src/opentrons/resources/inetd.conf diff --git a/api/opentrons/resources/jupyter/jupyter_notebook_config.py b/api/src/opentrons/resources/jupyter/jupyter_notebook_config.py similarity index 100% rename from api/opentrons/resources/jupyter/jupyter_notebook_config.py rename to api/src/opentrons/resources/jupyter/jupyter_notebook_config.py diff --git a/api/opentrons/resources/nginx.conf b/api/src/opentrons/resources/nginx.conf similarity index 100% rename from api/opentrons/resources/nginx.conf rename to api/src/opentrons/resources/nginx.conf diff --git a/api/opentrons/resources/ot-environ.sh b/api/src/opentrons/resources/ot-environ.sh similarity index 100% rename from api/opentrons/resources/ot-environ.sh rename to api/src/opentrons/resources/ot-environ.sh diff --git a/api/opentrons/resources/scripts/announce_mdns.py b/api/src/opentrons/resources/scripts/announce_mdns.py similarity index 100% rename from api/opentrons/resources/scripts/announce_mdns.py rename to api/src/opentrons/resources/scripts/announce_mdns.py diff --git a/api/opentrons/resources/scripts/calibrate b/api/src/opentrons/resources/scripts/calibrate similarity index 100% rename from api/opentrons/resources/scripts/calibrate rename to api/src/opentrons/resources/scripts/calibrate diff --git a/api/opentrons/resources/scripts/lpc21isp b/api/src/opentrons/resources/scripts/lpc21isp similarity index 100% rename from api/opentrons/resources/scripts/lpc21isp rename to api/src/opentrons/resources/scripts/lpc21isp diff --git a/api/opentrons/resources/scripts/miniterm b/api/src/opentrons/resources/scripts/miniterm similarity index 100% rename from api/opentrons/resources/scripts/miniterm rename to api/src/opentrons/resources/scripts/miniterm diff --git a/api/opentrons/resources/scripts/mount_usb.py b/api/src/opentrons/resources/scripts/mount_usb.py similarity index 100% rename from api/opentrons/resources/scripts/mount_usb.py rename to api/src/opentrons/resources/scripts/mount_usb.py diff --git a/api/opentrons/resources/scripts/pipette_memory b/api/src/opentrons/resources/scripts/pipette_memory similarity index 100% rename from api/opentrons/resources/scripts/pipette_memory rename to api/src/opentrons/resources/scripts/pipette_memory diff --git a/api/opentrons/resources/scripts/provision-api-resources b/api/src/opentrons/resources/scripts/provision-api-resources similarity index 100% rename from api/opentrons/resources/scripts/provision-api-resources rename to api/src/opentrons/resources/scripts/provision-api-resources diff --git a/api/opentrons/resources/scripts/setup.sh b/api/src/opentrons/resources/scripts/setup.sh similarity index 100% rename from api/opentrons/resources/scripts/setup.sh rename to api/src/opentrons/resources/scripts/setup.sh diff --git a/api/opentrons/resources/scripts/setup_gpio.py b/api/src/opentrons/resources/scripts/setup_gpio.py similarity index 100% rename from api/opentrons/resources/scripts/setup_gpio.py rename to api/src/opentrons/resources/scripts/setup_gpio.py diff --git a/api/opentrons/resources/scripts/start.sh b/api/src/opentrons/resources/scripts/start.sh similarity index 100% rename from api/opentrons/resources/scripts/start.sh rename to api/src/opentrons/resources/scripts/start.sh diff --git a/api/opentrons/resources/scripts/switches_lights b/api/src/opentrons/resources/scripts/switches_lights similarity index 100% rename from api/opentrons/resources/scripts/switches_lights rename to api/src/opentrons/resources/scripts/switches_lights diff --git a/api/opentrons/resources/smoothie-edge-6168d32.hex b/api/src/opentrons/resources/smoothie-edge-6168d32.hex similarity index 100% rename from api/opentrons/resources/smoothie-edge-6168d32.hex rename to api/src/opentrons/resources/smoothie-edge-6168d32.hex diff --git a/api/opentrons/server/__init__.py b/api/src/opentrons/server/__init__.py similarity index 100% rename from api/opentrons/server/__init__.py rename to api/src/opentrons/server/__init__.py diff --git a/api/opentrons/server/endpoints/__init__.py b/api/src/opentrons/server/endpoints/__init__.py similarity index 100% rename from api/opentrons/server/endpoints/__init__.py rename to api/src/opentrons/server/endpoints/__init__.py diff --git a/api/opentrons/server/endpoints/control.py b/api/src/opentrons/server/endpoints/control.py similarity index 100% rename from api/opentrons/server/endpoints/control.py rename to api/src/opentrons/server/endpoints/control.py diff --git a/api/opentrons/server/endpoints/serverlib_fallback.py b/api/src/opentrons/server/endpoints/serverlib_fallback.py similarity index 100% rename from api/opentrons/server/endpoints/serverlib_fallback.py rename to api/src/opentrons/server/endpoints/serverlib_fallback.py diff --git a/api/opentrons/server/endpoints/settings.py b/api/src/opentrons/server/endpoints/settings.py similarity index 100% rename from api/opentrons/server/endpoints/settings.py rename to api/src/opentrons/server/endpoints/settings.py diff --git a/api/opentrons/server/endpoints/update.py b/api/src/opentrons/server/endpoints/update.py similarity index 100% rename from api/opentrons/server/endpoints/update.py rename to api/src/opentrons/server/endpoints/update.py diff --git a/api/opentrons/server/endpoints/wifi.py b/api/src/opentrons/server/endpoints/wifi.py similarity index 100% rename from api/opentrons/server/endpoints/wifi.py rename to api/src/opentrons/server/endpoints/wifi.py diff --git a/api/opentrons/server/http.py b/api/src/opentrons/server/http.py similarity index 100% rename from api/opentrons/server/http.py rename to api/src/opentrons/server/http.py diff --git a/api/opentrons/server/main.py b/api/src/opentrons/server/main.py similarity index 100% rename from api/opentrons/server/main.py rename to api/src/opentrons/server/main.py diff --git a/api/opentrons/server/rpc.py b/api/src/opentrons/server/rpc.py similarity index 100% rename from api/opentrons/server/rpc.py rename to api/src/opentrons/server/rpc.py diff --git a/api/opentrons/server/serialize.py b/api/src/opentrons/server/serialize.py similarity index 100% rename from api/opentrons/server/serialize.py rename to api/src/opentrons/server/serialize.py diff --git a/api/opentrons/simulate_protocol.py b/api/src/opentrons/simulate_protocol.py similarity index 100% rename from api/opentrons/simulate_protocol.py rename to api/src/opentrons/simulate_protocol.py diff --git a/api/opentrons/system/__init__.py b/api/src/opentrons/system/__init__.py similarity index 100% rename from api/opentrons/system/__init__.py rename to api/src/opentrons/system/__init__.py diff --git a/api/opentrons/system/nmcli.py b/api/src/opentrons/system/nmcli.py similarity index 100% rename from api/opentrons/system/nmcli.py rename to api/src/opentrons/system/nmcli.py diff --git a/api/opentrons/system/resin.py b/api/src/opentrons/system/resin.py similarity index 100% rename from api/opentrons/system/resin.py rename to api/src/opentrons/system/resin.py diff --git a/api/opentrons/system/udev.py b/api/src/opentrons/system/udev.py similarity index 100% rename from api/opentrons/system/udev.py rename to api/src/opentrons/system/udev.py diff --git a/api/opentrons/tools/__init__.py b/api/src/opentrons/tools/__init__.py similarity index 100% rename from api/opentrons/tools/__init__.py rename to api/src/opentrons/tools/__init__.py diff --git a/api/opentrons/tools/factory_test.py b/api/src/opentrons/tools/factory_test.py similarity index 100% rename from api/opentrons/tools/factory_test.py rename to api/src/opentrons/tools/factory_test.py diff --git a/api/opentrons/tools/gantry_test.py b/api/src/opentrons/tools/gantry_test.py similarity index 100% rename from api/opentrons/tools/gantry_test.py rename to api/src/opentrons/tools/gantry_test.py diff --git a/api/opentrons/tools/overnight_test.py b/api/src/opentrons/tools/overnight_test.py similarity index 100% rename from api/opentrons/tools/overnight_test.py rename to api/src/opentrons/tools/overnight_test.py diff --git a/api/opentrons/tools/write_pipette_memory.py b/api/src/opentrons/tools/write_pipette_memory.py similarity index 100% rename from api/opentrons/tools/write_pipette_memory.py rename to api/src/opentrons/tools/write_pipette_memory.py diff --git a/api/opentrons/tools/z_stage_test.py b/api/src/opentrons/tools/z_stage_test.py similarity index 100% rename from api/opentrons/tools/z_stage_test.py rename to api/src/opentrons/tools/z_stage_test.py diff --git a/api/opentrons/trackers/__init__.py b/api/src/opentrons/trackers/__init__.py similarity index 100% rename from api/opentrons/trackers/__init__.py rename to api/src/opentrons/trackers/__init__.py diff --git a/api/opentrons/trackers/move_msgs.py b/api/src/opentrons/trackers/move_msgs.py similarity index 100% rename from api/opentrons/trackers/move_msgs.py rename to api/src/opentrons/trackers/move_msgs.py diff --git a/api/opentrons/trackers/pose_tracker.py b/api/src/opentrons/trackers/pose_tracker.py similarity index 100% rename from api/opentrons/trackers/pose_tracker.py rename to api/src/opentrons/trackers/pose_tracker.py diff --git a/api/opentrons/types.py b/api/src/opentrons/types.py similarity index 100% rename from api/opentrons/types.py rename to api/src/opentrons/types.py diff --git a/api/opentrons/util/__init__.py b/api/src/opentrons/util/__init__.py similarity index 100% rename from api/opentrons/util/__init__.py rename to api/src/opentrons/util/__init__.py diff --git a/api/opentrons/util/calibration_functions.py b/api/src/opentrons/util/calibration_functions.py similarity index 100% rename from api/opentrons/util/calibration_functions.py rename to api/src/opentrons/util/calibration_functions.py diff --git a/api/opentrons/util/environment.py b/api/src/opentrons/util/environment.py similarity index 100% rename from api/opentrons/util/environment.py rename to api/src/opentrons/util/environment.py diff --git a/api/opentrons/util/vector.py b/api/src/opentrons/util/vector.py similarity index 100% rename from api/opentrons/util/vector.py rename to api/src/opentrons/util/vector.py