daq-config-server 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. daq_config_server-0.1.0/.copier-answers.yml +16 -0
  2. daq_config_server-0.1.0/.devcontainer/devcontainer.json +46 -0
  3. daq_config_server-0.1.0/.github/CONTRIBUTING.md +27 -0
  4. daq_config_server-0.1.0/.github/actions/install_requirements/action.yml +34 -0
  5. daq_config_server-0.1.0/.github/dependabot.yml +24 -0
  6. daq_config_server-0.1.0/.github/pages/index.html +11 -0
  7. daq_config_server-0.1.0/.github/pages/make_switcher.py +94 -0
  8. daq_config_server-0.1.0/.github/workflows/_check.yml +27 -0
  9. daq_config_server-0.1.0/.github/workflows/_dist.yml +36 -0
  10. daq_config_server-0.1.0/.github/workflows/_pypi.yml +17 -0
  11. daq_config_server-0.1.0/.github/workflows/_release.yml +32 -0
  12. daq_config_server-0.1.0/.github/workflows/_test.yml +62 -0
  13. daq_config_server-0.1.0/.github/workflows/_tox.yml +22 -0
  14. daq_config_server-0.1.0/.github/workflows/backend_ci.yml +58 -0
  15. daq_config_server-0.1.0/.github/workflows/gui_ci.yml +30 -0
  16. daq_config_server-0.1.0/.gitignore +71 -0
  17. daq_config_server-0.1.0/.pre-commit-config.yaml +41 -0
  18. daq_config_server-0.1.0/.vscode/extensions.json +5 -0
  19. daq_config_server-0.1.0/.vscode/launch.json +23 -0
  20. daq_config_server-0.1.0/.vscode/settings.json +28 -0
  21. daq_config_server-0.1.0/.vscode/tasks.json +16 -0
  22. daq_config_server-0.1.0/Dockerfile +34 -0
  23. daq_config_server-0.1.0/LICENSE +201 -0
  24. daq_config_server-0.1.0/PKG-INFO +306 -0
  25. daq_config_server-0.1.0/README.md +74 -0
  26. daq_config_server-0.1.0/catalog-info.yaml +10 -0
  27. daq_config_server-0.1.0/deployment/build_and_push_all.sh +107 -0
  28. daq_config_server-0.1.0/dev-values.yaml +10 -0
  29. daq_config_server-0.1.0/gui/config-server-gui/.gitignore +23 -0
  30. daq_config_server-0.1.0/gui/config-server-gui/Dockerfile +2 -0
  31. daq_config_server-0.1.0/gui/config-server-gui/README.md +59 -0
  32. daq_config_server-0.1.0/gui/config-server-gui/build_container.sh +6 -0
  33. daq_config_server-0.1.0/gui/config-server-gui/package.json +55 -0
  34. daq_config_server-0.1.0/gui/config-server-gui/public/favicon.ico +0 -0
  35. daq_config_server-0.1.0/gui/config-server-gui/public/index.html +40 -0
  36. daq_config_server-0.1.0/gui/config-server-gui/public/logo192.png +0 -0
  37. daq_config_server-0.1.0/gui/config-server-gui/public/logo512.png +0 -0
  38. daq_config_server-0.1.0/gui/config-server-gui/public/manifest.json +25 -0
  39. daq_config_server-0.1.0/gui/config-server-gui/public/robots.txt +3 -0
  40. daq_config_server-0.1.0/gui/config-server-gui/src/App.test.tsx +9 -0
  41. daq_config_server-0.1.0/gui/config-server-gui/src/App.tsx +235 -0
  42. daq_config_server-0.1.0/gui/config-server-gui/src/ColorModeSwitcher.tsx +25 -0
  43. daq_config_server-0.1.0/gui/config-server-gui/src/communication.ts +53 -0
  44. daq_config_server-0.1.0/gui/config-server-gui/src/index.tsx +27 -0
  45. daq_config_server-0.1.0/gui/config-server-gui/src/logo.svg +11 -0
  46. daq_config_server-0.1.0/gui/config-server-gui/src/react-app-env.d.ts +1 -0
  47. daq_config_server-0.1.0/gui/config-server-gui/src/reportWebVitals.ts +15 -0
  48. daq_config_server-0.1.0/gui/config-server-gui/src/serviceWorker.ts +142 -0
  49. daq_config_server-0.1.0/gui/config-server-gui/src/setupTests.ts +5 -0
  50. daq_config_server-0.1.0/gui/config-server-gui/src/test-utils.tsx +12 -0
  51. daq_config_server-0.1.0/gui/config-server-gui/src/themes.ts +13 -0
  52. daq_config_server-0.1.0/gui/config-server-gui/src/types.ts +13 -0
  53. daq_config_server-0.1.0/gui/config-server-gui/tsconfig.json +20 -0
  54. daq_config_server-0.1.0/helmchart/.helmignore +23 -0
  55. daq_config_server-0.1.0/helmchart/Chart.yaml +10 -0
  56. daq_config_server-0.1.0/helmchart/charts/appIngress/Chart.yaml +6 -0
  57. daq_config_server-0.1.0/helmchart/charts/appIngress/templates/ingress.yaml +27 -0
  58. daq_config_server-0.1.0/helmchart/templates/NOTES.txt +8 -0
  59. daq_config_server-0.1.0/helmchart/templates/configmap.yaml +6 -0
  60. daq_config_server-0.1.0/helmchart/templates/deployment.yaml +56 -0
  61. daq_config_server-0.1.0/helmchart/templates/service.yaml +17 -0
  62. daq_config_server-0.1.0/helmchart/templates/storage.yaml +10 -0
  63. daq_config_server-0.1.0/helmchart/values.yaml +93 -0
  64. daq_config_server-0.1.0/package-lock.json +21662 -0
  65. daq_config_server-0.1.0/package.json +15 -0
  66. daq_config_server-0.1.0/pyproject.toml +103 -0
  67. daq_config_server-0.1.0/setup.cfg +4 -0
  68. daq_config_server-0.1.0/src/daq_config_server/__init__.py +3 -0
  69. daq_config_server-0.1.0/src/daq_config_server/__main__.py +37 -0
  70. daq_config_server-0.1.0/src/daq_config_server/_version.py +16 -0
  71. daq_config_server-0.1.0/src/daq_config_server/app.py +144 -0
  72. daq_config_server-0.1.0/src/daq_config_server/beamline_parameters.py +86 -0
  73. daq_config_server-0.1.0/src/daq_config_server/client.py +87 -0
  74. daq_config_server-0.1.0/src/daq_config_server/constants.py +18 -0
  75. daq_config_server-0.1.0/src/daq_config_server.egg-info/PKG-INFO +306 -0
  76. daq_config_server-0.1.0/src/daq_config_server.egg-info/SOURCES.txt +84 -0
  77. daq_config_server-0.1.0/src/daq_config_server.egg-info/dependency_links.txt +1 -0
  78. daq_config_server-0.1.0/src/daq_config_server.egg-info/entry_points.txt +2 -0
  79. daq_config_server-0.1.0/src/daq_config_server.egg-info/requires.txt +19 -0
  80. daq_config_server-0.1.0/src/daq_config_server.egg-info/top_level.txt +1 -0
  81. daq_config_server-0.1.0/tests/conftest.py +15 -0
  82. daq_config_server-0.1.0/tests/test_api.py +67 -0
  83. daq_config_server-0.1.0/tests/test_cli.py +9 -0
  84. daq_config_server-0.1.0/tests/test_data/beamline_parameters.txt +299 -0
  85. daq_config_server-0.1.0/valkey/Dockerfile +4 -0
  86. daq_config_server-0.1.0/valkey/valkey.conf +2321 -0
