Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into adding-oauthn
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Nov 18, 2024
2 parents 1243807 + fa20204 commit b31c275
Show file tree
Hide file tree
Showing 51 changed files with 301 additions and 181 deletions.
4 changes: 3 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Changes here will be overwritten by Copier
_commit: 2.0.1
_commit: 2.5.0
_src_path: gh:DiamondLightSource/python-copier-template
author_email: callum.forrester@diamond.ac.uk
author_name: Callum Forrester
component_lifecycle: production
component_owner: user:vid18871
component_type: service
description: Lightweight bluesky-as-a-service wrapper application. Also usable as
a library.
distribution_name: blueapi
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
// After the container is created, install the python project in editable form
"postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
}
}
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/2.0.1/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/2.5.0/how-to.html).
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug Report
about: The template to use for reporting bugs and usability issues
title: " "
labels: 'bug'
assignees: ''

---

Describe the bug, including a clear and concise description of the expected behavior, the actual behavior and the context in which you encountered it (ideally include details of your environment).

## Steps To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error


## Acceptance Criteria
- Specific criteria that will be used to judge if the issue is fixed
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Issue
about: The standard template to use for feature requests, design discussions and tasks
title: " "
labels: ''
assignees: ''

---

A brief description of the issue, including specific stakeholders and the business case where appropriate

## Acceptance Criteria
- Specific criteria that will be used to judge if the issue is fixed
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Fixes #ISSUE

### Instructions to reviewer on how to test:
1. Do thing x
2. Confirm thing y happens

### Checks for reviewer
- [ ] Would the PR title make sense to a user on a set of release notes
2 changes: 1 addition & 1 deletion .github/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<link rel="canonical" href="main/index.html">
</head>

