rtems-proxy 1.2.0__tar.gz → 1.3.0b2__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.
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.copier-answers.yml +6 -4
- rtems_proxy-1.3.0b2/.devcontainer/devcontainer.json +73 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/CONTRIBUTING.md +1 -1
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- rtems_proxy-1.3.0b2/.github/copilot-instructions.md +44 -0
- rtems_proxy-1.3.0b2/.github/workflows/_container.yml +87 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/workflows/_dist.yml +7 -6
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/workflows/_pypi.yml +1 -1
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/workflows/_release.yml +2 -2
- rtems_proxy-1.3.0b2/.github/workflows/_test.yml +39 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/workflows/_tox.yml +4 -4
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/workflows/ci.yml +17 -17
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.gitignore +0 -3
- rtems_proxy-1.3.0b2/.gitleaks.toml +19 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.pre-commit-config.yaml +16 -2
- rtems_proxy-1.3.0b2/.python-version +1 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.vscode/launch.json +0 -4
- rtems_proxy-1.3.0b2/Dockerfile +45 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/PKG-INFO +37 -13
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/README.md +33 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/pyproject.toml +72 -31
- rtems_proxy-1.3.0b2/renovate.json +40 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/__main__.py +4 -1
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/_version.py +3 -3
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/configure.py +7 -1
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/telnet.py +8 -6
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/utils.py +2 -2
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy.egg-info/PKG-INFO +37 -13
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy.egg-info/SOURCES.txt +6 -3
- rtems_proxy-1.3.0b2/src/rtems_proxy.egg-info/requires.txt +6 -0
- rtems_proxy-1.3.0b2/tests/conftest.py +0 -0
- rtems_proxy-1.3.0b2/uv.lock +1022 -0
- rtems_proxy-1.2.0/.devcontainer/devcontainer.json +0 -45
- rtems_proxy-1.2.0/.github/actions/install_requirements/action.yml +0 -34
- rtems_proxy-1.2.0/.github/dependabot.yml +0 -24
- rtems_proxy-1.2.0/.github/workflows/_check.yml +0 -27
- rtems_proxy-1.2.0/.github/workflows/_test.yml +0 -62
- rtems_proxy-1.2.0/Dockerfile +0 -29
- rtems_proxy-1.2.0/src/rtems_proxy.egg-info/requires.txt +0 -16
- rtems_proxy-1.2.0/tests/conftest.py +0 -21
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/ISSUE_TEMPLATE/issue.md +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/pages/index.html +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.github/pages/make_switcher.py +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.vscode/extensions.json +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.vscode/settings.json +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/.vscode/tasks.json +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/LICENSE +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/requirements.txt +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/setup.cfg +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/__init__.py +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/copy.py +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/globals.py +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/rsync.sh.jinja +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy/trace.py +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy.egg-info/dependency_links.txt +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy.egg-info/entry_points.txt +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/src/rtems_proxy.egg-info/top_level.txt +0 -0
- {rtems_proxy-1.2.0 → rtems_proxy-1.3.0b2}/tests/test_cli.py +0 -0
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# Changes here will be overwritten by Copier
|
|
2
|
-
_commit:
|
|
3
|
-
_src_path:
|
|
2
|
+
_commit: 5.0.1
|
|
3
|
+
_src_path: https://github.com/DiamondLightSource/python-copier-template
|
|
4
4
|
author_email: giles.knap@diamond.ac.uk
|
|
5
5
|
author_name: Giles Knap
|
|
6
6
|
description: Support for a K8S proxy container in controlling and monitoring RTEMS
|
|
7
7
|
EPICS IOCs
|
|
8
8
|
distribution_name: rtems-proxy
|
|
9
|
-
docker:
|
|
9
|
+
docker: true
|
|
10
|
+
docker_debug: false
|
|
10
11
|
docs_type: README
|
|
11
12
|
git_platform: github.com
|
|
12
13
|
github_org: epics-containers
|
|
13
14
|
package_name: rtems_proxy
|
|
14
15
|
pypi: true
|
|
15
16
|
repo_name: rtems-proxy
|
|
16
|
-
|
|
17
|
+
strict_typing: false
|
|
18
|
+
type_checker: pyright
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
// Do the equivalent of "activate" the venv so we don't have to "uv run" everything
|
|
12
|
+
"VIRTUAL_ENV": "/workspaces/${localWorkspaceFolderBasename}/.venv",
|
|
13
|
+
"PATH": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin:${containerEnv:PATH}"
|
|
14
|
+
},
|
|
15
|
+
"customizations": {
|
|
16
|
+
"vscode": {
|
|
17
|
+
// Set *default* container specific settings.json values on container create.
|
|
18
|
+
"settings": {
|
|
19
|
+
// Use the container's python by default
|
|
20
|
+
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
|
|
21
|
+
// Don't activate the venv as it is already in the PATH
|
|
22
|
+
"python.terminal.activateEnvInCurrentTerminal": false,
|
|
23
|
+
"python.terminal.activateEnvironment": false,
|
|
24
|
+
// Workaround to prevent garbled python REPL in the terminal
|
|
25
|
+
// https://github.com/microsoft/vscode-python/issues/25505
|
|
26
|
+
"python.terminal.shellIntegration.enabled": false
|
|
27
|
+
},
|
|
28
|
+
// Add the IDs of extensions you want installed when the container is created.
|
|
29
|
+
"extensions": [
|
|
30
|
+
"ms-python.python",
|
|
31
|
+
"github.vscode-github-actions",
|
|
32
|
+
"tamasfe.even-better-toml",
|
|
33
|
+
"redhat.vscode-yaml",
|
|
34
|
+
"ryanluker.vscode-coverage-gutters",
|
|
35
|
+
"charliermarsh.ruff",
|
|
36
|
+
"ms-azuretools.vscode-docker"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
// Create the config folder for the bash-config feature and uv cache
|
|
41
|
+
// NOTE: The uv cache can get large, DLS users should read
|
|
42
|
+
// https://dev-guide.diamond.ac.uk/linux-user-environment/how-tos/disk-quota-troubleshooting
|
|
43
|
+
"initializeCommand": "mkdir -p ${localEnv:HOME}/.config/terminal-config ${localEnv:HOME}/.cache/uv",
|
|
44
|
+
"runArgs": [
|
|
45
|
+
// Allow the container to access the host X11 display and EPICS CA
|
|
46
|
+
"--net=host",
|
|
47
|
+
// Make sure SELinux does not disable with access to host filesystems like tmp
|
|
48
|
+
"--security-opt=label=disable"
|
|
49
|
+
],
|
|
50
|
+
"mounts": [
|
|
51
|
+
// Mount in the user terminal config folder so it can be edited
|
|
52
|
+
{
|
|
53
|
+
"source": "${localEnv:HOME}/.config/terminal-config",
|
|
54
|
+
"target": "/user-terminal-config",
|
|
55
|
+
"type": "bind"
|
|
56
|
+
},
|
|
57
|
+
// Keep a persistent cross container cache for uv
|
|
58
|
+
{
|
|
59
|
+
"source": "${localEnv:HOME}/.cache/uv",
|
|
60
|
+
"target": "/root/.cache/uv",
|
|
61
|
+
"type": "bind"
|
|
62
|
+
},
|
|
63
|
+
// Use a volume mount for the uv venv so it is local to the container
|
|
64
|
+
{
|
|
65
|
+
"target": "/workspaces/${localWorkspaceFolderBasename}/.venv",
|
|
66
|
+
"type": "volume"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
// Mount the parent as /workspaces so we can pip install peers as editable
|
|
70
|
+
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
|
|
71
|
+
// After the container is created, install the python project in editable form
|
|
72
|
+
"postCreateCommand": "uv sync && uv run pre-commit install --install-hooks"
|
|
73
|
+
}
|
|
@@ -24,4 +24,4 @@ It is recommended that developers use a [vscode devcontainer](https://code.visua
|
|
|
24
24
|
|
|
25
25
|
This project was created using the [Diamond Light Source Copier Template](https://github.com/DiamondLightSource/python-copier-template) for Python projects.
|
|
26
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/
|
|
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/5.0.1/how-to.html).
|
|
@@ -7,7 +7,7 @@ assignees: ''
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
Describe the bug, including a clear and concise description of the expected
|
|
10
|
+
Describe the bug, including a clear and concise description of the expected behaviour, the actual behavior and the context in which you encountered it (ideally include details of your environment).
|
|
11
11
|
|
|
12
12
|
## Steps To Reproduce
|
|
13
13
|
Steps to reproduce the behavior:
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# GitHub Copilot Instructions for rtems-proxy
|
|
2
|
+
|
|
3
|
+
## Development Environment
|
|
4
|
+
|
|
5
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management and task running.
|
|
6
|
+
|
|
7
|
+
## Running Tests and Checks
|
|
8
|
+
|
|
9
|
+
Always use `uv` to run tox commands:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Run all checks in parallel
|
|
13
|
+
uv run tox -p
|
|
14
|
+
|
|
15
|
+
# Run specific environment
|
|
16
|
+
uv run tox -e type-checking
|
|
17
|
+
uv run tox -e tests
|
|
18
|
+
uv run tox -e pre-commit
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Type Checking
|
|
22
|
+
|
|
23
|
+
- Run type checking with: `uv run pyright src tests`
|
|
24
|
+
- Or via tox: `uv run tox -e type-checking`
|
|
25
|
+
- Always fix type errors before committing
|
|
26
|
+
|
|
27
|
+
## Installing Dependencies
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Install all dependencies including dev dependencies
|
|
31
|
+
uv sync --group dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Code Style
|
|
35
|
+
|
|
36
|
+
- This project uses `ruff` for linting and formatting
|
|
37
|
+
- Run `uv run tox -e pre-commit` to check formatting
|
|
38
|
+
- Pre-commit hooks will auto-format code
|
|
39
|
+
|
|
40
|
+
## Important Notes
|
|
41
|
+
|
|
42
|
+
- Do NOT run `tox` directly - always use `uv run tox`
|
|
43
|
+
- Do NOT run `pytest` or `pyright` directly - use `uv run` prefix or tox environments
|
|
44
|
+
- All external tools (pytest, pyright, pre-commit) are configured in `pyproject.toml` with `allowlist_externals`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
on:
|
|
2
|
+
workflow_call:
|
|
3
|
+
inputs:
|
|
4
|
+
publish:
|
|
5
|
+
type: boolean
|
|
6
|
+
description: If true, pushes image to container registry
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v5
|
|
15
|
+
with:
|
|
16
|
+
# Need this to get version number from last tag
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Set up Docker Buildx
|
|
20
|
+
id: buildx
|
|
21
|
+
uses: docker/setup-buildx-action@v3
|
|
22
|
+
|
|
23
|
+
- name: Log in to GitHub Docker Registry
|
|
24
|
+
if: github.event_name != 'pull_request'
|
|
25
|
+
uses: docker/login-action@v3
|
|
26
|
+
with:
|
|
27
|
+
registry: ghcr.io
|
|
28
|
+
username: ${{ github.actor }}
|
|
29
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
+
|
|
31
|
+
- name: Build and export to Docker local cache
|
|
32
|
+
uses: docker/build-push-action@v6
|
|
33
|
+
env:
|
|
34
|
+
DOCKER_BUILD_RECORD_UPLOAD: false
|
|
35
|
+
with:
|
|
36
|
+
context: .
|
|
37
|
+
# Need load and tags so we can test it below
|
|
38
|
+
load: true
|
|
39
|
+
tags: tag_for_testing
|
|
40
|
+
|
|
41
|
+
- name: Test cli works in cached runtime image
|
|
42
|
+
run: docker run --rm tag_for_testing --version
|
|
43
|
+
|
|
44
|
+
- name: Create tags for publishing image
|
|
45
|
+
id: meta
|
|
46
|
+
uses: docker/metadata-action@v5
|
|
47
|
+
with:
|
|
48
|
+
images: ghcr.io/${{ github.repository }}-runtime
|
|
49
|
+
tags: |
|
|
50
|
+
type=ref,event=tag
|
|
51
|
+
type=raw,value=latest
|
|
52
|
+
|
|
53
|
+
- name: Push cached image to container registry
|
|
54
|
+
if: inputs.publish && github.ref_type == 'tag'
|
|
55
|
+
uses: docker/build-push-action@v6
|
|
56
|
+
env:
|
|
57
|
+
DOCKER_BUILD_RECORD_UPLOAD: false
|
|
58
|
+
# This does not build the image again, it will find the image in the
|
|
59
|
+
# Docker cache and publish it
|
|
60
|
+
with:
|
|
61
|
+
context: .
|
|
62
|
+
push: true
|
|
63
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
64
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
65
|
+
|
|
66
|
+
- name: Create tags for publishing image
|
|
67
|
+
id: meta-developer
|
|
68
|
+
uses: docker/metadata-action@v5
|
|
69
|
+
with:
|
|
70
|
+
images: ghcr.io/${{ github.repository }}-developer
|
|
71
|
+
tags: |
|
|
72
|
+
type=ref,event=tag
|
|
73
|
+
type=raw,value=latest
|
|
74
|
+
|
|
75
|
+
- name: Push cached developer (build target) image to container registry
|
|
76
|
+
if: inputs.publish && github.ref_type == 'tag'
|
|
77
|
+
uses: docker/build-push-action@v6
|
|
78
|
+
env:
|
|
79
|
+
DOCKER_BUILD_RECORD_UPLOAD: false
|
|
80
|
+
# This does not build the image again, it will find the image in the
|
|
81
|
+
# Docker cache and publish it
|
|
82
|
+
with:
|
|
83
|
+
context: .
|
|
84
|
+
target: build
|
|
85
|
+
push: true
|
|
86
|
+
tags: ${{ steps.meta-developer.outputs.tags }}
|
|
87
|
+
labels: ${{ steps.meta-developer.outputs.labels }}
|
|
@@ -7,15 +7,18 @@ jobs:
|
|
|
7
7
|
|
|
8
8
|
steps:
|
|
9
9
|
- name: Checkout
|
|
10
|
-
uses: actions/checkout@
|
|
10
|
+
uses: actions/checkout@v5
|
|
11
11
|
with:
|
|
12
12
|
# Need this to get version number from last tag
|
|
13
13
|
fetch-depth: 0
|
|
14
14
|
|
|
15
|
+
- name: Install uv
|
|
16
|
+
uses: astral-sh/setup-uv@v7
|
|
17
|
+
|
|
15
18
|
- name: Build sdist and wheel
|
|
16
19
|
run: >
|
|
17
20
|
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) &&
|
|
18
|
-
|
|
21
|
+
uvx --from build pyproject-build
|
|
19
22
|
|
|
20
23
|
- name: Upload sdist and wheel as artifacts
|
|
21
24
|
uses: actions/upload-artifact@v4
|
|
@@ -24,12 +27,10 @@ jobs:
|
|
|
24
27
|
path: dist
|
|
25
28
|
|
|
26
29
|
- name: Check for packaging errors
|
|
27
|
-
run:
|
|
30
|
+
run: uvx twine check --strict dist/*
|
|
28
31
|
|
|
29
32
|
- name: Install produced wheel
|
|
30
|
-
|
|
31
|
-
with:
|
|
32
|
-
pip-install: dist/*.whl
|
|
33
|
+
run: python -m pip install dist/*.whl
|
|
33
34
|
|
|
34
35
|
- name: Test module --version works using the installed wheel
|
|
35
36
|
# If more than one module in src/ replace with module name to test
|
|
@@ -7,7 +7,7 @@ jobs:
|
|
|
7
7
|
|
|
8
8
|
steps:
|
|
9
9
|
- name: Download artifacts
|
|
10
|
-
uses: actions/download-artifact@
|
|
10
|
+
uses: actions/download-artifact@v5
|
|
11
11
|
with:
|
|
12
12
|
merge-multiple: true
|
|
13
13
|
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
- name: Create GitHub Release
|
|
24
24
|
# We pin to the SHA, not the tag, for security reasons.
|
|
25
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@
|
|
26
|
+
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
|
|
27
27
|
with:
|
|
28
28
|
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
|
|
29
29
|
files: "*"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
on:
|
|
2
|
+
workflow_call:
|
|
3
|
+
inputs:
|
|
4
|
+
python-version:
|
|
5
|
+
type: string
|
|
6
|
+
description: The version of python to install, default is from .python-version file
|
|
7
|
+
default: ""
|
|
8
|
+
runs-on:
|
|
9
|
+
type: string
|
|
10
|
+
description: The runner to run this job on
|
|
11
|
+
required: true
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
# https://github.com/pytest-dev/pytest/issues/2042
|
|
15
|
+
PY_IGNORE_IMPORTMISMATCH: "1"
|
|
16
|
+
UV_PYTHON: ${{ inputs.python-version }}
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
run:
|
|
20
|
+
runs-on: ${{ inputs.runs-on }}
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v5
|
|
25
|
+
with:
|
|
26
|
+
# Need this to get version number from last tag
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v7
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: uv run --locked tox -e tests
|
|
34
|
+
|
|
35
|
+
- name: Upload coverage to Codecov
|
|
36
|
+
uses: codecov/codecov-action@v5
|
|
37
|
+
with:
|
|
38
|
+
name: ${{ inputs.python-version }}/${{ inputs.runs-on }}
|
|
39
|
+
files: cov.xml
|
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
15
|
- name: Checkout
|
|
16
|
-
uses: actions/checkout@
|
|
16
|
+
uses: actions/checkout@v5
|
|
17
17
|
|
|
18
|
-
- name: Install
|
|
19
|
-
uses:
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v7
|
|
20
20
|
|
|
21
21
|
- name: Run tox
|
|
22
|
-
run: tox -e ${{ inputs.tox }}
|
|
22
|
+
run: uv run --locked tox -e ${{ inputs.tox }}
|
|
@@ -2,46 +2,46 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- '*'
|
|
5
9
|
pull_request:
|
|
6
10
|
|
|
7
11
|
jobs:
|
|
8
|
-
check:
|
|
9
|
-
uses: ./.github/workflows/_check.yml
|
|
10
12
|
|
|
11
13
|
lint:
|
|
12
|
-
needs: check
|
|
13
|
-
if: needs.check.outputs.branch-pr == ''
|
|
14
14
|
uses: ./.github/workflows/_tox.yml
|
|
15
15
|
with:
|
|
16
16
|
tox: pre-commit,type-checking
|
|
17
17
|
|
|
18
18
|
test:
|
|
19
|
-
needs: check
|
|
20
|
-
if: needs.check.outputs.branch-pr == ''
|
|
21
19
|
strategy:
|
|
22
20
|
matrix:
|
|
23
21
|
runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
|
|
24
|
-
python-version: ["3.
|
|
25
|
-
include:
|
|
26
|
-
# Include one that runs in the dev environment
|
|
27
|
-
- runs-on: "ubuntu-latest"
|
|
28
|
-
python-version: "dev"
|
|
22
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
29
23
|
fail-fast: false
|
|
30
24
|
uses: ./.github/workflows/_test.yml
|
|
31
25
|
with:
|
|
32
26
|
runs-on: ${{ matrix.runs-on }}
|
|
33
27
|
python-version: ${{ matrix.python-version }}
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
|
|
29
|
+
container:
|
|
30
|
+
needs: test
|
|
31
|
+
if: always()
|
|
32
|
+
uses: ./.github/workflows/_container.yml
|
|
33
|
+
with:
|
|
34
|
+
publish: ${{ needs.test.result == 'success' }}
|
|
35
|
+
permissions:
|
|
36
|
+
contents: read
|
|
37
|
+
packages: write
|
|
36
38
|
|
|
37
39
|
dist:
|
|
38
|
-
needs: check
|
|
39
|
-
if: needs.check.outputs.branch-pr == ''
|
|
40
40
|
uses: ./.github/workflows/_dist.yml
|
|
41
41
|
|
|
42
42
|
pypi:
|
|
43
|
+
needs: [dist, test]
|
|
43
44
|
if: github.ref_type == 'tag'
|
|
44
|
-
needs: dist
|
|
45
45
|
uses: ./.github/workflows/_pypi.yml
|
|
46
46
|
permissions:
|
|
47
47
|
id-token: write
|
|
@@ -49,8 +49,8 @@ jobs:
|
|
|
49
49
|
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
50
50
|
|
|
51
51
|
release:
|
|
52
|
+
needs: [dist, test]
|
|
52
53
|
if: github.ref_type == 'tag'
|
|
53
|
-
needs: [dist]
|
|
54
54
|
uses: ./.github/workflows/_release.yml
|
|
55
55
|
permissions:
|
|
56
56
|
contents: write
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This allow-list is limited to YAML/YML files to cut down SealedSecrets false positives.
|
|
2
|
+
# All gitleaks default rules still apply everywhere (useDefault = true).
|
|
3
|
+
# To broaden this allow-list to all files, comment out the 'paths' line below.
|
|
4
|
+
|
|
5
|
+
[extend]
|
|
6
|
+
useDefault = true
|
|
7
|
+
|
|
8
|
+
[[rules]]
|
|
9
|
+
id = "generic-api-key"
|
|
10
|
+
|
|
11
|
+
# Pattern-only allowlist for long Ag… tokens in YAML
|
|
12
|
+
[[rules.allowlists]]
|
|
13
|
+
condition = "AND"
|
|
14
|
+
regexes = [
|
|
15
|
+
# Boundary-safe Ag… token without lookarounds (RE2-safe)
|
|
16
|
+
'''(?:^|[^A-Za-z0-9+/=])(Ag[A-Za-z0-9+/]{500,}={0,2})(?:[^A-Za-z0-9+/=]|$)'''
|
|
17
|
+
]
|
|
18
|
+
# Limit to YAML only for now. Comment this out if you want it to apply everywhere.
|
|
19
|
+
paths = ['''(?i).*\.ya?ml$''']
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
repos:
|
|
2
2
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
-
rev:
|
|
3
|
+
rev: v5.0.0
|
|
4
4
|
hooks:
|
|
5
5
|
- id: check-added-large-files
|
|
6
|
+
exclude: ^uv.lock
|
|
6
7
|
- id: check-yaml
|
|
7
8
|
- id: check-merge-conflict
|
|
8
9
|
- id: end-of-file-fixer
|
|
@@ -12,7 +13,7 @@ repos:
|
|
|
12
13
|
- id: ruff
|
|
13
14
|
name: lint with ruff
|
|
14
15
|
language: system
|
|
15
|
-
entry: ruff check --force-exclude
|
|
16
|
+
entry: ruff check --force-exclude --fix
|
|
16
17
|
types: [python]
|
|
17
18
|
require_serial: true
|
|
18
19
|
|
|
@@ -22,3 +23,16 @@ repos:
|
|
|
22
23
|
entry: ruff format --force-exclude
|
|
23
24
|
types: [python]
|
|
24
25
|
require_serial: true
|
|
26
|
+
|
|
27
|
+
- id: uv-sync
|
|
28
|
+
name: update uv.lock and venv
|
|
29
|
+
pass_filenames: false
|
|
30
|
+
language: system
|
|
31
|
+
entry: uv sync
|
|
32
|
+
files: ^(uv\.lock|pyproject\.toml)$
|
|
33
|
+
|
|
34
|
+
# TODO restore this when go.org is available at DLS again
|
|
35
|
+
# - repo: https://github.com/gitleaks/gitleaks
|
|
36
|
+
# rev: v8.28.0
|
|
37
|
+
# hooks:
|
|
38
|
+
# - id: gitleaks
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# The devcontainer should use the developer target and run as root with podman
|
|
2
|
+
# or docker with user namespaces.
|
|
3
|
+
FROM ghcr.io/diamondlightsource/ubuntu-devcontainer:noble AS developer
|
|
4
|
+
|
|
5
|
+
# Add any system dependencies for the developer/build environment here
|
|
6
|
+
# RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
7
|
+
# graphviz \
|
|
8
|
+
# && apt-get dist-clean
|
|
9
|
+
|
|
10
|
+
# The build stage installs the context into the venv
|
|
11
|
+
FROM developer AS build
|
|
12
|
+
|
|
13
|
+
# Change the working directory to the `app` directory
|
|
14
|
+
# and copy in the project
|
|
15
|
+
WORKDIR /app
|
|
16
|
+
COPY . /app
|
|
17
|
+
RUN chmod o+wrX .
|
|
18
|
+
|
|
19
|
+
# Tell uv sync to install python in a known location so we can copy it out later
|
|
20
|
+
ENV UV_PYTHON_INSTALL_DIR=/python
|
|
21
|
+
|
|
22
|
+
# Sync the project without its dev dependencies
|
|
23
|
+
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
24
|
+
uv sync --locked --no-editable --no-dev
|
|
25
|
+
|
|
26
|
+
ENV PATH=/app/.venv/bin:$PATH
|
|
27
|
+
|
|
28
|
+
# The runtime stage copies the built venv into a runtime container
|
|
29
|
+
FROM ubuntu:noble AS runtime
|
|
30
|
+
|
|
31
|
+
# Add apt-get system dependecies for runtime here if needed
|
|
32
|
+
# RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
|
33
|
+
# some-library \
|
|
34
|
+
# && apt-get dist-clean
|
|
35
|
+
|
|
36
|
+
# Copy the python installation from the build stage
|
|
37
|
+
COPY --from=build /python /python
|
|
38
|
+
|
|
39
|
+
# Copy the environment, but not the source code
|
|
40
|
+
COPY --from=build /app/.venv /app/.venv
|
|
41
|
+
ENV PATH=/app/.venv/bin:$PATH
|
|
42
|
+
|
|
43
|
+
# change this entrypoint if it is not the same as the repo
|
|
44
|
+
ENTRYPOINT ["rtems-proxy"]
|
|
45
|
+
CMD ["--version"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rtems-proxy
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0b2
|
|
4
4
|
Summary: Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
5
5
|
Author-email: Giles Knap <giles.knap@diamond.ac.uk>
|
|
6
6
|
License: Apache License
|
|
@@ -208,27 +208,18 @@ License: Apache License
|
|
|
208
208
|
Project-URL: GitHub, https://github.com/epics-containers/rtems-proxy
|
|
209
209
|
Classifier: Development Status :: 3 - Alpha
|
|
210
210
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
211
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
212
211
|
Classifier: Programming Language :: Python :: 3.11
|
|
213
212
|
Classifier: Programming Language :: Python :: 3.12
|
|
214
|
-
|
|
213
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
214
|
+
Requires-Python: >=3.11
|
|
215
215
|
Description-Content-Type: text/markdown
|
|
216
216
|
License-File: LICENSE
|
|
217
217
|
Requires-Dist: jinja2
|
|
218
218
|
Requires-Dist: pexpect
|
|
219
219
|
Requires-Dist: ruamel.yaml
|
|
220
|
+
Requires-Dist: stdio-socket>=1.3.1
|
|
220
221
|
Requires-Dist: telnetlib3
|
|
221
222
|
Requires-Dist: typer
|
|
222
|
-
Provides-Extra: dev
|
|
223
|
-
Requires-Dist: copier; extra == "dev"
|
|
224
|
-
Requires-Dist: mypy; extra == "dev"
|
|
225
|
-
Requires-Dist: pipdeptree; extra == "dev"
|
|
226
|
-
Requires-Dist: pre-commit; extra == "dev"
|
|
227
|
-
Requires-Dist: pytest; extra == "dev"
|
|
228
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
|
229
|
-
Requires-Dist: ruff; extra == "dev"
|
|
230
|
-
Requires-Dist: tox-direct; extra == "dev"
|
|
231
|
-
Requires-Dist: types-mock; extra == "dev"
|
|
232
223
|
Dynamic: license-file
|
|
233
224
|
|
|
234
225
|
[](https://github.com/epics-containers/rtems-proxy/actions/workflows/ci.yml)
|
|
@@ -244,8 +235,41 @@ Support for a K8S proxy container in controlling and monitoring RTEMS EPICS IOCs
|
|
|
244
235
|
Source | <https://github.com/epics-containers/rtems-proxy>
|
|
245
236
|
:---: | :---:
|
|
246
237
|
PyPI | `pip install rtems-proxy`
|
|
238
|
+
Docker | `docker run ghcr.io/epics-containers/rtems-proxy:latest`
|
|
247
239
|
Releases | <https://github.com/epics-containers/rtems-proxy/releases>
|
|
248
240
|
|
|
249
241
|
```
|
|
250
242
|
rtems_proxy --help
|
|
251
243
|
```
|
|
244
|
+
## Development
|
|
245
|
+
|
|
246
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management.
|
|
247
|
+
|
|
248
|
+
### Running Tests and Type Checking
|
|
249
|
+
|
|
250
|
+
Use `uv` to run the tox test suite:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
uv run tox -p
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
This will run:
|
|
257
|
+
- `tests` - pytest with coverage
|
|
258
|
+
- `type-checking` - pyright static type checking
|
|
259
|
+
- `pre-commit` - code formatting and linting
|
|
260
|
+
|
|
261
|
+
To run a specific tox environment:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
uv run tox -e type-checking
|
|
265
|
+
uv run tox -e tests
|
|
266
|
+
uv run tox -e pre-commit
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Installing Dependencies
|
|
270
|
+
|
|
271
|
+
Install all dependencies including dev dependencies:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
uv sync --group dev
|
|
275
|
+
```
|