diff --git a/.gitmodules b/.gitmodules index 5777b22..5d1669e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -60,7 +60,3 @@ [submodule "src/hispec/driver/hispec-fiber-switcher"] path = src/hispec/driver/hispec-fiber-switcher url = https://github.com/COO-Utilities/hispec-fiber-switcher -[submodule "src/hispec/driver/pycamerad"] - path = src/hispec/driver/pycamerad - url = https://github.com/COO-Utilities/pycamerad.git - branch = main diff --git a/README.md b/README.md index f297b5a..1419bf3 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,17 @@ git submodule sync --recursive git submodule update --init --recursive # 3) Create the environment and install, editable -uv sync +uv sync --all-packages ``` -`uv sync` builds `.venv` on the Python named in `.python-version`, installs -every dependency and puts this package in it editable, so a `git pull` changes -behaviour without reinstalling. Run commands through `uv run `, or -activate `.venv` if you prefer. +That builds `.venv` on the Python named in `.python-version` and installs this +package plus every vendor driver editable, so a `git pull` changes behaviour +without reinstalling. Run commands through `uv run `, or activate +`.venv` if you prefer. + +`--all-packages` matters: the drivers under `src/hispec/driver/` are uv +workspace members, and a plain `uv sync` installs only this package's own +dependencies, leaving theirs out. `uv.lock` is not committed while the git dependencies deliberately track their default branches. It still records which commit of libby, bamboo and the rest @@ -62,7 +66,7 @@ your checkout resolved to, which is how to tell what you are running. `uv sync` reuses that lock once it exists, so pick up a merged dependency change with: ```bash -uv lock --upgrade && uv sync +uv lock --upgrade && uv sync --all-packages ``` ## Submodules diff --git a/pyproject.toml b/pyproject.toml index 057c271..0ac3802 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,9 @@ dependencies = [ "libximc", "scipy", "pyyaml", + # SSH transport for the DLI DC3 PDU; the pdu driver imports it + # without declaring it + "paramiko", # influxdb extra: needed by daemons/generic/keygrabber "libby[influxdb]@git+https://github.com/CaltechOpticalObservatories/libby.git", "hardware_device_base@git+https://github.com/COO-Utilities/hardware_device_base", @@ -59,3 +62,17 @@ ignored-modules = [ "hispec.driver", "PPC102_lib", ] + +# The vendor drivers are vendored as submodules so they can be fixed in place, +# but their own dependencies still have to reach the environment. tracking_camera +# is HISPEC's own code with no pyproject, so it is not a member. +[tool.uv.workspace] +members = ["src/hispec/driver/*"] +exclude = ["src/hispec/driver/tracking_camera"] + +[tool.uv] +# The drivers pin this to v1.0.0, v1.0.1 and unpinned between them, and uv +# allows one URL per package. Without an override nothing resolves at all. +override-dependencies = [ + "hardware_device_base @ git+https://github.com/COO-Utilities/hardware_device_base@v1.0.1", +] diff --git a/src/hispec/driver/pycamerad b/src/hispec/driver/pycamerad deleted file mode 160000 index 2c1f1c7..0000000 --- a/src/hispec/driver/pycamerad +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2c1f1c71ccc408625437fa85b269f47b59822af1 diff --git a/src/hispec/driver/tracking_camera/camera.py b/src/hispec/driver/tracking_camera/camera.py index 93df605..48e2a2b 100644 --- a/src/hispec/driver/tracking_camera/camera.py +++ b/src/hispec/driver/tracking_camera/camera.py @@ -11,7 +11,7 @@ from dataclasses import dataclass from enum import Enum -from ..pycamerad import Camerad +from pycamerad import Camerad INSTRUMENT = "hispec_tracking_camera" diff --git a/systemd/install.sh b/systemd/install.sh index 906f674..4b9c6de 100755 --- a/systemd/install.sh +++ b/systemd/install.sh @@ -122,7 +122,9 @@ fi ( cd "$REPO_DIR" "$UV_BIN" lock --upgrade - "$UV_BIN" sync + # --all-packages installs the vendored drivers too; plain sync covers only + # the root project and leaves their dependencies out + "$UV_BIN" sync --all-packages ) chown -R hispec:hispec "$VENV_DIR"