</html>
</html>
5 changes: 5 additions & 0 deletions .github/pages/make_switcher.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Make switcher.json to allow docs to switch between different versions."""

import json
import logging
from argparse import ArgumentParser
Expand All @@ -6,6 +8,7 @@


def report_output(stdout: bytes, label: str) -> list[str]:
"""Print and return something received frm stdout."""
ret = stdout.decode().strip().split("\n")
print(f"{label}: {ret}")
return ret
Expand Down Expand Up @@ -53,6 +56,7 @@ def get_versions(ref: str, add: str | None) -> list[str]:


def write_json(path: Path, repository: str, versions: list[str]):
"""Write the JSON switcher to path."""
org, repo_name = repository.split("/")
struct = [
{"version": version, "url": f"https://{org}.github.io/{repo_name}/{version}/"}
Expand All @@ -64,6 +68,7 @@ def write_json(path: Path, repository: str, versions: list[str]):


def main(args=None):
"""Parse args and write switcher."""
parser = ArgumentParser(
description="Make a versions.json file from gh-pages directories"
)
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
env:
SEMVER_REGEX: ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$

run: |
ref="${{ github.ref_name }}"
my_regex="${{env.SEMVER_REGEX}}"
Expand All @@ -42,7 +43,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and export to Docker local cache
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
# Need load and tags so we can test it below
Expand All @@ -63,7 +66,9 @@ jobs:
- name: Push cached image to container registry
if: github.ref_type == 'tag'
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
# This does not build the image again, it will find the image in the
# Docker cache and publish it
with:
Expand Down Expand Up @@ -101,7 +106,7 @@ jobs:
- name: package chart and push it
run: |
sed -i "$ a appVersion: ${VERSION}" helm/blueapi/Chart.yaml
sed -i "$ a appVersion: ${GITHUB_REF##*/}" helm/blueapi/Chart.yaml
helm dependencies update helm/blueapi
helm package helm/blueapi --version ${VERSION} -d /tmp/
helm push /tmp/blueapi-${VERSION}.tgz oci://ghcr.io/diamondlightsource/charts
helm package helm/blueapi --version ${GITHUB_REF##*/} -d /tmp/
helm push /tmp/blueapi-${GITHUB_REF##*/}.tgz oci://ghcr.io/diamondlightsource/charts
4 changes: 2 additions & 2 deletions .github/workflows/_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
if: github.ref_type == 'tag' || github.ref_name == 'main'
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages
keep_files: true
keep_files: true
2 changes: 2 additions & 0 deletions .github/workflows/_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ jobs:

- name: Publish to PyPI using trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: false
2 changes: 1 addition & 1 deletion .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Create GitHub Release
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
with:
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
files: "*"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]
include:
# Include one that runs in the dev environment
- runs-on: "ubuntu-latest"
Expand All @@ -39,6 +39,7 @@ jobs:
if: needs.check.outputs.branch-pr == ''
uses: ./.github/workflows/_container.yml
permissions:
contents: read
packages: write

docs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ cov.xml

# Sphinx documentation
docs/_build/
docs/_api

# PyBuilder
target/
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ repos:
- id: check-yaml
exclude: ^helm\/.*\/templates\/.*|catalog-info.yaml
- id: check-merge-conflict
- id: end-of-file-fixer

- repo: local
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"recommendations": [
"ms-vscode-remote.remote-containers",
]
}
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
"default": ""
},
]
}
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"files.insertFinalNewline": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
},
}
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"problemMatcher": [],
}
]
}
}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The devcontainer should use the developer target and run as root with podman
# or docker with user namespaces.
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION} as developer
FROM python:${PYTHON_VERSION} AS developer

# Add any system dependencies for the developer/build environment here
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand All @@ -13,13 +13,13 @@ RUN python -m venv /venv
ENV PATH=/venv/bin:$PATH

# The build stage installs the context into the venv
FROM developer as build
FROM developer AS build
COPY . /context
WORKDIR /context
RUN touch dev-requirements.txt && pip install --upgrade pip && pip install -c dev-requirements.txt .

# The runtime stage copies the built venv into a slim runtime container
FROM python:${PYTHON_VERSION}-slim as runtime
FROM python:${PYTHON_VERSION}-slim AS runtime
# Add apt-get system dependecies for runtime here if needed
RUN apt-get update && apt-get install -y --no-install-recommends \
# Git required for installing packages at runtime
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![CI](https://github.com/DiamondLightSource/blueapi/actions/workflows/ci.yml/badge.svg)](https://github.com/DiamondLightSource/blueapi/actions/workflows/ci.yml)
[![Coverage](https://codecov.io/gh/DiamondLightSource/blueapi/branch/main/graph/badge.svg)](https://codecov.io/gh/DiamondLightSource/blueapi)
[![PyPI](https://img.shields.io/pypi/v/blueapi.svg)](https://pypi.org/project/blueapi)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)

# blueapi

Expand Down
25 changes: 12 additions & 13 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ accessible-pygments==0.0.5
aioca==1.8.1
aiofiles==24.1.0
aiohappyeyeballs==2.4.3
aiohttp==3.10.10
aiohttp==3.11.0
aiosignal==1.3.1
alabaster==1.0.0
annotated-types==0.7.0
Expand All @@ -15,7 +15,7 @@ attrs==24.2.0
babel==2.16.0
beautifulsoup4==4.12.3
bidict==0.23.1
bluesky==1.13.0a3
bluesky==1.13
bluesky-kafka==0.10.0
bluesky-live==0.0.8
bluesky-stomp==0.1.2
Expand All @@ -33,21 +33,20 @@ colorlog==6.9.0
comm==0.2.2
compress-pickle==2.1.0
confluent-kafka==2.6.0
contourpy==1.3.0
contourpy==1.3.1
copier==9.4.1
coverage==7.6.4
cryptography==43.0.3
cycler==0.12.1
dask==2024.11.0
dask==2024.11.2
databroker==1.2.5
dataclasses-json==0.6.7
decorator==5.1.1
deepdiff==8.0.1
deepmerge==2.0
Deprecated==1.2.14
distlib==0.3.9
dls-bluesky-core==0.0.4
dls-dodal==1.34.1
dls-dodal==1.36.0
dnspython==2.7.0
docopt==0.6.2
doct==1.1.0
Expand All @@ -56,9 +55,9 @@ dunamai==1.22.0
email_validator==2.2.0
entrypoints==0.4
epicscorelibs==7.0.7.99.1.1
event-model==1.21.0
event-model==1.22.1
executing==2.1.0
fastapi==0.115.4
fastapi==0.115.5
fastapi-cli==0.0.5
fasteners==0.19
filelock==3.16.1
Expand All @@ -70,7 +69,7 @@ fsspec==2024.10.0
funcy==2.0
gitdb==4.0.11
GitPython==3.1.43
googleapis-common-protos==1.65.0
googleapis-common-protos==1.66.0
graypy==2.1.0
grpcio==1.67.1
h11==0.14.0
Expand Down Expand Up @@ -123,7 +122,7 @@ networkx==3.4.2
nodeenv==1.9.1
nose2==0.15.1
nslsii==0.10.7
numcodecs==0.13.1
numcodecs==0.14.0
numpy==1.26.4
observability-utils==0.1.4
opencv-python==4.10.0.84
Expand All @@ -142,7 +141,7 @@ opentelemetry-sdk==1.28.1
opentelemetry-semantic-conventions==0.49b1
opentelemetry-util-http==0.49b1
ophyd==1.9.0
ophyd-async==0.7.0
ophyd-async==0.8.0a4
orderly-set==5.2.2
orjson==3.10.11
p4p==4.2.0
Expand Down Expand Up @@ -209,7 +208,7 @@ ruamel.yaml.clib==0.2.12
ruff==0.7.3
scanspec==0.7.6
semver==3.0.2
setuptools==75.3.0
setuptools==75.5.0
setuptools-dso==2.11
shellingham==1.5.4
shortuuid==1.0.13
Expand Down Expand Up @@ -263,7 +262,7 @@ virtualenv==20.27.1
watchfiles==0.24.0
wcwidth==0.2.13
websocket-client==1.8.0
websockets==14.0
websockets==14.1
widgetsnbextension==4.0.13
workflows==2.28
wrapt==1.16.0
Expand Down
16 changes: 16 additions & 0 deletions docs/_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
:orphan:

..
This page is not included in the TOC tree, but must exist so that the
autosummary pages are generated for blueapi and all its
subpackages
API
===

.. autosummary::
:toctree: _api
:template: custom-module-template.rst
:recursive:

blueapi
Loading

0 comments on commit b31c275

Please sign in to comment.