@@ -0,0 +1,16 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: 2.1.0
3
+ _src_path: gh:DiamondLightSource/python-copier-template
4
+ author_email: david.perl@diamond.ac.uk
5
+ author_name: David Perl
6
+ component_owner: group:default/sscc
7
+ description: A service to put and get your config values from
8
+ distribution_name: daq-config-server
9
+ docker: false
10
+ docs_type: README
11
+ git_platform: github.com
12
+ github_org: DiamondLightSource
13
+ package_name: daq_config_server
14
+ pypi: true
15
+ repo_name: daq-config-server
16
+ type_checker: pyright
@@ -0,0 +1,46 @@
1
+ // For format details, see https://containers.dev/implementors/json_reference/
2
+ {
3
+ "name": "Python 3 Developer Container",
4
+ "build": {
5
+ "dockerfile": "../Dockerfile",
6
+ "target": "developer"
7
+ },
8
+ "remoteEnv": {
9
+ // Allow X11 apps to run inside the container
10
+ "DISPLAY": "${localEnv:DISPLAY}"
11
+ },
12
+ "customizations": {
13
+ "vscode": {
14
+ // Set *default* container specific settings.json values on container create.
15
+ "settings": {
16
+ "python.defaultInterpreterPath": "/venv/bin/python"
17
+ },
18
+ // Add the IDs of extensions you want installed when the container is created.
19
+ "extensions": [
20
+ "ms-python.python",
21
+ "github.vscode-github-actions",
22
+ "tamasfe.even-better-toml",
23
+ "redhat.vscode-yaml",
24
+ "ryanluker.vscode-coverage-gutters",
25
+ "charliermarsh.ruff",
26
+ "ms-azuretools.vscode-docker"
27
+ ]
28
+ }
29
+ },
30
+ "features": {
31
+ // Some default things like git config
32
+ "ghcr.io/devcontainers/features/common-utils:2": {
33
+ "upgradePackages": false
34
+ }
35
+ },
36
+ "runArgs": [
37
+ // Allow the container to access the host X11 display and EPICS CA
38
+ "--net=host",
39
+ // Make sure SELinux does not disable with access to host filesystems like tmp
40
+ "--security-opt=label=disable"
41
+ ],
42
+ // Mount the parent as /workspaces so we can pip install peers as editable
43
+ "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
44
+ // After the container is created, install the python project in editable form
45
+ "postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e '.[dev]' && pre-commit install"
46
+ }
@@ -0,0 +1,27 @@
1
+ # Contribute to the project
2
+
3
+ Contributions and issues are most welcome! All issues and pull requests are
4
+ handled through [GitHub](https://github.com/DiamondLightSource/daq-config-server/issues). Also, please check for any existing issues before
5
+ filing a new one. If you have a great idea but it involves big changes, please
6
+ file a ticket before making a pull request! We want to make sure you don't spend
7
+ your time coding something that might not fit the scope of the project.
8
+
9
+ ## Issue or Discussion?
10
+
11
+ Github also offers [discussions](https://github.com/DiamondLightSource/daq-config-server/discussions) as a place to ask questions and share ideas. If
12
+ your issue is open ended and it is not obvious when it can be "closed", please
13
+ raise it as a discussion instead.
14
+
15
+ ## Code Coverage
16
+
17
+ While 100% code coverage does not make a library bug-free, it significantly
18
+ reduces the number of easily caught bugs! Please make sure coverage remains the
19
+ same or is improved by a pull request!
20
+
21
+ ## Developer Information
22
+
23
+ It is recommended that developers use a [vscode devcontainer](https://code.visualstudio.com/docs/devcontainers/containers). This repository contains configuration to set up a containerized development environment that suits its own needs.
24
+
25
+ This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
26
+
27
+ 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.1.0/how-to.html).
@@ -0,0 +1,34 @@
1
+ name: Install requirements
2
+ description: Install a version of python then call pip install and report what was installed
3
+ inputs:
4
+ python-version:
5
+ description: Python version to install, default is from Dockerfile
6
+ default: "dev"
7
+ pip-install:
8
+ description: Parameters to pass to pip install
9
+ default: "$([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e .[dev,server]"
10
+
11
+ runs:
12
+ using: composite
13
+ steps:
14
+ - name: Get version of python
15
+ run: |
16
+ PYTHON_VERSION="${{ inputs.python-version }}"
17
+ if [ $PYTHON_VERSION == "dev" ]; then
18
+ PYTHON_VERSION=$(sed -n "s/ARG PYTHON_VERSION=//p" Dockerfile)
19
+ fi
20
+ echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
21
+ shell: bash
22
+
23
+ - name: Setup python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: ${{ env.PYTHON_VERSION }}
27
+
28
+ - name: Install packages
29
+ run: pip install ${{ inputs.pip-install }}
30
+ shell: bash
31
+
32
+ - name: Report what was installed
33
+ run: pip freeze
34
+ shell: bash
@@ -0,0 +1,24 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ groups:
13
+ actions:
14
+ patterns:
15
+ - "*"
16
+
17
+ - package-ecosystem: "pip"
18
+ directory: "/"
19
+ schedule:
20
+ interval: "weekly"
21
+ groups:
22
+ dev-dependencies:
23
+ patterns:
24
+ - "*"
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <title>Redirecting to main branch</title>
6
+ <meta charset="utf-8">
7
+ <meta http-equiv="refresh" content="0; url=./main/index.html">
8
+ <link rel="canonical" href="main/index.html">
9
+ </head>
10
+
11
+ </html>
@@ -0,0 +1,94 @@
1
+ import json
2
+ import logging
3
+ from argparse import ArgumentParser
4
+ from pathlib import Path
5
+ from subprocess import CalledProcessError, check_output
6
+
7
+
8
+ def report_output(stdout: bytes, label: str) -> list[str]:
9
+ ret = stdout.decode().strip().split("\n")
10
+ print(f"{label}: {ret}")
11
+ return ret
12
+
13
+
14
+ def get_branch_contents(ref: str) -> list[str]:
15
+ """Get the list of directories in a branch."""
16
+ stdout = check_output(["git", "ls-tree", "-d", "--name-only", ref])
17
+ return report_output(stdout, "Branch contents")
18
+
19
+
20
+ def get_sorted_tags_list() -> list[str]:
21
+ """Get a list of sorted tags in descending order from the repository."""
22
+ stdout = check_output(["git", "tag", "-l", "--sort=-v:refname"])
23
+ return report_output(stdout, "Tags list")
24
+
25
+
26
+ def get_versions(ref: str, add: str | None) -> list[str]:
27
+ """Generate the file containing the list of all GitHub Pages builds."""
28
+ # Get the directories (i.e. builds) from the GitHub Pages branch
29
+ try:
30
+ builds = set(get_branch_contents(ref))
31
+ except CalledProcessError:
32
+ builds = set()
33
+ logging.warning(f"Cannot get {ref} contents")
34
+
35
+ # Add and remove from the list of builds
36
+ if add:
37
+ builds.add(add)
38
+
39
+ # Get a sorted list of tags
40
+ tags = get_sorted_tags_list()
41
+
42
+ # Make the sorted versions list from main branches and tags
43
+ versions: list[str] = []
44
+ for version in ["master", "main"] + tags:
45
+ if version in builds:
46
+ versions.append(version)
47
+ builds.remove(version)
48
+
49
+ # Add in anything that is left to the bottom
50
+ versions += sorted(builds)
51
+ print(f"Sorted versions: {versions}")
52
+ return versions
53
+
54
+
55
+ def write_json(path: Path, repository: str, versions: str):
56
+ org, repo_name = repository.split("/")
57
+ pages_url = f"https://{org}.github.io"
58
+ if repo_name != f"{org}.github.io":
59
+ # Only add the repo name if it isn't the source for the org pages site
60
+ pages_url += f"/{repo_name}"
61
+ struct = [
62
+ {"version": version, "url": f"{pages_url}/{version}/"} for version in versions
63
+ ]
64
+ text = json.dumps(struct, indent=2)
65
+ print(f"JSON switcher:\n{text}")
66
+ path.write_text(text, encoding="utf-8")
67
+
68
+
69
+ def main(args=None):
70
+ parser = ArgumentParser(
71
+ description="Make a versions.json file from gh-pages directories"
72
+ )
73
+ parser.add_argument(
74
+ "--add",
75
+ help="Add this directory to the list of existing directories",
76
+ )
77
+ parser.add_argument(
78
+ "repository",
79
+ help="The GitHub org and repository name: ORG/REPO",
80
+ )
81
+ parser.add_argument(
82
+ "output",
83
+ type=Path,
84
+ help="Path of write switcher.json to",
85
+ )
86
+ args = parser.parse_args(args)
87
+
88
+ # Write the versions file
89
+ versions = get_versions("origin/gh-pages", args.add)
90
+ write_json(args.output, args.repository, versions)
91
+
92
+
93
+ if __name__ == "__main__":
94
+ main()
@@ -0,0 +1,27 @@
1
+ on:
2
+ workflow_call:
3
+ outputs:
4
+ branch-pr:
5
+ description: The PR number if the branch is in one
6
+ value: ${{ jobs.pr.outputs.branch-pr }}
7
+
8
+ jobs:
9
+ pr:
10
+ runs-on: "ubuntu-latest"
11
+ outputs:
12
+ branch-pr: ${{ steps.script.outputs.result }}
13
+ steps:
14
+ - uses: actions/github-script@v7
15
+ id: script
16
+ if: github.event_name == 'push'
17
+ with:
18
+ script: |
19
+ const prs = await github.rest.pulls.list({
20
+ owner: context.repo.owner,
21
+ repo: context.repo.repo,
22
+ head: context.repo.owner + ':${{ github.ref_name }}'
23
+ })
24
+ if (prs.data.length) {
25
+ console.log(`::notice ::Skipping CI on branch push as it is already run in PR #${prs.data[0]["number"]}`)
26
+ return prs.data[0]["number"]
27
+ }
@@ -0,0 +1,36 @@
1
+ on:
2
+ workflow_call:
3
+
4
+ jobs:
5
+ build:
6
+ runs-on: "ubuntu-latest"
7
+
8
+ steps:
9
+ - name: Checkout
10
+ uses: actions/checkout@v4
11
+ with:
12
+ # Need this to get version number from last tag
13
+ fetch-depth: 0
14
+
15
+ - name: Build sdist and wheel
16
+ run: >
17
+ export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
18
+ pipx run build
19
+
20
+ - name: Upload sdist and wheel as artifacts
21
+ uses: actions/upload-artifact@v4
22
+ with:
23
+ name: dist
24
+ path: dist
25
+
26
+ - name: Check for packaging errors
27
+ run: pipx run twine check --strict dist/*
28
+
29
+ - name: Install produced wheel
30
+ uses: ./.github/actions/install_requirements
31
+ with:
32
+ pip-install: dist/*.whl
33
+
34
+ - name: Test module --version works using the installed wheel
35
+ # If more than one module in src/ replace with module name to test
36
+ run: python -m $(ls --hide='*.egg-info' src | head -1) --version
@@ -0,0 +1,17 @@
1
+ on:
2
+ workflow_call:
3
+
4
+ jobs:
5
+ upload:
6
+ runs-on: ubuntu-latest
7
+ environment: release
8
+
9
+ steps:
10
+ - name: Download dist artifact
11
+ uses: actions/download-artifact@v4
12
+ with:
13
+ name: dist
14
+ path: dist
15
+
16
+ - name: Publish to PyPI using trusted publishing
17
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,32 @@
1
+ on:
2
+ workflow_call:
3
+
4
+ jobs:
5
+ artifacts:
6
+ runs-on: ubuntu-latest
7
+
8
+ steps:
9
+ - name: Download artifacts
10
+ uses: actions/download-artifact@v4
11
+ with:
12
+ merge-multiple: true
13
+
14
+ - name: Zip up docs
15
+ run: |
16
+ set -vxeuo pipefail
17
+ if [ -d html ]; then
18
+ mv html $GITHUB_REF_NAME
19
+ zip -r docs.zip $GITHUB_REF_NAME
20
+ rm -rf $GITHUB_REF_NAME
21
+ fi
22
+
23
+ - name: Create GitHub Release
24
+ # We pin to the SHA, not the tag, for security reasons.
25
+ # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
26
+ uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
27
+ with:
28
+ prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
29
+ files: "*"
30
+ generate_release_notes: true
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,62 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ python-version:
5
+ type: string
6
+ description: The version of python to install
7
+ required: true
8
+ runs-on:
9
+ type: string
10
+ description: The runner to run this job on
11
+ required: true
12
+ secrets:
13
+ CODECOV_TOKEN:
14
+ required: true
15
+
16
+ env:
17
+ # https://github.com/pytest-dev/pytest/issues/2042
18
+ PY_IGNORE_IMPORTMISMATCH: "1"
19
+
20
+ jobs:
21
+ run:
22
+ runs-on: ${{ inputs.runs-on }}
23
+
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v4
27
+ with:
28
+ # Need this to get version number from last tag
29
+ fetch-depth: 0
30
+
31
+ - if: inputs.python-version == 'dev'
32
+ name: Install dev versions of python packages
33
+ uses: ./.github/actions/install_requirements
34
+
35
+ - if: inputs.python-version == 'dev'
36
+ name: Write the requirements as an artifact
37
+ run: pip freeze --exclude-editable > /tmp/dev-requirements.txt
38
+
39
+ - if: inputs.python-version == 'dev'
40
+ name: Upload dev-requirements.txt
41
+ uses: actions/upload-artifact@v4
42
+ with:
43
+ name: dev-requirements
44
+ path: /tmp/dev-requirements.txt
45
+
46
+ - if: inputs.python-version != 'dev'
47
+ name: Install latest versions of python packages
48
+ uses: ./.github/actions/install_requirements
49
+ with:
50
+ python-version: ${{ inputs.python-version }}
51
+ pip-install: ".[dev,server]"
52
+
53
+ - name: Run tests
54
+ run: tox -e tests
55
+
56
+ - name: Upload coverage to Codecov
57
+ uses: codecov/codecov-action@v4
58
+ with:
59
+ name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
60
+ files: cov.xml
61
+ env:
62
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,22 @@
1
+ on:
2
+ workflow_call:
3
+ inputs:
4
+ tox:
5
+ type: string
6
+ description: What to run under tox
7
+ required: true
8
+
9
+
10
+ jobs:
11
+ run:
12
+ runs-on: "ubuntu-latest"
13
+
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Install python packages
19
+ uses: ./.github/actions/install_requirements
20
+
21
+ - name: Run tox
22
+ run: tox -e ${{ inputs.tox }}
@@ -0,0 +1,58 @@
1
+ name: backend CI
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - gui/**
7
+ pull_request:
8
+ paths:
9
+ - gui/**
10
+
11
+ jobs:
12
+ check:
13
+ uses: ./.github/workflows/_check.yml
14
+
15
+ lint:
16
+ needs: check
17
+ if: needs.check.outputs.branch-pr == ''
18
+ uses: ./.github/workflows/_tox.yml
19
+ with:
20
+ tox: pre-commit,type-checking
21
+
22
+ test:
23
+ needs: check
24
+ if: needs.check.outputs.branch-pr == ''
25
+ strategy:
26
+ matrix:
27
+ runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
28
+ python-version: ["3.11"] # Should run with 3.12 once not dependent on Dodal for constants
29
+ include:
30
+ # Include one that runs in the dev environment
31
+ - runs-on: "ubuntu-latest"
32
+ python-version: "dev"
33
+ fail-fast: false
34
+ uses: ./.github/workflows/_test.yml
35
+ with:
36
+ runs-on: ${{ matrix.runs-on }}
37
+ python-version: ${{ matrix.python-version }}
38
+ secrets:
39
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40
+
41
+ dist:
42
+ needs: check
43
+ if: needs.check.outputs.branch-pr == ''
44
+ uses: ./.github/workflows/_dist.yml
45
+
46
+ pypi:
47
+ if: github.ref_type == 'tag'
48
+ needs: dist
49
+ uses: ./.github/workflows/_pypi.yml
50
+ permissions:
51
+ id-token: write
52
+
53
+ release:
54
+ if: github.ref_type == 'tag'
55
+ needs: [dist]
56
+ uses: ./.github/workflows/_release.yml
57
+ permissions:
58
+ contents: write
@@ -0,0 +1,30 @@
1
+ name: GUI CI
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - src/**
7
+ - tests/**
8
+ pull_request:
9
+ paths:
10
+ - src/**
11
+ - tests/**
12
+
13
+ jobs:
14
+ build:
15
+
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ matrix:
20
+ node-version: [18.x, 20.x]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - name: Use Node.js ${{ matrix.node-version }}
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: ${{ matrix.node-version }}
28
+ - run: npm ci
29
+ - run: npm run build --if-present
30
+ - run: npm test
@@ -0,0 +1,71 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+
5
+ # C extensions
6
+ *.so
7
+
8
+ # Distribution / packaging
9
+ .Python
10
+ env/
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ **/_version.py
26
+
27
+ # PyInstaller
28
+ # Usually these files are written by a python script from a template
29
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .coverage
41
+ .coverage.*
42
+ .cache
43
+ nosetests.xml
44
+ coverage.xml
45
+ cov.xml
46
+ .pytest_cache/
47
+ .mypy_cache/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Django stuff:
54
+ *.log
55
+
56
+ # Sphinx documentation
57
+ docs/_build/
58
+
59
+ # PyBuilder
60
+ target/
61
+
62
+ # likely venv names
63
+ .venv*
64
+ venv*
65
+
66
+ # further build artifacts
67
+ lockfiles/
68
+
69
+ # ruff cache
70
+ .ruff_cache/
71
+ node_modules
@@ -0,0 +1,41 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ - id: check-yaml
7
+ args: [--allow-multiple-documents]
8
+ exclude: ^helmchart/
9
+ - id: check-merge-conflict
10
+
11
+ - repo: local
12
+ hooks:
13
+ - id: ruff
14
+ name: lint with ruff
15
+ language: system
16
+ entry: ruff check --force-exclude
17
+ types: [python]
18
+ exclude: ^.github/pages
19
+ require_serial: true
20
+
21
+ - id: ruff-format
22
+ name: format with ruff
23
+ language: system
24
+ entry: ruff format --force-exclude
25
+ exclude: ^.github/pages
26
+ types: [python]
27
+ require_serial: true
28
+
29
+ - id: prettier
30
+ name: format js/ts(x) with prettier
31
+ language: system
32
+ entry: npx prettier gui/config-server-gui/ --print-width 100 --write
33
+ types: [javascript,jsx,ts,tsx]
34
+ require_serial: true
35
+
36
+ - id: eslint
37
+ name: lint with eslint
38
+ language: system
39
+ entry: npx eslint gui/config-server-gui/src
40
+ types: [javascript,jsx,ts,tsx]
41
+ require_serial: true
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "ms-vscode-remote.remote-containers",
4
+ ]
5
+ }