Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,25 @@ 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 <command>`, 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 <command>`, 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
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
Expand Down
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
]
1 change: 0 additions & 1 deletion src/hispec/driver/pycamerad
Submodule pycamerad deleted from 2c1f1c
2 changes: 1 addition & 1 deletion src/hispec/driver/tracking_camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from dataclasses import dataclass
from enum import Enum

from ..pycamerad import Camerad
from pycamerad import Camerad

INSTRUMENT = "hispec_tracking_camera"

Expand Down
4 changes: 3 additions & 1 deletion systemd/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading