Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 5.0.3
_commit: 5.2.0
_src_path: https://github.com/DiamondLightSource/python-copier-template
author_email: callum.forrester@diamond.ac.uk
author_name: Callum Forrester
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua

This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.

For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/5.0.3/how-to.html).
For more information on common tasks like setting up a developer environment, running the tests, and setting a pre-commit hook, see the template's [How-to guides](https://diamondlightsource.github.io/python-copier-template/5.2.0/how-to.html).
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
fail-fast: false
uses: ./.github/workflows/_test.yml
with:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# The devcontainer should use the developer target and run as root with podman
# or docker with user namespaces.
FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer
FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:resolute AS developer

# Add any system dependencies for the developer/build environment here
RUN apt-get update -y && apt-get install -y --no-install-recommends \
graphviz \
&& apt-get dist-clean

# Install helm for the dev container. This is the recommended
# Install helm for the dev container. This is the recommended
# approach per the docs: https://helm.sh/docs/intro/install
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3; \
chmod 700 get_helm.sh; \
Expand All @@ -27,12 +27,12 @@ RUN chmod o+wrX .
# Tell uv sync to install python in a known location so we can copy it out later
ENV UV_PYTHON_INSTALL_DIR=/python

RUN uv add debugpy

# Sync the project without its dev dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --locked --no-editable --no-dev --managed-python

RUN uv pip install debugpy

# The runtime stage copies the built venv into a runtime container
FROM ubuntu:resolute AS runtime

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/add-plans-and-devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To add plans, you would add the following into your configuration file:
```


Devices are added similarly, using `dodal` as the `kind`, like so:
Devices are added similarly, using `deviceManager` as the `kind`, like so:
```{literalinclude} ../../tests/unit_tests/valid_example_config/plans_and_devices.yaml
:language: yaml
```
Expand Down
14 changes: 11 additions & 3 deletions docs/reference/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,25 @@ components:
description: Client ID
title: Client Id
type: string
issuer:
anyOf:
- type: string
- type: 'null'
description: URL of OIDC provider
title: Issuer
logout_redirect_endpoint:
default: ''
description: The oidc endpoint required to logout
title: Logout Redirect Endpoint
type: string
well_known_url:
anyOf:
- type: string
- type: 'null'
deprecated: true
description: URL to fetch OIDC config from the provider
title: Well Known Url
type: string
required:
- well_known_url
- client_id
title: OIDCConfig
type: object
Expand Down Expand Up @@ -433,7 +441,7 @@ info:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
title: BlueAPI Control
version: 1.3.0
version: 1.4.0
openapi: 3.1.0
paths:
/api/v1/devices:
Expand Down
96 changes: 25 additions & 71 deletions helm/blueapi/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,77 +100,16 @@
"type": "object",
"$id": "DeviceManagerSource"
},
"DeviceSource": {
"additionalProperties": false,
"properties": {
"module": {
"description": "Module to be imported",
"title": "Module",
"type": "string"
},
"kind": {
"const": "deviceFunctions",
"default": "deviceFunctions",
"title": "Kind",
"type": "string"
}
},
"required": [
"module"
],
"title": "DeviceSource",
"type": "object",
"$id": "DeviceSource"
},
"DodalSource": {
"additionalProperties": false,
"properties": {
"module": {
"description": "Module to be imported",
"title": "Module",
"type": "string"
},
"kind": {
"const": "dodal",
"default": "dodal",
"title": "Kind",
"type": "string"
},
"mock": {
"default": false,
"description": "If true, ophyd_async device connections are mocked",
"title": "Mock",
"type": "boolean"
}
},
"required": [
"module"
],
"title": "DodalSource",
"type": "object",
"$id": "DodalSource"
},
"EnvironmentConfig": {
"additionalProperties": false,
"description": "Config for the RunEngine environment",
"properties": {
"sources": {
"default": [
{
"module": "dodal.plans",
"kind": "planFunctions"
},
{
"module": "dodal.plan_stubs.wrapped",
"kind": "planFunctions"
}
],
"default": [],
"items": {
"discriminator": {
"mapping": {
"deviceFunctions": "DeviceSource",
"deviceManager": "DeviceManagerSource",
"dodal": "DodalSource",
"planFunctions": "PlanSource"
},
"propertyName": "kind"
Expand All @@ -179,12 +118,6 @@
{
"$ref": "PlanSource"
},
{
"$ref": "DeviceSource"
},
{
"$ref": "DodalSource"
},
{
"$ref": "DeviceManagerSource"
}
Expand Down Expand Up @@ -300,9 +233,31 @@
"additionalProperties": false,
"properties": {
"well_known_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"deprecated": true,
"description": "URL to fetch OIDC config from the provider",
"title": "Well Known Url",
"type": "string"
"title": "Well Known Url"
},
"issuer": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "URL of OIDC provider",
"title": "Issuer"
},
"client_id": {
"description": "Client ID",
Expand All @@ -323,7 +278,6 @@
}
},
"required": [
"well_known_url",
"client_id"
],
"title": "OIDCConfig",
Expand Down
87 changes: 21 additions & 66 deletions helm/blueapi/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,54 +533,6 @@
},
"additionalProperties": false
},
"DeviceSource": {
"$id": "DeviceSource",
"title": "DeviceSource",
"type": "object",
"required": [
"module"
],
"properties": {
"kind": {
"title": "Kind",
"default": "deviceFunctions",
"const": "deviceFunctions"
},
"module": {
"title": "Module",
"description": "Module to be imported",
"type": "string"
}
},
"additionalProperties": false
},
"DodalSource": {
"$id": "DodalSource",
"title": "DodalSource",
"type": "object",
"required": [
"module"
],
"properties": {
"kind": {
"title": "Kind",
"default": "dodal",
"const": "dodal"
},
"mock": {
"title": "Mock",
"description": "If true, ophyd_async device connections are mocked",
"default": false,
"type": "boolean"
},
"module": {
"title": "Module",
"description": "Module to be imported",
"type": "string"
}
},
"additionalProperties": false
},
"EnvironmentConfig": {
"$id": "EnvironmentConfig",
"title": "EnvironmentConfig",
Expand All @@ -602,28 +554,13 @@
},
"sources": {
"title": "Sources",
"default": [
{
"kind": "planFunctions",
"module": "dodal.plans"
},
{
"kind": "planFunctions",
"module": "dodal.plan_stubs.wrapped"
}
],
"default": [],
"type": "array",
"items": {
"oneOf": [
{
"$ref": "PlanSource"
},
{
"$ref": "DeviceSource"
},
{
"$ref": "DodalSource"
},
{
"$ref": "DeviceManagerSource"
}
Expand Down Expand Up @@ -722,7 +659,6 @@
"title": "OIDCConfig",
"type": "object",
"required": [
"well_known_url",
"client_id"
],
"properties": {
Expand All @@ -737,6 +673,18 @@
"description": "Client ID",
"type": "string"
},
"issuer": {
"title": "Issuer",
"description": "URL of OIDC provider",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"logout_redirect_endpoint": {
"title": "Logout Redirect Endpoint",
"description": "The oidc endpoint required to logout",
Expand All @@ -746,7 +694,14 @@
"well_known_url": {
"title": "Well Known Url",
"description": "URL to fetch OIDC config from the provider",
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
Expand Down
10 changes: 9 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,19 @@ lint:
uv run pyright src tests

unit *OPTS:
uv run pytest tests/unit_tests {{ OPTS }}
uv run pytest -n logical tests/unit_tests {{ OPTS }}

system *OPTS:
uv run pytest tests/system_tests {{ OPTS }}

coverage:
uv run pytest tests/unit_tests --cov --cov-report html
xdg-open htmlcov/index.html

repl:
#!/usr/bin/env bash
uv run --with ptpython ptpython -i <(cat << EOF
from blueapi.client import BlueapiClient
bc = BlueapiClient.from_config_file("tests/system_tests/config.yaml").with_instrument_session("cm12345-1")
EOF
)
Loading
Loading